diff options
author | Michal Simek <michal.simek@amd.com> | 2024-12-05 11:38:16 +0100 |
---|---|---|
committer | Michal Simek <michal.simek@amd.com> | 2025-01-14 08:23:47 +0100 |
commit | a6ca9310ef0e929c57ad8873463cc483fc716e59 (patch) | |
tree | 8878ec578e8e52dbf68ba0b5ca75465b7c5010fe | |
parent | 5e3b8e5c49d405dd183bb9ce9dd61802f8cc40cc (diff) |
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 <michal.simek@amd.com>
Link: https://lore.kernel.org/r/72ba2efd0fb7b66a86b409a1521fe288a4dd3453.1733395093.git.michal.simek@amd.com
-rw-r--r-- | board/xilinx/versal/board.c | 15 |
1 files changed, 14 insertions, 1 deletions
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; |