[PATCH] arm64: zynqmp: Also support JTAG as alternative boot mode

Sean Anderson sean.anderson at linux.dev
Thu Mar 21 17:20:35 CET 2024


On 3/20/24 07:18, Michal Simek wrote:
> if (reg >> BOOT_MODE_ALT_SHIFT) condition rules out alternative jtag boot
> mode which is 0. When 0 was used origin(HW) boot mode was used instead.
> That's why directly fill reg variable with requested boot mode and don't
> let code to read value back. "else" part of code remain unchanged.
> 
> Signed-off-by: Michal Simek <michal.simek at amd.com>
> ---
> 
>  arch/arm/mach-zynqmp/spl.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c
> index 5af735aa5cef..979ff3aef6c2 100644
> --- a/arch/arm/mach-zynqmp/spl.c
> +++ b/arch/arm/mach-zynqmp/spl.c
> @@ -91,13 +91,14 @@ u32 spl_boot_device(void)
>  
>  #if defined(CONFIG_SPL_ZYNQMP_ALT_BOOTMODE_ENABLED)
>  	/* Change default boot mode at run-time */
> +	reg = CONFIG_SPL_ZYNQMP_ALT_BOOTMODE;
>  	writel(CONFIG_SPL_ZYNQMP_ALT_BOOTMODE << BOOT_MODE_ALT_SHIFT,
>  	       &crlapb_base->boot_mode);
> -#endif
> -
> +#else
>  	reg = readl(&crlapb_base->boot_mode);
>  	if (reg >> BOOT_MODE_ALT_SHIFT)
>  		reg >>= BOOT_MODE_ALT_SHIFT;
> +#endif
>  
>  	bootmode = reg & BOOT_MODES_MASK;
>  

Looks fine; can we change this to

if (IS_ENABLED(CONFIG_SPL_ZYNQMP_ALT_BOOTMODE_ENABLED)) {
	...
} else {
	...
}

?

--Sean


More information about the U-Boot mailing list