Skip to contentSkip to conversation

*** SUBJECT HERE ***

PATCH New Jit Loon Lim 1 participant 3 messages Aug 31, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover *** SUBJECT HERE ***

*** BLURB HERE ***

Chee Hong Ang (2):
arm: socfpga: soc64: Enable L2 reset on S10
arm: socfpga: soc64: Perform warm reset after L2 reset in SPL on S10

 .../include/mach/reset_manager_soc64.h        |  1 +
 arch/arm/mach-socfpga/lowlevel_init_soc64.S   | 24 ++++++++
 drivers/sysreset/sysreset_socfpga_soc64.c     | 58 ++++++++++++++++++-
 include/configs/socfpga_soc64_common.h        |  7 +++
 4 files changed, 88 insertions(+), 2 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/2 arm: socfpga: soc64: Enable L2 reset on S10

From: Chee Hong Ang <[email protected]>

Put all slave CPUs (CPU1-3) into WFI mode. Master CPU (CPU0) writes the magic word into system manager's scratch register to indicate the system has performed L2 reset and request reset manager to perform hardware handshake and then trigger L2 reset. CPU0 put itself into WFI mode. L2 reset will reboot all HPS CPU cores after which all HPS cores are in WFI mode. L2 reset is followed by warm reset request by SPL via RMR_EL3 system register.
To trigger L2 + warm reset under u-boot, set 'reset=warm' in the u-boot environment then input 'reset' command in the u-boot command prompt.

---
 .../include/mach/reset_manager_soc64.h        |  1 +
 drivers/sysreset/sysreset_socfpga_soc64.c     | 58 ++++++++++++++++++-
 include/configs/socfpga_soc64_common.h        |  7 +++
 3 files changed, 64 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/include/mach/reset_manager_soc64.h +1 -0
index c8bb727aa2..2af6598998 100644
@@ -10,6 +10,7 @@ void reset_deassert_peripherals_handoff(void);
 int cpu_has_been_warmreset(void);
 void print_reset_info(void);
 void socfpga_bridges_reset(int enable);
+void l2_reset_cpu(void);
 
 #define RSTMGR_SOC64_STATUS	0x00
 #define RSTMGR_SOC64_MPUMODRST	0x20
drivers/sysreset/sysreset_socfpga_soc64.c +56 -2

75 lines not on this page · raw message

include/configs/socfpga_soc64_common.h +7 -0
index 06198ddd82..74c88ee2a2 100644
@@ -16,6 +16,13 @@
  */
 /* sysmgr.boot_scratch_cold4 & 5 (64bit) will be used for PSCI_CPU_ON call */
 #define CPU_RELEASE_ADDR		0xFFD12210
+/*
+ * Share sysmgr.boot_scratch_cold6 & 7 (64bit) with VBAR_LE3_BASE_ADDR
+ * Indicate L2 reset is done. HPS should trigger warm reset via RMR_EL3.
+ */
+#define L2_RESET_DONE_REG		0xFFD12218
+/* Magic word to indicate L2 reset is completed */
+#define L2_RESET_DONE_STATUS		0x1228E5E7
 
 /*
  * U-Boot console configurations
Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/2 arm: socfpga: soc64: Perform warm reset after L2 reset in SPL on S10

In reply to Jit Loon Lim

From: Chee Hong Ang <[email protected]>

SPL checks for magic word in system manager's scratch register to find out whether the system has performed L2 reset. If L2 reset was performed, SPL put all slave CPUs (CPU1-3) into WFI mode. Master CPU (CPU0) requests warm reset via RMR_EL3 system register and put itself into WFI mode. Firmware will get the warm reset request from HPS and perform the warm reset sequence to reboot all the HPS cores.

---
 arch/arm/mach-socfpga/lowlevel_init_soc64.S | 24 +++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/mach-socfpga/lowlevel_init_soc64.S +24 -0
index 875927cc4d..1fd0a50b3a 100644
@@ -12,6 +12,30 @@
 ENTRY(lowlevel_init)
 	mov	x29, lr			/* Save LR */
 
+#ifdef CONFIG_SPL_BUILD
+	/* Check for L2 reset magic word */
+	ldr	x4, =L2_RESET_DONE_REG
+	ldr	x5, [x4]
+	ldr	x1, =L2_RESET_DONE_STATUS
+	cmp	x1, x5
+	/* No L2 reset, skip warm reset */
+	b.ne	skipwarmreset
+	/* L2 reset completed */
+	str	xzr, [x4]
+	/* Put all slaves CPUs into WFI mode */
+	branch_if_slave x0, put_cpu_in_wfi
+	/* Master CPU (CPU0) request for warm reset */
+	mrs	x1, rmr_el3
+	orr	x1, x1, #0x02
+	msr	rmr_el3, x1
+	isb
+	dsb	sy
+put_cpu_in_wfi:
+	wfi
+	b	put_cpu_in_wfi
+skipwarmreset:
+#endif
+
 #if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_ATF)
 wait_for_atf:
Signature · 1 line
2.26.2