diff options
author | Michal Simek | 2023-11-10 13:34:35 +0100 |
---|---|---|
committer | Michal Simek | 2023-12-13 08:58:06 +0100 |
commit | 2c8a09219cdb04450173f41a0b5449998b8031c4 (patch) | |
tree | 707c91d68895a15b6bf772ff5a0eb57837506385 /board/xilinx | |
parent | 218539e2e7fab46bb35fb09b38ac4de4480e7836 (diff) |
arm64: zynqmp: Add multiboot support for SPL/SPI offset calculation
In case of A/B update systems there should be an option to load the same
binary/binaries to different location and they should work.
Before this patch boot.bin with U-Boot SPL can be added to whatever 32k
offset in SPI and SPL finds u-boot.itb at CONFIG_SYS_SPI_U_BOOT_OFFS
offset. In case of A/B update systems that means that SPL is at different
locations but it still points to the same u-boot.itb which is not correct.
That's why include multiboot value to offset calculation to be able to
point to image from the same base.
It doesn't affect any current system which starts from 0 offset.
This patch also change Kria defconfig which uses A/B setup. Partition
A starts at multiboot 64, partition B at multiboot 496.
And also print message about used SPI offset which is useful for all cases.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/93903a53ad9358ae69991558b787f574797effbe.1699619666.git.michal.simek@amd.com
Diffstat (limited to 'board/xilinx')
-rw-r--r-- | board/xilinx/zynqmp/zynqmp.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index f1628030848..59feaaf6f32 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -681,3 +681,18 @@ void set_dfu_alt_info(char *interface, char *devstr) puts("DFU alt info setting: done\n"); } #endif + +#if defined(CONFIG_SPL_SPI_LOAD) +unsigned int spl_spi_get_uboot_offs(struct spi_flash *flash) +{ + u32 offset; + int multiboot = multi_boot(); + + offset = multiboot * SZ_32K; + offset += CONFIG_SYS_SPI_U_BOOT_OFFS; + + log_info("SPI offset:\t0x%x\n", offset); + + return offset; +} +#endif |