[PATCH] sunxi: psci: remove redundant initialization from psci_arch_init

Sam Edwards cfsworks at gmail.com
Wed May 31 22:15:20 CEST 2023


The nonsec code overrides/handles these:
- Setting PMR to 0xFF happens earlier, in _nonsec_init, so this is
  redundant.
- The NS bit is not yet set: it gets set later in _secure_monitor.
  Trying to clear it here is pointless and misleading.

Signed-off-by: Sam Edwards <CFSworks at gmail.com>
---
 arch/arm/cpu/armv7/sunxi/psci.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/psci.c
index e1d3638b5c..f866025c37 100644
--- a/arch/arm/cpu/armv7/sunxi/psci.c
+++ b/arch/arm/cpu/armv7/sunxi/psci.c
@@ -300,14 +300,10 @@ void __secure psci_arch_init(void)
 	/* Set SGI15 priority to 0 */
 	writeb(0, GICD_BASE + GICD_IPRIORITYRn + 15);
 
-	/* Be cool with non-secure */
-	writel(0xff, GICC_BASE + GICC_PMR);
-
 	/* Switch FIQEn on */
 	setbits_le32(GICC_BASE + GICC_CTLR, BIT(3));
 
 	reg = cp15_read_scr();
 	reg |= BIT(2);  /* Enable FIQ in monitor mode */
-	reg &= ~BIT(0); /* Secure mode */
 	cp15_write_scr(reg);
 }
-- 
2.39.2



More information about the U-Boot mailing list