From: Michal Simek Date: Thu, 5 Dec 2024 10:38:16 +0000 (+0100) Subject: arm64: versal: Support operations around multiboot register X-Git-Tag: v2025.04-rc1~62^2~13 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6ca9310ef0e929c57ad8873463cc483fc716e59;p=pandora-u-boot.git arm64: versal: Support operations around multiboot register Read multiboot register and show it's value by default. Also extend logic in dfu_alt_info string generation to support capsule update for different offsets. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/72ba2efd0fb7b66a86b409a1521fe288a4dd3453.1733395093.git.michal.simek@amd.com --- diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 964a779b5f1..d05220f96ff 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -36,9 +36,15 @@ static xilinx_desc versalpl = { }; #endif +static u32 versal_multi_boot(void) +{ + return readl(0xF1110004); +} + int board_init(void) { printf("EL Level:\tEL%d\n", current_el()); + printf("Multiboot:\t%d\n", versal_multi_boot()); #if defined(CONFIG_FPGA_VERSALPL) fpga_init(); @@ -375,6 +381,7 @@ static void mtd_found_part(u32 *base, u32 *size) void set_dfu_alt_info(char *interface, char *devstr) { int bootseq = 0, len = 0; + u32 multiboot = versal_multi_boot(); u32 bootmode = versal_get_bootmode(); ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN); @@ -384,6 +391,8 @@ void set_dfu_alt_info(char *interface, char *devstr) memset(buf, 0, sizeof(buf)); + multiboot = env_get_hex("multiboot", multiboot); + switch (bootmode) { case EMMC_MODE: case SD_MODE: @@ -394,6 +403,10 @@ void set_dfu_alt_info(char *interface, char *devstr) len += snprintf(buf + len, DFU_ALT_BUF_LEN, "mmc %d=boot", bootseq); + if (multiboot) + len += snprintf(buf + len, DFU_ALT_BUF_LEN, + "%04d", multiboot); + len += snprintf(buf + len, DFU_ALT_BUF_LEN, ".bin fat %d 1", bootseq); break; @@ -401,7 +414,7 @@ void set_dfu_alt_info(char *interface, char *devstr) case QSPI_MODE_32BIT: case OSPI_MODE: { - u32 base = 0; + u32 base = multiboot * SZ_32K; u32 size = 0x1500000; u32 limit = size;