hw21,26: set hw type in device-tree

- hardware type is stored as string under
  /proc/device-tree/nm,carrierboard,type

(cherry picked from commit f89b5527b7)
This commit is contained in:
Rene Straub 2020-08-17 16:31:19 +02:00 committed by Marcel Reichmuth
parent 63562ef303
commit ef1aa826dd
1 changed files with 6 additions and 3 deletions

View File

@ -1861,14 +1861,17 @@ static void ft_bootloader_version(void *blob)
static void ft_hw_info(void *blob)
{
int node_offset;
char hw_version[16];
char hw_version_str[16];
char hw_type_str[8];
snprintf(hw_version, sizeof(hw_version), "%d.%d.%d", hw_ver, hw_rev, hw_patch);
snprintf(hw_version_str, sizeof(hw_version_str), "%d.%d.%d", hw_ver, hw_rev, hw_patch);
snprintf(hw_type_str, sizeof(hw_type_str), "%d", hw_type);
node_offset = fdt_path_offset(blob, "/");
if (node_offset != -1) {
fdt_setprop_string(blob, node_offset, "model", hw_variant_name);
fdt_setprop_string(blob, node_offset, "nm,carrierboard,version", hw_version);
fdt_setprop_string(blob, node_offset, "nm,carrierboard,version", hw_version_str);
fdt_setprop_string(blob, node_offset, "nm,carrierboard,type", hw_type_str);
}
}