]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: PSCI: Rework the DT handler slightly
authorTom Rini <trini@konsulko.com>
Fri, 6 Mar 2015 01:19:36 +0000 (20:19 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:28:31 +0000 (14:28 +0200)
The way the PSCI DT update happens currently means we pull in
<asm/armv7.h> everywhere, including on ARMv8 and that in turn brings in
<asm/io.h> for some non-PSCI related things that header needs to deal
with.

To fix this, we rework the hook slightly.  A good portion of
arch/arm/cpu/armv7/virt-dt.c is common looking and I hope that when PSCI
is needed on ARMv8 we can re-use this by and large.  So rename the
current hook to psci_update_dt(), move the prototype to <asm/psci.h> and
add an #ifdef that will make re-use later easier.

Reported-by: York Sun <yorksun@freescale.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: York Sun <yorksun@freescale.com>
Cc: Ian Campbell <ijc@hellion.org.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: York Sun <yorksun@freescale.com>
arch/arm/cpu/armv7/virt-dt.c
arch/arm/include/asm/armv7.h
arch/arm/include/asm/psci.h
arch/arm/lib/bootm-fdt.c

index ad19e4c47c2e9947358c1cbcbcd24a5370e94436..9408e33203a1bb62ab4cfdefeebf8bcc379c87a4 100644 (file)
@@ -88,10 +88,12 @@ static int fdt_psci(void *fdt)
        return 0;
 }
 
-int armv7_update_dt(void *fdt)
+int psci_update_dt(void *fdt)
 {
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
        if (!armv7_boot_nonsec())
                return 0;
+#endif
 #ifndef CONFIG_ARMV7_SECURE_BASE
        /* secure code lives in RAM, keep it alive */
        fdt_add_mem_rsv(fdt, (unsigned long)__secure_start,
index edb3b80015ba3d647461c8467d92e5a5356fbb34..c3cc5088ead885fc609874c3008d7e58d4492764 100644 (file)
@@ -124,7 +124,6 @@ void v7_outer_cache_inval_range(u32 start, u32 end);
 #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
 
 int armv7_init_nonsec(void);
-int armv7_update_dt(void *fdt);
 bool armv7_boot_nonsec(void);
 
 /* defined in assembly file */
index 704b4b0018ea293f57c3c8e9aa300934e51d7840..50a3ca45e172b634894d0885fecd3d29c484466b 100644 (file)
@@ -32,4 +32,8 @@
 #define ARM_PSCI_RET_INVAL             (-2)
 #define ARM_PSCI_RET_DENIED            (-3)
 
+#ifndef __ASSEMBLY__
+int psci_update_dt(void *fdt);
+#endif /* ! __ASSEMBLY__ */
+
 #endif /* __ARM_PSCI_H__ */
index d4f1578e9e96fcdbd1434b5c5e663339844ada83..665a3bc37fadb7c42fe6981f6f7bcf4b1360362a 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <common.h>
 #include <fdt_support.h>
-#include <asm/armv7.h>
+#include <asm/psci.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -38,7 +38,7 @@ int arch_fixup_fdt(void *blob)
        if (ret)
                return ret;
 
-       ret = armv7_update_dt(blob);
+       ret = psci_update_dt(blob);
 #endif
        return ret;
 }