[PATCH 2/2] xilinx: zynqmp: Enable reset_cpu() in SPL

Michal Simek michal.simek at amd.com
Mon Jun 3 16:32:13 CEST 2024



On 6/3/24 15:34, lukas.funke-oss at weidmueller.com wrote:
> From: Lukas Funke <lukas.funke at 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 at weidmueller.com>
> ---
> 
>   board/xilinx/zynqmp/zynqmp.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index 95a134b972d..99f5c178c1d 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -40,6 +40,7 @@
>   #include <linux/bitops.h>
>   #include <linux/delay.h>
>   #include <linux/sizes.h>
> +#include <dt-bindings/reset/xlnx-zynqmp-resets.h>
>   #include "../common/board.h"
>   
>   #include "pm_cfg_obj.h"
> @@ -285,6 +286,14 @@ int dram_init(void)
>   #if !CONFIG_IS_ENABLED(SYSRESET)
>   void reset_cpu(void)
>   {
> +	if (!CONFIG_IS_ENABLED(ZYNQMP_FIRMWARE)) {
> +		log_warning("reset failed: ZYNQMP_FIRMWARE disabled");
> +		return;
> +	}
> +
> +	xilinx_pm_request(PM_RESET_ASSERT,
> +			  ZYNQMP_PM_RESET_START + ZYNQMP_RESET_SOFT,
> +			  PM_RESET_ACTION_ASSERT, 0, 0, NULL);

If you disable ZYNQMP_FIRMWARE xilinx_pm_request() should fail.

we should likely fix it in drivers/mmc/zynq_sdhci.c:114

Thanks,
Michal


More information about the U-Boot mailing list