[PATCH v3 0/1] Enable reset_cpu() in SPL for ZynqMP

From: Lukas Funke lukas.funke@weidmueller.com
This series enables the CPU reset in the SPL for ZynqMP based platforms. This only works if CONFIG_SYSRESET is disabled. This is usually the case since the the regular sysreset requires bl31 firmware to be loaded in order to hand the sysreset over to PMU firmware. In SPL we can talk to the PMU firmware directly and request a CPU reset.
Changes in v3: - Use 'ZYNQMP_PM_RESET_SOFT' directly - Add comment on what happens if CONFIG_ZYNQMP_FIRMWARE is not enabled
Changes in v2: - Drop 2/2 since reworking ZYNQMP_FIRMWARE dependency is out-of-scope
Lukas Funke (1): xilinx: zynqmp: Enable reset_cpu() in SPL
board/xilinx/zynqmp/zynqmp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)

From: Lukas Funke lukas.funke@weidmueller.com
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 ---
Changes in v3: - Use 'ZYNQMP_PM_RESET_SOFT' directly - Add comment on what happens if CONFIG_ZYNQMP_FIRMWARE is not enabled
Changes in v2: - Drop 2/2 since reworking ZYNQMP_FIRMWARE dependency is out-of-scope
board/xilinx/zynqmp/zynqmp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index f370fb7347a..c37c198ec55 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -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

On 6/7/24 11:26, lukas.funke-oss@weidmueller.com wrote:
From: Lukas Funke lukas.funke@weidmueller.com
This series enables the CPU reset in the SPL for ZynqMP based platforms. This only works if CONFIG_SYSRESET is disabled. This is usually the case since the the regular sysreset requires bl31 firmware to be loaded in order to hand the sysreset over to PMU firmware. In SPL we can talk to the PMU firmware directly and request a CPU reset.
Changes in v3:
- Use 'ZYNQMP_PM_RESET_SOFT' directly
- Add comment on what happens if CONFIG_ZYNQMP_FIRMWARE is not enabled
Changes in v2:
- Drop 2/2 since reworking ZYNQMP_FIRMWARE dependency is out-of-scope
Lukas Funke (1): xilinx: zynqmp: Enable reset_cpu() in SPL
board/xilinx/zynqmp/zynqmp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Applied. M
participants (2)
-
lukas.funke-oss@weidmueller.com
-
Michal Simek