[PATCH] arm64: versal: Add SelectMAP boot mode identification

Michal Simek michal.simek at amd.com
Thu Sep 21 13:14:12 CEST 2023



On 9/19/23 14:47, Polak, Leszek wrote:
> Add missing SelectMAP bootmode for proper identification during boot.
> 
> The SelectMAP configuration interface provides an 8-bit, 16-bit or
> 32-bit bidirectional data bus interface to the Versal FPGA
> configuration logic that can be used for both configuration and
> readback.
> 
> A connected microcontoller to the SelectMAP interface can load boot
> image with bitstream, TF-A (ARM Trusted Firmware) and U-Boot.
> 
> This commit adds the missing identification of the SelectMAP mode.
> 
> Signed-off-by: Leszek Polak <lpolak at arri.de>
> Cc: Michal Simek <michal.simek at amd.com>
> Cc: Stefan Roese <sr at denx.de>
> ---
>   arch/arm/mach-versal-net/include/mach/hardware.h | 1 +
>   arch/arm/mach-versal/include/mach/hardware.h     | 1 +
>   board/xilinx/versal-net/board.c                  | 4 ++++
>   board/xilinx/versal/board.c                      | 5 +++++
>   4 files changed, 11 insertions(+)
> 
> diff --git a/arch/arm/mach-versal-net/include/mach/hardware.h b/arch/arm/mach-versal-net/include/mach/hardware.h
> index 9bddb8b00723..767cdd368682 100644
> --- a/arch/arm/mach-versal-net/include/mach/hardware.h
> +++ b/arch/arm/mach-versal-net/include/mach/hardware.h
> @@ -66,6 +66,7 @@ struct crp_regs {
>   #define EMMC_MODE	0x00000006
>   #define USB_MODE	0x00000007
>   #define OSPI_MODE	0x00000008
> +#define SELECTMAP_MODE	0x0000000A
>   #define SD1_LSHFT_MODE	0x0000000E /* SD1 Level shifter */
>   #define JTAG_MODE	0x00000000
>   #define BOOT_MODE_USE_ALT	0x100
> diff --git a/arch/arm/mach-versal/include/mach/hardware.h b/arch/arm/mach-versal/include/mach/hardware.h
> index 000af974e867..9d1c2f0dcfc1 100644
> --- a/arch/arm/mach-versal/include/mach/hardware.h
> +++ b/arch/arm/mach-versal/include/mach/hardware.h
> @@ -82,6 +82,7 @@ struct crp_regs {
>   #define EMMC_MODE	0x00000006
>   #define USB_MODE	0x00000007
>   #define OSPI_MODE	0x00000008
> +#define SELECTMAP_MODE	0x0000000A
>   #define SD1_LSHFT_MODE	0x0000000E /* SD1 Level shifter */
>   #define JTAG_MODE	0x00000000
>   #define BOOT_MODE_USE_ALT	0x100
> diff --git a/board/xilinx/versal-net/board.c b/board/xilinx/versal-net/board.c
> index f0d2224b332e..992e0df73b30 100644
> --- a/board/xilinx/versal-net/board.c
> +++ b/board/xilinx/versal-net/board.c
> @@ -287,6 +287,10 @@ int board_late_init(void)
>   		mode = "mmc";
>   		bootseq = dev_seq(dev);
>   		break;
> +	case SELECTMAP_MODE:
> +		puts("SELECTMAP_MODE\n");
> +		mode = "selectmap";

We are not defining distro boot for selectmap that's why boot_targets don't need 
to be extended. That's why please remove this line.

> +		break;
>   	default:
>   		mode = "";
>   		printf("Invalid Boot Mode:0x%x\n", bootmode);
> diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c
> index 60bf37d3c90f..b619dbc73c80 100644
> --- a/board/xilinx/versal/board.c
> +++ b/board/xilinx/versal/board.c
> @@ -213,6 +213,10 @@ int board_late_init(void)
>   		mode = "mmc";
>   		bootseq = dev_seq(dev);
>   		break;
> +	case SELECTMAP_MODE:
> +		puts("SELECTMAP_MODE\n");
> +		mode = "selectmap";

The same here.

> +		break;
>   	default:
>   		mode = "";
>   		printf("Invalid Boot Mode:0x%x\n", bootmode);
> @@ -298,6 +302,7 @@ enum env_location env_get_location(enum env_operation op, int prio)
>   			return ENVL_SPI_FLASH;
>   		return ENVL_NOWHERE;
>   	case JTAG_MODE:
> +	case SELECTMAP_MODE:
>   	default:
>   		return ENVL_NOWHERE;
>   	}
> --
> 2.42.0

The rest looks good to me.

Thanks,
Michal


More information about the U-Boot mailing list