CFG_SYS_SPI_* are used in falcon boot to specify the offsets and size of the respective payloads. This patch moves them to Kconfig keeping the values consistent for each of the affected boards.
Reviewed-by: Tom Rini <tr...@konsulko.com> Reviewed-by: Fabio Estevam <feste...@gmail.com> Signed-off-by: Anshul Dalal <ansh...@ti.com> --- Tested: * U-boot CI: https://github.com/u-boot/u-boot/pull/750 Changes in v2: * Spell fixes in commit message and Kconfig help * Remove redundant header linux/sizes.h from xea.h * Add Reviewed-by tags form Tom Rini and Fabio Estevam v1: https://lore.kernel.org/u-boot/20250310133647.2712374-1-ansh...@ti.com/ --- common/spl/Kconfig | 18 ++++++++++++++++++ common/spl/spl_spi.c | 9 +++++---- configs/am57xx_evm_defconfig | 3 +++ configs/am57xx_hs_evm_defconfig | 3 +++ configs/am57xx_hs_evm_usb_defconfig | 3 +++ configs/display5_defconfig | 3 +++ configs/display5_factory_defconfig | 3 +++ configs/dra7xx_evm_defconfig | 3 +++ configs/dra7xx_hs_evm_defconfig | 3 +++ configs/dra7xx_hs_evm_usb_defconfig | 3 +++ configs/imx28_xea_defconfig | 3 +++ configs/xilinx_zynq_virt_defconfig | 3 +++ configs/xilinx_zynqmp_kria_defconfig | 3 +++ configs/xilinx_zynqmp_virt_defconfig | 3 +++ include/configs/am57xx_evm.h | 16 ---------------- include/configs/display5.h | 5 ----- include/configs/dra7xx_evm.h | 16 ---------------- include/configs/xea.h | 8 -------- include/configs/xilinx_zynqmp.h | 6 ------ include/configs/zynq-common.h | 8 -------- 20 files changed, 59 insertions(+), 63 deletions(-) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 94e118f8465..21a5cefee7a 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1431,6 +1431,24 @@ config SYS_SPI_U_BOOT_OFFS Address within SPI-Flash from where the u-boot payload is fetched from. +config SYS_SPI_KERNEL_OFFS + hex "Falcon mode: address of kernel payload in SPI flash" + depends on SPL_SPI_FLASH_SUPPORT && SPL_OS_BOOT + help + Address within SPI-Flash from where the kernel payload is fetched + in falcon boot. + +config SYS_SPI_ARGS_OFFS + hex "Falcon mode: address of args payload in SPI flash" + depends on SPL_SPI_FLASH_SUPPORT && SPL_OS_BOOT + help + Address within SPI-Flash from where the args payload (usually the + dtb) is fetched in falcon boot. + +config SYS_SPI_ARGS_SIZE + hex "Falcon mode: size of args payload in SPI flash" + depends on SPL_SPI_FLASH_SUPPORT && SPL_OS_BOOT + config SPL_THERMAL bool "Driver support for thermal devices" help diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 691a431a926..00dbd3011f0 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -82,13 +82,14 @@ static int spl_spi_load_image(struct spl_image_info *spl_image, #if CONFIG_IS_ENABLED(OS_BOOT) if (spl_start_uboot()) { int err = spl_load(spl_image, bootdev, &load, 0, - CFG_SYS_SPI_KERNEL_OFFS); + CONFIG_SYS_SPI_KERNEL_OFFS); if (!err) /* Read device tree. */ - return spi_flash_read(flash, CFG_SYS_SPI_ARGS_OFFS, - CFG_SYS_SPI_ARGS_SIZE, - (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR); + return spi_flash_read( + flash, CONFIG_SYS_SPI_ARGS_OFFS, + CONFIG_SYS_SPI_ARGS_SIZE, + (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR); } #endif diff --git a/configs/am57xx_evm_defconfig b/configs/am57xx_evm_defconfig index d10d2a5940f..0cfad501298 100644 --- a/configs/am57xx_evm_defconfig +++ b/configs/am57xx_evm_defconfig @@ -41,6 +41,9 @@ CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR=0x1500 CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS=0x200 CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x1E0000 +CONFIG_SYS_SPI_ARGS_OFFS=0x140000 +CONFIG_SYS_SPI_ARGS_SIZE=0x80000 CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y diff --git a/configs/am57xx_hs_evm_defconfig b/configs/am57xx_hs_evm_defconfig index 5cacd7f9cc5..14700d59bdb 100644 --- a/configs/am57xx_hs_evm_defconfig +++ b/configs/am57xx_hs_evm_defconfig @@ -39,6 +39,9 @@ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img" CONFIG_SPL_DM_SPI_FLASH=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x1E0000 +CONFIG_SYS_SPI_ARGS_OFFS=0x140000 +CONFIG_SYS_SPI_ARGS_SIZE=0x80000 CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y diff --git a/configs/am57xx_hs_evm_usb_defconfig b/configs/am57xx_hs_evm_usb_defconfig index d865b123b90..634294e4766 100644 --- a/configs/am57xx_hs_evm_usb_defconfig +++ b/configs/am57xx_hs_evm_usb_defconfig @@ -41,6 +41,9 @@ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img" CONFIG_SPL_DM_SPI_FLASH=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x1E0000 +CONFIG_SYS_SPI_ARGS_OFFS=0x140000 +CONFIG_SYS_SPI_ARGS_SIZE=0x80000 CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y diff --git a/configs/display5_defconfig b/configs/display5_defconfig index 765920bd5d1..b30b52f068c 100644 --- a/configs/display5_defconfig +++ b/configs/display5_defconfig @@ -53,6 +53,9 @@ CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR=0x3F00 CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS=0x10 CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x150000 +CONFIG_SYS_SPI_ARGS_OFFS=0x140000 +CONFIG_SYS_SPI_ARGS_SIZE=0x10000 CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="display5 > " CONFIG_SYS_MAXARGS=32 diff --git a/configs/display5_factory_defconfig b/configs/display5_factory_defconfig index 4007c8900ce..9965e00a1d0 100644 --- a/configs/display5_factory_defconfig +++ b/configs/display5_factory_defconfig @@ -48,6 +48,9 @@ CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR=0x3F00 CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS=0x10 CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x150000 +CONFIG_SYS_SPI_ARGS_OFFS=0x140000 +CONFIG_SYS_SPI_ARGS_SIZE=0x10000 CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="display5 factory > " CONFIG_SYS_MAXARGS=32 diff --git a/configs/dra7xx_evm_defconfig b/configs/dra7xx_evm_defconfig index 2448befb295..f9cb732357c 100644 --- a/configs/dra7xx_evm_defconfig +++ b/configs/dra7xx_evm_defconfig @@ -43,6 +43,9 @@ CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR=0x1500 CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS=0x200 CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x1E0000 +CONFIG_SYS_SPI_ARGS_OFFS=0x140000 +CONFIG_SYS_SPI_ARGS_SIZE=0x80000 CONFIG_CMD_SPL=y CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2 CONFIG_CMD_NAND=y diff --git a/configs/dra7xx_hs_evm_defconfig b/configs/dra7xx_hs_evm_defconfig index f6f00454aaa..81da64be811 100644 --- a/configs/dra7xx_hs_evm_defconfig +++ b/configs/dra7xx_hs_evm_defconfig @@ -40,6 +40,9 @@ CONFIG_SPL_NAND_ECC=y CONFIG_SPL_DM_SPI_FLASH=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x1E0000 +CONFIG_SYS_SPI_ARGS_OFFS=0x140000 +CONFIG_SYS_SPI_ARGS_SIZE=0x80000 CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2 CONFIG_CMD_NAND=y CONFIG_BOOTP_DNS2=y diff --git a/configs/dra7xx_hs_evm_usb_defconfig b/configs/dra7xx_hs_evm_usb_defconfig index 850ccd934b7..1d099a56ee8 100644 --- a/configs/dra7xx_hs_evm_usb_defconfig +++ b/configs/dra7xx_hs_evm_usb_defconfig @@ -39,6 +39,9 @@ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img" CONFIG_SPL_DM_SPI_FLASH=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x1E0000 +CONFIG_SYS_SPI_ARGS_OFFS=0x140000 +CONFIG_SYS_SPI_ARGS_SIZE=0x80000 CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2 # CONFIG_CMD_SETEXPR is not set diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig index 38282e6ea92..348e2735350 100644 --- a/configs/imx28_xea_defconfig +++ b/configs/imx28_xea_defconfig @@ -62,6 +62,9 @@ CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR=0x400 CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS=0x40 CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x10000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x100000 +CONFIG_SYS_SPI_ARGS_OFFS=0x80000 +CONFIG_SYS_SPI_ARGS_SIZE=0x8000 CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_MAXARGS=32 diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig index 9196a95e88a..7167b9f4bc1 100644 --- a/configs/xilinx_zynq_virt_defconfig +++ b/configs/xilinx_zynq_virt_defconfig @@ -50,6 +50,9 @@ CONFIG_SPL_OS_BOOT=y CONFIG_SPL_PAYLOAD_ARGS_ADDR=0x10000000 CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x280000 +CONFIG_SYS_SPI_ARGS_OFFS=0x200000 +CONFIG_SYS_SPI_ARGS_SIZE=0x80000 CONFIG_SYS_MAXARGS=32 # CONFIG_BOOTM_NETBSD is not set CONFIG_CMD_IMLS=y diff --git a/configs/xilinx_zynqmp_kria_defconfig b/configs/xilinx_zynqmp_kria_defconfig index 1a6bd67afb8..269cd4953d1 100644 --- a/configs/xilinx_zynqmp_kria_defconfig +++ b/configs/xilinx_zynqmp_kria_defconfig @@ -57,6 +57,9 @@ CONFIG_SPL_PAYLOAD_ARGS_ADDR=0x8000000 CONFIG_SPL_RAM_DEVICE=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x80000 +CONFIG_SYS_SPI_ARGS_OFFS=0xa0000 +CONFIG_SYS_SPI_ARGS_SIZE=0xa0000 CONFIG_SPL_ATF=y CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y CONFIG_CMD_SMBIOS=y diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index e5e56babf4c..7bb017deec8 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -55,6 +55,9 @@ CONFIG_SPL_PAYLOAD_ARGS_ADDR=0x8000000 CONFIG_SPL_RAM_DEVICE=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000 +CONFIG_SYS_SPI_KERNEL_OFFS=0x80000 +CONFIG_SYS_SPI_ARGS_OFFS=0xa0000 +CONFIG_SYS_SPI_ARGS_SIZE=0xa0000 CONFIG_SPL_ATF=y CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y CONFIG_CMD_SMBIOS=y diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h index aa31f3b05a0..266b77fbf68 100644 --- a/include/configs/am57xx_evm.h +++ b/include/configs/am57xx_evm.h @@ -37,20 +37,4 @@ /* CPSW Ethernet */ -/* - * Default to using SPI for environment, etc. - * 0x000000 - 0x040000 : QSPI.SPL (256KiB) - * 0x040000 - 0x140000 : QSPI.u-boot (1MiB) - * 0x140000 - 0x1C0000 : QSPI.u-boot-spl-os (512KiB) - * 0x1C0000 - 0x1D0000 : QSPI.u-boot-env (64KiB) - * 0x1D0000 - 0x1E0000 : QSPI.u-boot-env.backup1 (64KiB) - * 0x1E0000 - 0x9E0000 : QSPI.kernel (8MiB) - * 0x9E0000 - 0x2000000 : USERLAND - */ -#define CFG_SYS_SPI_KERNEL_OFFS 0x1E0000 -#define CFG_SYS_SPI_ARGS_OFFS 0x140000 -#define CFG_SYS_SPI_ARGS_SIZE 0x80000 - -/* SPI SPL */ - #endif /* __CONFIG_AM57XX_EVM_H */ diff --git a/include/configs/display5.h b/include/configs/display5.h index 51fa2b03a2e..1d5cde5ac75 100644 --- a/include/configs/display5.h +++ b/include/configs/display5.h @@ -29,11 +29,6 @@ * 0x1F00000 - 0x2000000 : SPI.factory (1MiB) */ -/* Below values are "dummy" - only to avoid build break */ -#define CFG_SYS_SPI_KERNEL_OFFS 0x150000 -#define CFG_SYS_SPI_ARGS_OFFS 0x140000 -#define CFG_SYS_SPI_ARGS_SIZE 0x10000 - #define CFG_MXC_UART_BASE UART5_BASE /* MMC Configs */ diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 96dcd731cb6..3c960ca2ce2 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -47,22 +47,6 @@ #include <configs/ti_omap5_common.h> -/* - * Default to using SPI for environment, etc. - * 0x000000 - 0x040000 : QSPI.SPL (256KiB) - * 0x040000 - 0x140000 : QSPI.u-boot (1MiB) - * 0x140000 - 0x1C0000 : QSPI.u-boot-spl-os (512KiB) - * 0x1C0000 - 0x1D0000 : QSPI.u-boot-env (64KiB) - * 0x1D0000 - 0x1E0000 : QSPI.u-boot-env.backup1 (64KiB) - * 0x1E0000 - 0x9E0000 : QSPI.kernel (8MiB) - * 0x9E0000 - 0x2000000 : USERLAND - */ -#define CFG_SYS_SPI_KERNEL_OFFS 0x1E0000 -#define CFG_SYS_SPI_ARGS_OFFS 0x140000 -#define CFG_SYS_SPI_ARGS_SIZE 0x80000 - -/* SPI SPL */ - /* NAND support */ #ifdef CONFIG_MTD_RAW_NAND /* NAND: device related configs */ diff --git a/include/configs/xea.h b/include/configs/xea.h index 00d62748733..21454d13d21 100644 --- a/include/configs/xea.h +++ b/include/configs/xea.h @@ -12,14 +12,6 @@ #ifndef __CONFIGS_XEA_H__ #define __CONFIGS_XEA_H__ -#include <linux/sizes.h> - -/* SPL */ - -#define CFG_SYS_SPI_KERNEL_OFFS SZ_1M -#define CFG_SYS_SPI_ARGS_OFFS SZ_512K -#define CFG_SYS_SPI_ARGS_SIZE SZ_32K - /* Memory configuration */ #define PHYS_SDRAM_1 0x40000000 /* Base address */ #define PHYS_SDRAM_1_SIZE 0x10000000 /* Max 256 MB RAM */ diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 13941ba3589..ec78f2ee8ed 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -194,12 +194,6 @@ "dfu_bufsiz=0x1000\0" #endif -#if defined(CONFIG_SPL_SPI_FLASH_SUPPORT) -# define CFG_SYS_SPI_KERNEL_OFFS 0x80000 -# define CFG_SYS_SPI_ARGS_OFFS 0xa0000 -# define CFG_SYS_SPI_ARGS_SIZE 0xa0000 -#endif - #ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE # error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used" #endif diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 37c77aa1611..93ae5891a07 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -191,14 +191,6 @@ /* Not using MMC raw mode - just for compilation purpose */ -/* qspi mode is working fine */ -#ifdef CONFIG_ZYNQ_QSPI -#define CFG_SYS_SPI_ARGS_OFFS 0x200000 -#define CFG_SYS_SPI_ARGS_SIZE 0x80000 -#define CFG_SYS_SPI_KERNEL_OFFS (CFG_SYS_SPI_ARGS_OFFS + \ - CFG_SYS_SPI_ARGS_SIZE) -#endif - /* SP location before relocation, must use scratch RAM */ /* 3 * 64kB blocks of OCM - one is on the top because of bootrom */ -- 2.43.0