Merge "ipq806x: support to add the boot version to the device tree"

This commit is contained in:
Linux Build Service Account 2018-01-25 03:30:48 -08:00 committed by Gerrit - the friendly Code Review server
commit ff83336bcd
2 changed files with 22 additions and 0 deletions

View file

@ -366,6 +366,20 @@ int smem_get_boot_flash(uint32_t *flash_type,
return 0;
}
int ipq_smem_get_boot_version(char *version_name, int buf_size)
{
int ret;
qca_platform_v1 platform_info;
ret = smem_read_alloc_entry(SMEM_HW_SW_BUILD_ID, &platform_info,
sizeof(qca_platform_v1));
if (ret != 0)
return -ENOMSG;
snprintf(version_name, buf_size, "%s\n", platform_info.build_id);
return ret;
}
int smem_get_build_version(char *version_name, int buf_size, int index)
{
int ret;

View file

@ -122,6 +122,14 @@ void ipq_fdt_fixup_version(void *blob)
if (ret)
debug("fdt-fixup: unable to set Boot version(%d)\n", ret);
}
/* ipq806x doesn't have image version table in SMEM */
else if (!ipq_smem_get_boot_version(ver, sizeof(ver))) {
debug("BOOT Build Version: %s\n", ver);
ret = fdt_setprop(blob, nodeoff, "boot_version",
ver, strlen(ver));
if (ret)
debug("fdt-fixup: unable to set Boot version(%d)\n", ret);
}
if (!smem_get_build_version(ver, sizeof(ver), TZ_VERSION)) {
debug("TZ Build Version: %s\n", ver);