nmhw21,26: getting hardware type from BD

this is the precursor to make the bootloader hw26 aware.
This commit is contained in:
Rene Straub 2020-06-15 13:45:51 +02:00
parent f51b3b4fc3
commit a02c9b9da3
1 changed files with 13 additions and 2 deletions

View File

@ -148,6 +148,7 @@ DECLARE_GLOBAL_DATA_PTR;
static int hw_ver = -1;
static int hw_rev = -1;
static int hw_patch = -1;
static int hw_type = -1;
static char hw_variant_name[64];
#endif
@ -983,8 +984,13 @@ static void get_hw_version(void)
bd_get_hw_version(&hw_ver, &hw_rev);
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 */
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_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