From c2a95f152fcd47fce9a45d60c1951dadfdc2ffa6 Mon Sep 17 00:00:00 2001 From: Gokul Sriram Palanisamy Date: Mon, 24 Jul 2017 18:45:31 +0530 Subject: [PATCH] ARM: ipq8074: Added support to patch soc_id This patch enables reading soc_id form smem required by thermal deamon in kernel and patches it to kernel dtb. Change-Id: If4d68d10e47eeed26a9c2867f40abc18d9027812 Signed-off-by: Gokul Sriram Palanisamy --- board/qca/arm/ipq807x/ipq807x.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/board/qca/arm/ipq807x/ipq807x.c b/board/qca/arm/ipq807x/ipq807x.c index b85704daa2..8d6b4ae2b3 100644 --- a/board/qca/arm/ipq807x/ipq807x.c +++ b/board/qca/arm/ipq807x/ipq807x.c @@ -688,7 +688,25 @@ int ipq_board_usb_init(void) int ipq_fdt_fixup_socinfo(void *blob) { - return 0; + uint32_t cpu_type; + int nodeoff, ret; + + ret = ipq_smem_get_socinfo_cpu_type(&cpu_type); + if (ret) { + printf("ipq: fdt fixup cannot get socinfo\n"); + return ret; + } + nodeoff = fdt_path_offset(blob, "/"); + + if (nodeoff < 0) { + printf("ipq: fdt fixup cannot find root node\n"); + return nodeoff; + } + ret = fdt_setprop(blob, nodeoff, "cpu_type", + &cpu_type, sizeof(cpu_type)); + if (ret) + printf("%s: cannot set cpu type %d\n", __func__, ret); + return ret; } void ipq_fdt_fixup_usb_device_mode(void *blob)