fdt_fixup: Added SoC info fixup

Extended SoC major and minor version fixup
to kernel device-tree on IPQ8064 and IPQ4019.
Also includes cpu_type fixup for IPQ4019.

Find two new entries in the root-node:
soc_version_major, soc_version_minor

Change-Id: I99210aefdc578890b62779d253764b82fe47c543
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
This commit is contained in:
Gokul Sriram Palanisamy 2018-06-27 19:36:09 +05:30
parent d2267ec5cd
commit 6ad0cd2205
2 changed files with 64 additions and 8 deletions

View file

@ -388,6 +388,8 @@ void disable_audio_clks(void)
void ipq_fdt_fixup_socinfo(void *blob)
{
int nodeoff, ret;
uint32_t cpu_type;
uint32_t soc_version, soc_version_major, soc_version_minor;
const char *model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK04.1-C6";
nodeoff = fdt_path_offset(blob, "/");
@ -400,7 +402,37 @@ void ipq_fdt_fixup_socinfo(void *blob)
if (gd->bd->bi_arch_number == MACH_TYPE_IPQ40XX_AP_DK04_1_C6)
ret = fdt_setprop(blob, nodeoff, "model",
model, (strlen(model) + 1));
return;
/* Add "cpu_type" to root node of the devicetree*/
ret = ipq_smem_get_socinfo_cpu_type(&cpu_type);
if (!ret) {
ret = fdt_setprop(blob, nodeoff, "cpu_type",
&cpu_type, sizeof(cpu_type));
if (ret)
printf("%s: cannot set cpu type %d\n", __func__, ret);
} else {
printf("ipq: fdt fixup cannot get socinfo\n");
}
ret = ipq_smem_get_socinfo_version((uint32_t *)&soc_version);
if (!ret) {
soc_version_major = SOCINFO_VERSION_MAJOR(soc_version);
soc_version_minor = SOCINFO_VERSION_MINOR(soc_version);
ret = fdt_setprop(blob, nodeoff, "soc_version_major",
&soc_version_major,
sizeof(soc_version_major));
if (ret)
printf("%s: cannot set soc_version_major %d\n",
__func__, soc_version_major);
ret = fdt_setprop(blob, nodeoff, "soc_version_minor",
&soc_version_minor,
sizeof(soc_version_minor));
if (ret)
printf("%s: cannot set soc_version_minor %d\n",
__func__, soc_version_minor);
}
}
void ipq_fdt_fixup_usb_device_mode(void *blob)

View file

@ -532,20 +532,44 @@ void board_pci_deinit()
void ipq_fdt_fixup_socinfo(void *blob)
{
uint32_t cpu_type;
int ret;
uint32_t soc_version, soc_version_major, soc_version_minor;
int nodeoff, ret;
ret = ipq_smem_get_socinfo_cpu_type(&cpu_type);
if (ret) {
printf("ipq: fdt fixup cannot get socinfo\n");
return;
}
/* Add "cpu_type" to root node of the devicetree*/
ret = fdt_setprop(blob, 0, "cpu_type",
&cpu_type, sizeof(cpu_type));
if (ret)
printf("%s: cannot set cpu type %d\n", __func__, ret);
return;
ret = ipq_smem_get_socinfo_cpu_type(&cpu_type);
if (!ret) {
ret = fdt_setprop(blob, nodeoff, "cpu_type",
&cpu_type, sizeof(cpu_type));
if (ret)
printf("%s: cannot set cpu type %d\n", __func__, ret);
} else {
printf("ipq: fdt fixup cannot get socinfo\n");
}
ret = ipq_smem_get_socinfo_version((uint32_t *)&soc_version);
if (!ret) {
soc_version_major = SOCINFO_VERSION_MAJOR(soc_version);
soc_version_minor = SOCINFO_VERSION_MINOR(soc_version);
ret = fdt_setprop(blob, nodeoff, "soc_version_major",
&soc_version_major,
sizeof(soc_version_major));
if (ret)
printf("%s: cannot set soc_version_major %d\n",
__func__, soc_version_major);
ret = fdt_setprop(blob, nodeoff, "soc_version_minor",
&soc_version_minor,
sizeof(soc_version_minor));
if (ret)
printf("%s: cannot set soc_version_minor %d\n",
__func__, soc_version_minor);
}
}
void ipq_fdt_fixup_usb_device_mode(void *blob)