]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
xilinx: zynqmp: Enable reset_cpu() in SPL
authorLukas Funke <lukas.funke@weidmueller.com>
Fri, 7 Jun 2024 09:26:08 +0000 (11:26 +0200)
committerMichal Simek <michal.simek@amd.com>
Mon, 17 Jun 2024 14:02:30 +0000 (16:02 +0200)
This commit enables SPL to reset the CPU via PMU-firmware. The usual
reset mechanism requires bl31 to be loaded which may not be the case in
SPL.

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Link: https://lore.kernel.org/r/20240607092608.712996-2-lukas.funke-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
board/xilinx/zynqmp/zynqmp.c

index 63cc6b862e9d3dbe56fbd36c1e9b3811629304b7..b4c15b041ccb85faa138ee12a7fbc1004a2896ef 100644 (file)
@@ -285,6 +285,18 @@ int dram_init(void)
 #if !CONFIG_IS_ENABLED(SYSRESET)
 void reset_cpu(void)
 {
+       if (!IS_ENABLED(CONFIG_ZYNQMP_FIRMWARE)) {
+               log_warning("reset failed: ZYNQMP_FIRMWARE disabled");
+               return;
+       }
+
+       /* In case of !CONFIG_ZYNQMP_FIRMWARE the call to 'xilinx_pm_request()'
+        * will be removed by the compiler due to the early return.
+        * If CONFIG_ZYNQMP_FIRMWARE is defined in SPL 'xilinx_pm_request()'
+        * will send command over IPI and requires pmufw to be present.
+        */
+       xilinx_pm_request(PM_RESET_ASSERT, ZYNQMP_PM_RESET_SOFT,
+                         PM_RESET_ACTION_ASSERT, 0, 0, NULL);
 }
 #endif