[U-Boot] [PATCH v2 2/9] ARM: PSCI: Alow arch specific DT patching

Arnab Basu arnab_basu at rocketmail.com
Mon Jan 12 21:55:09 CET 2015


Both ARMv7 and ARMv8 need to patch the device tree but the kind
of patching done is different. This creates a function that can be
defined by each architecture to handle the differences

Signed-off-by: Arnab Basu <arnab_basu at rocketmail.com>
Cc: Bhupesh Sharma <bhupesh.sharma at freescale.com>
Cc: Marc Zyngier <marc.zyngier at arm.com>
---
 arch/arm/cpu/armv7/virt-dt.c |  7 ++++++-
 arch/arm/lib/bootm-fdt.c     | 11 ++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/virt-dt.c b/arch/arm/cpu/armv7/virt-dt.c
index ad19e4c..cb4cd53 100644
--- a/arch/arm/cpu/armv7/virt-dt.c
+++ b/arch/arm/cpu/armv7/virt-dt.c
@@ -88,7 +88,7 @@ static int fdt_psci(void *fdt)
 	return 0;
 }
 
-int armv7_update_dt(void *fdt)
+static int armv7_update_dt(void *fdt)
 {
 	if (!armv7_boot_nonsec())
 		return 0;
@@ -100,3 +100,8 @@ int armv7_update_dt(void *fdt)
 
 	return fdt_psci(fdt);
 }
+
+int cpu_update_dt(void *fdt)
+{
+	return armv7_update_dt(fdt);
+}
diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c
index d4f1578..daabc03 100644
--- a/arch/arm/lib/bootm-fdt.c
+++ b/arch/arm/lib/bootm-fdt.c
@@ -21,6 +21,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+__weak int cpu_update_dt(void *fdt)
+{
+	return 0;
+}
+
 int arch_fixup_fdt(void *blob)
 {
 	bd_t *bd = gd->bd;
@@ -34,11 +39,11 @@ int arch_fixup_fdt(void *blob)
 	}
 
 	ret = fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
-#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+
 	if (ret)
 		return ret;
 
-	ret = armv7_update_dt(blob);
-#endif
+	ret = cpu_update_dt(blob);
+
 	return ret;
 }
-- 
1.9.1



More information about the U-Boot mailing list