nmhw21,26: getting hardware type from BD
this is the precursor to make the bootloader hw26 aware.
This commit is contained in:
parent
f51b3b4fc3
commit
a02c9b9da3
|
|
@ -148,6 +148,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||||
static int hw_ver = -1;
|
static int hw_ver = -1;
|
||||||
static int hw_rev = -1;
|
static int hw_rev = -1;
|
||||||
static int hw_patch = -1;
|
static int hw_patch = -1;
|
||||||
|
static int hw_type = -1;
|
||||||
static char hw_variant_name[64];
|
static char hw_variant_name[64];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -983,8 +984,13 @@ static void get_hw_version(void)
|
||||||
|
|
||||||
bd_get_hw_version(&hw_ver, &hw_rev);
|
bd_get_hw_version(&hw_ver, &hw_rev);
|
||||||
bd_get_hw_patch(&hw_patch);
|
bd_get_hw_patch(&hw_patch);
|
||||||
|
bd_get_hw_type(&hw_type);
|
||||||
|
if (hw_type == 0) {
|
||||||
|
/* Fallback to HW21 if tag is not present */
|
||||||
|
hw_type = 21;
|
||||||
|
}
|
||||||
|
|
||||||
printf("HW21: V%d.%d\n", hw_ver, hw_rev);
|
printf("HW%02d: V%d.%d\n", hw_type, hw_ver, hw_rev);
|
||||||
|
|
||||||
/* add hardware versions to environment */
|
/* add hardware versions to environment */
|
||||||
snprintf(hw_versions, sizeof(hw_versions), "CP=%d.%d", hw_ver, hw_rev);
|
snprintf(hw_versions, sizeof(hw_versions), "CP=%d.%d", hw_ver, hw_rev);
|
||||||
|
|
@ -998,8 +1004,13 @@ static void get_hw_version(void)
|
||||||
{
|
{
|
||||||
bd_get_hw_version(&hw_ver, &hw_rev);
|
bd_get_hw_version(&hw_ver, &hw_rev);
|
||||||
bd_get_hw_patch(&hw_patch);
|
bd_get_hw_patch(&hw_patch);
|
||||||
|
bd_get_hw_type(&hw_type);
|
||||||
|
if (hw_type == 0) {
|
||||||
|
/* Fallback to HW21 if tag is not present */
|
||||||
|
hw_type = 21;
|
||||||
|
}
|
||||||
|
|
||||||
printf("MB: V%d.%d\n", hw_ver, hw_rev);
|
printf("MB: V%d.%d (HW%2d)\n", hw_ver, hw_rev, hw_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue