[U-Boot] [PATCH v2 0/5] arm: socfpga: stack and Kconfig cleanups

This series cleans up stack definitions in socfpga_common.h as well as cleans up defconfig files by implying/defaulting common things in Kconfig files.
Finally, it reduces the malloc pool size used in first stage of gen5 SPL (without ddr available) in order to have more space available for code.
As this series does not contain direct bugfixes, it targets the socfpga-next branch.
Changes in v2: - fix commit message: "SPL post-reloc", not "SPL pre-reloc" - added patch to imply/default common config options - added patch to reduce gen5 SPL initial malloc pool to 2 KiB
Simon Goldschmidt (5): arm: socfpga: fix comment about SPL memory layout arm: socfpga: a10: move SPL stack size to Kconfig arm: socfpga: put initial U-Boot stack into DDR arm: socfpga: imply/default common config options arm: socfpga: gen5: reduce SPL pre-reloc malloc
arch/arm/Kconfig | 3 ++ arch/arm/mach-socfpga/Kconfig | 22 ++++++++++++++ configs/socfpga_arria10_defconfig | 7 ----- configs/socfpga_arria5_defconfig | 10 ------- configs/socfpga_cyclone5_defconfig | 10 ------- configs/socfpga_dbm_soc1_defconfig | 10 ------- configs/socfpga_de0_nano_soc_defconfig | 10 ------- configs/socfpga_de10_nano_defconfig | 10 ------- configs/socfpga_de1_soc_defconfig | 10 ------- configs/socfpga_is1_defconfig | 8 ------ configs/socfpga_sockit_defconfig | 10 ------- configs/socfpga_socrates_defconfig | 10 ------- configs/socfpga_sr1500_defconfig | 10 ------- configs/socfpga_stratix10_defconfig | 4 --- configs/socfpga_vining_fpga_defconfig | 10 ------- include/configs/socfpga_common.h | 40 +++++++++++--------------- 16 files changed, 41 insertions(+), 143 deletions(-)

The comment about SPL memory layout for socfpga gen5 is outdated: the initial malloc memory is now at the end of the SRAM, gd is below it (see board_init_f_alloc_reserve).
Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com ---
Changes in v2: None
include/configs/socfpga_common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index c9cbf8f5e3..a3fbca0a5d 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -237,9 +237,9 @@ unsigned int cm_get_qspi_controller_clk_hz(void); * * 0xFFFF_0000 ...... Start of SRAM * 0xFFFF_xxxx ...... Top of stack (grows down) - * 0xFFFF_yyyy ...... Malloc area - * 0xFFFF_zzzz ...... Global Data - * 0xFFFF_FF00 ...... End of SRAM + * 0xFFFF_yyyy ...... Global Data + * 0xFFFF_zzzz ...... Malloc area + * 0xFFFF_FFFF ...... End of SRAM * * SRAM Memory layout for Arria 10: * 0xFFE0_0000 ...... Start of SRAM (bottom)

Instead of fixing the SPL stack to 64 KiB in the board config header via CONFIG_SYS_SPL_MALLOC_SIZE, let's just use CONFIG_SPL_SYS_MALLOC_F_LEN in the defconfig.
This also has the advandage that it removes sub-mach specific ifdefs in socfpga_common.h.
Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com ---
Changes in v2: None
configs/socfpga_arria10_defconfig | 1 + include/configs/socfpga_common.h | 14 -------------- 2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/configs/socfpga_arria10_defconfig b/configs/socfpga_arria10_defconfig index f321a0ac3b..8d0479cc05 100644 --- a/configs/socfpga_arria10_defconfig +++ b/configs/socfpga_arria10_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y CONFIG_SYS_TEXT_BASE=0x01000040 CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SPL_SYS_MALLOC_F_LEN=0x10000 CONFIG_TARGET_SOCFPGA_ARRIA10_SOCDK=y CONFIG_SPL=y CONFIG_IDENT_STRING="socfpga_arria10" diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index a3fbca0a5d..c23b34186a 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -251,16 +251,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #define CONFIG_SPL_TEXT_BASE CONFIG_SYS_INIT_RAM_ADDR #define CONFIG_SPL_MAX_SIZE CONFIG_SYS_INIT_RAM_SIZE
-#if defined(CONFIG_TARGET_SOCFPGA_ARRIA10) -/* SPL memory allocation configuration, this is for FAT implementation */ -#ifndef CONFIG_SYS_SPL_MALLOC_START -#define CONFIG_SYS_SPL_MALLOC_SIZE 0x00010000 -#define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_INIT_RAM_SIZE - \ - CONFIG_SYS_SPL_MALLOC_SIZE + \ - CONFIG_SYS_INIT_RAM_ADDR) -#endif -#endif - /* SPL SDMMC boot support */ #ifdef CONFIG_SPL_MMC_SUPPORT #if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4) @@ -287,11 +277,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void); /* * Stack setup */ -#if defined(CONFIG_TARGET_SOCFPGA_GEN5) #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10) -#define CONFIG_SPL_STACK CONFIG_SYS_SPL_MALLOC_START -#endif
/* Extra Environment */ #ifndef CONFIG_SPL_BUILD

On Mon, Mar 4, 2019 at 9:53 PM Simon Goldschmidt simon.k.r.goldschmidt@gmail.com wrote:
Instead of fixing the SPL stack to 64 KiB in the board config header via CONFIG_SYS_SPL_MALLOC_SIZE, let's just use CONFIG_SPL_SYS_MALLOC_F_LEN in the defconfig.
This also has the advandage that it removes sub-mach specific ifdefs in socfpga_common.h.
Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com
Tien Fong teste this on A10 and it does not work as CONFIG_SPL_SYS_MALLOC_F_LEN only uses simple malloc while the A10 SPL requires full malloc (like CONFIG_SYS_SPL_MALLOC_SIZE provides).
I'll need to work on v3...
Regards, Simon
Changes in v2: None
configs/socfpga_arria10_defconfig | 1 + include/configs/socfpga_common.h | 14 -------------- 2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/configs/socfpga_arria10_defconfig b/configs/socfpga_arria10_defconfig index f321a0ac3b..8d0479cc05 100644 --- a/configs/socfpga_arria10_defconfig +++ b/configs/socfpga_arria10_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y CONFIG_SYS_TEXT_BASE=0x01000040 CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SPL_SYS_MALLOC_F_LEN=0x10000 CONFIG_TARGET_SOCFPGA_ARRIA10_SOCDK=y CONFIG_SPL=y CONFIG_IDENT_STRING="socfpga_arria10" diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index a3fbca0a5d..c23b34186a 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -251,16 +251,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #define CONFIG_SPL_TEXT_BASE CONFIG_SYS_INIT_RAM_ADDR #define CONFIG_SPL_MAX_SIZE CONFIG_SYS_INIT_RAM_SIZE
-#if defined(CONFIG_TARGET_SOCFPGA_ARRIA10) -/* SPL memory allocation configuration, this is for FAT implementation */ -#ifndef CONFIG_SYS_SPL_MALLOC_START -#define CONFIG_SYS_SPL_MALLOC_SIZE 0x00010000 -#define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_INIT_RAM_SIZE - \
CONFIG_SYS_SPL_MALLOC_SIZE + \
CONFIG_SYS_INIT_RAM_ADDR)
-#endif -#endif
/* SPL SDMMC boot support */ #ifdef CONFIG_SPL_MMC_SUPPORT #if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4) @@ -287,11 +277,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void); /*
- Stack setup
*/ -#if defined(CONFIG_TARGET_SOCFPGA_GEN5) #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10) -#define CONFIG_SPL_STACK CONFIG_SYS_SPL_MALLOC_START -#endif
/* Extra Environment */
#ifndef CONFIG_SPL_BUILD
2.17.1

If SPL post-reloc stage puts the stack into DDR, U-Boot should be able to do that, too.
The reason to do so is that this way, U-Boot initial stack can be larger than SPL initial stack. In situations where we want to save the SPL in SRAM for next boot without reloading, this prevents overwriting the SPL DTB in SRAM if U-Boot stack usage gets too high.
Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com ---
Changes in v2: - fix commit message: "SPL post-reloc", not "SPL pre-reloc"
include/configs/socfpga_common.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index c23b34186a..7ae3db233f 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -38,12 +38,23 @@ #if ((CONFIG_SYS_BOOTCOUNT_ADDR > CONFIG_SYS_INIT_RAM_ADDR) && \ (CONFIG_SYS_BOOTCOUNT_ADDR < (CONFIG_SYS_INIT_RAM_ADDR + \ CONFIG_SYS_INIT_RAM_SIZE))) -#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_BOOTCOUNT_ADDR +#define CONFIG_SPL_STACK CONFIG_SYS_BOOTCOUNT_ADDR #else -#define CONFIG_SYS_INIT_SP_ADDR \ +#define CONFIG_SPL_STACK \ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE) #endif
+/* + * U-Boot stack setup: if SPL post-reloc uses DDR stack, use it in pre-reloc + * phase of U-Boot, too. This prevents overwriting SPL data if stack/heap usage + * in U-Boot pre-reloc is higher than in SPL. + */ +#if defined(CONFIG_SPL_STACK_R_ADDR) && CONFIG_SPL_STACK_R_ADDR +#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_STACK_R_ADDR +#else +#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_STACK +#endif + #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
/* @@ -274,11 +285,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x40000 #endif
-/* - * Stack setup - */ -#define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR - /* Extra Environment */ #ifndef CONFIG_SPL_BUILD

This commit moves common config options used in all socfpga boards to select/imply in Kconfig. This both cleans up the defconfig files as well as makes future changes easier.
Options implied/defaulted for all sub-arches: - SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS
Options implied/defaulted for implied for A10 & gen5: - FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE
Options implied/defaulted for A10: - SPL_SYS_MALLOC_F_LEN
Options implied/defaulted for gen5: - SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR
Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com ---
Changes in v2: - added patch to imply/default common config options
arch/arm/Kconfig | 3 +++ arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++++++++ configs/socfpga_arria10_defconfig | 8 -------- configs/socfpga_arria5_defconfig | 10 ---------- configs/socfpga_cyclone5_defconfig | 10 ---------- configs/socfpga_dbm_soc1_defconfig | 10 ---------- configs/socfpga_de0_nano_soc_defconfig | 10 ---------- configs/socfpga_de10_nano_defconfig | 10 ---------- configs/socfpga_de1_soc_defconfig | 10 ---------- configs/socfpga_is1_defconfig | 8 -------- configs/socfpga_sockit_defconfig | 10 ---------- configs/socfpga_socrates_defconfig | 10 ---------- configs/socfpga_sr1500_defconfig | 10 ---------- configs/socfpga_stratix10_defconfig | 4 ---- configs/socfpga_vining_fpga_defconfig | 10 ---------- 15 files changed, 24 insertions(+), 120 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ded7c11a4c..71bb14acce 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -839,12 +839,15 @@ config ARCH_SOCFPGA imply DM_SPI imply DM_SPI_FLASH imply FAT_WRITE + imply SPL + imply SPL_DM imply SPL_LIBDISK_SUPPORT imply SPL_MMC_SUPPORT imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE imply SPL_SPI_FLASH_SUPPORT imply SPL_SPI_SUPPORT + imply USE_TINY_PRINTF
config ARCH_SUNXI bool "Support sunxi (Allwinner) SoCs" diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig index 5e87371f8c..da801eb660 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig @@ -1,8 +1,25 @@ if ARCH_SOCFPGA
+config NR_DRAM_BANKS + default 1 + +config SPL_STACK_R_ADDR + default 0x00800000 if TARGET_SOCFPGA_GEN5 + +config SPL_SYS_MALLOC_F_LEN + default 0x10000 if TARGET_SOCFPGA_ARRIA10 + config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE default 0xa2
+config SYS_MALLOC_F_LEN + default 0x2000 if TARGET_SOCFPGA_ARRIA10 + default 0x2000 if TARGET_SOCFPGA_GEN5 + +config SYS_TEXT_BASE + default 0x01000040 if TARGET_SOCFPGA_ARRIA10 + default 0x01000040 if TARGET_SOCFPGA_GEN5 + config TARGET_SOCFPGA_ARRIA5 bool select TARGET_SOCFPGA_GEN5 @@ -21,6 +38,7 @@ config TARGET_SOCFPGA_ARRIA10 select SYSCON select SPL_SYSCON if SPL select ETH_DESIGNWARE_SOCFPGA + imply FPGA_SOCFPGA
config TARGET_SOCFPGA_CYCLONE5 bool @@ -29,6 +47,9 @@ config TARGET_SOCFPGA_CYCLONE5 config TARGET_SOCFPGA_GEN5 bool select ALTERA_SDRAM + imply FPGA_SOCFPGA + imply SPL_STACK_R + imply SPL_SYS_MALLOC_SIMPLE
config TARGET_SOCFPGA_STRATIX10 bool diff --git a/configs/socfpga_arria10_defconfig b/configs/socfpga_arria10_defconfig index 8d0479cc05..38db5f6059 100644 --- a/configs/socfpga_arria10_defconfig +++ b/configs/socfpga_arria10_defconfig @@ -1,13 +1,8 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 -CONFIG_SPL_SYS_MALLOC_F_LEN=0x10000 CONFIG_TARGET_SOCFPGA_ARRIA10_SOCDK=y -CONFIG_SPL=y CONFIG_IDENT_STRING="socfpga_arria10" CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200" # CONFIG_USE_BOOTCOMMAND is not set @@ -29,9 +24,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0" # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria10_socdk_sdmmc" CONFIG_ENV_IS_IN_MMC=y -CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_MMC=y @@ -43,4 +36,3 @@ CONFIG_SPI=y CONFIG_TIMER=y CONFIG_SPL_TIMER=y CONFIG_DESIGNWARE_APB_TIMER=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig index 2f04092649..d514b14364 100644 --- a/configs/socfpga_arria5_defconfig +++ b/configs/socfpga_arria5_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_ARRIA5_SOCDK=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y @@ -16,8 +11,6 @@ CONFIG_DEFAULT_FDT_FILE="socfpga_arria5_socdk.dtb" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -39,10 +32,8 @@ CONFIG_CMD_UBI=y # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria5_socdk" CONFIG_ENV_IS_IN_MMC=y -CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_DFU_MMC=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y @@ -72,4 +63,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_GADGET_DOWNLOAD=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 2625aadf40..2d1a20154a 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_CYCLONE5_SOCDK=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y @@ -16,8 +11,6 @@ CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_socdk.dtb" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -39,10 +32,8 @@ CONFIG_CMD_UBI=y # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socdk" CONFIG_ENV_IS_IN_MMC=y -CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_DFU_MMC=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y @@ -73,4 +64,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_GADGET_DOWNLOAD=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_dbm_soc1_defconfig b/configs/socfpga_dbm_soc1_defconfig index b6f4f8a3dd..233d1334b3 100644 --- a/configs/socfpga_dbm_soc1_defconfig +++ b/configs/socfpga_dbm_soc1_defconfig @@ -1,11 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_DEVBOARDS_DBM_SOC1=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200" @@ -15,8 +10,6 @@ CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y @@ -41,9 +34,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_dbm_soc1" CONFIG_ENV_IS_IN_MMC=y -CONFIG_SPL_DM=y CONFIG_DFU_MMC=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y @@ -67,4 +58,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_GADGET_DOWNLOAD=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_de0_nano_soc_defconfig b/configs/socfpga_de0_nano_soc_defconfig index 9a89bb5d68..dfd2d0f504 100644 --- a/configs/socfpga_de0_nano_soc_defconfig +++ b/configs/socfpga_de0_nano_soc_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_TERASIC_DE0_NANO=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y @@ -17,8 +12,6 @@ CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -40,9 +33,7 @@ CONFIG_CMD_UBI=y # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_de0_nano_soc" CONFIG_ENV_IS_IN_MMC=y -CONFIG_SPL_DM=y CONFIG_DFU_MMC=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y @@ -68,4 +59,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_GADGET_DOWNLOAD=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_de10_nano_defconfig b/configs/socfpga_de10_nano_defconfig index db516891ba..d02a8d7d87 100644 --- a/configs/socfpga_de10_nano_defconfig +++ b/configs/socfpga_de10_nano_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_TERASIC_DE10_NANO=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y @@ -16,8 +11,6 @@ CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_de10_nano.dtb" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -36,9 +29,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0" # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_de10_nano" CONFIG_ENV_IS_IN_MMC=y -CONFIG_SPL_DM=y CONFIG_DFU_MMC=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y @@ -64,4 +55,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_GADGET_DOWNLOAD=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_de1_soc_defconfig b/configs/socfpga_de1_soc_defconfig index 5bed755723..c860bb45ad 100644 --- a/configs/socfpga_de1_soc_defconfig +++ b/configs/socfpga_de1_soc_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_TERASIC_DE1_SOC=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y @@ -17,8 +12,6 @@ CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -36,8 +29,6 @@ CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0" # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_de1_soc" CONFIG_ENV_IS_IN_MMC=y -CONFIG_SPL_DM=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y @@ -55,5 +46,4 @@ CONFIG_SPI=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_DWC2=y -CONFIG_USE_TINY_PRINTF=y # CONFIG_EFI_LOADER is not set diff --git a/configs/socfpga_is1_defconfig b/configs/socfpga_is1_defconfig index cd7211d202..7c81a83fc6 100644 --- a/configs/socfpga_is1_defconfig +++ b/configs/socfpga_is1_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_IS1=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200" @@ -17,7 +12,6 @@ CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -36,11 +30,9 @@ CONFIG_CMD_UBI=y # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_is1" CONFIG_ENV_IS_IN_SPI_FLASH=y -CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_SYS_BOOTCOUNT_ADDR=0xfffffff8 -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y diff --git a/configs/socfpga_sockit_defconfig b/configs/socfpga_sockit_defconfig index 4c17d1a9e4..805bbe1a1a 100644 --- a/configs/socfpga_sockit_defconfig +++ b/configs/socfpga_sockit_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_TERASIC_SOCKIT=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y @@ -16,8 +11,6 @@ CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_sockit.dtb" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -39,10 +32,8 @@ CONFIG_CMD_UBI=y # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_sockit" CONFIG_ENV_IS_IN_MMC=y -CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_DFU_MMC=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y @@ -73,4 +64,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_GADGET_DOWNLOAD=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_socrates_defconfig b/configs/socfpga_socrates_defconfig index 45fd78a15c..0ded246e78 100644 --- a/configs/socfpga_socrates_defconfig +++ b/configs/socfpga_socrates_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_EBV_SOCRATES=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y @@ -16,8 +11,6 @@ CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_socrates.dtb" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -40,10 +33,8 @@ CONFIG_CMD_UBI=y # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates" CONFIG_ENV_IS_IN_MMC=y -CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_DFU_MMC=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y @@ -73,4 +64,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_GADGET_DOWNLOAD=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_sr1500_defconfig b/configs/socfpga_sr1500_defconfig index d984047bfe..1a279c76e4 100644 --- a/configs/socfpga_sr1500_defconfig +++ b/configs/socfpga_sr1500_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_SR1500=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y @@ -18,8 +13,6 @@ CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_BOARD_EARLY_INIT_F=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -40,11 +33,9 @@ CONFIG_CMD_UBI=y # CONFIG_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_sr1500" CONFIG_ENV_IS_IN_SPI_FLASH=y -CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_SYS_BOOTCOUNT_ADDR=0xfffffff8 -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_DM_I2C=y @@ -63,4 +54,3 @@ CONFIG_MII=y CONFIG_DM_RESET=y CONFIG_SPI=y CONFIG_CADENCE_QSPI=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_stratix10_defconfig b/configs/socfpga_stratix10_defconfig index 9e6d582ee3..ca945fd990 100644 --- a/configs/socfpga_stratix10_defconfig +++ b/configs/socfpga_stratix10_defconfig @@ -3,10 +3,8 @@ CONFIG_ARCH_SOCFPGA=y CONFIG_SYS_TEXT_BASE=0x1000 CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_STRATIX10_SOCDK=y -CONFIG_SPL=y CONFIG_IDENT_STRING="socfpga_stratix10" CONFIG_SPL_FS_FAT=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_BOOTDELAY=5 CONFIG_SPL_SPI_LOAD=y CONFIG_HUSH_PARSER=y @@ -30,7 +28,6 @@ CONFIG_OF_EMBED=y CONFIG_DEFAULT_DEVICE_TREE="socfpga_stratix10_socdk" CONFIG_ENV_IS_IN_MMC=y CONFIG_NET_RANDOM_ETHADDR=y -CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y @@ -55,4 +52,3 @@ CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_DWC2=y CONFIG_USB_STORAGE=y -CONFIG_USE_TINY_PRINTF=y diff --git a/configs/socfpga_vining_fpga_defconfig b/configs/socfpga_vining_fpga_defconfig index 3eba09dcb1..7b47b111b7 100644 --- a/configs/socfpga_vining_fpga_defconfig +++ b/configs/socfpga_vining_fpga_defconfig @@ -1,12 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y -CONFIG_SYS_TEXT_BASE=0x01000040 -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_SOCFPGA_SAMTEC_VINING_FPGA=y -CONFIG_SPL=y -CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y CONFIG_BOOTDELAY=5 CONFIG_USE_BOOTARGS=y @@ -19,8 +14,6 @@ CONFIG_MISC_INIT_R=y CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y -CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y @@ -45,12 +38,10 @@ CONFIG_CMD_UBI=y CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_vining_fpga" CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_NET_RANDOM_ETHADDR=y -CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y -CONFIG_FPGA_SOCFPGA=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y CONFIG_LED_STATUS=y @@ -90,4 +81,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_GADGET_DOWNLOAD=y -CONFIG_USE_TINY_PRINTF=y

On 3/4/19 9:53 PM, Simon Goldschmidt wrote:
This commit moves common config options used in all socfpga boards to select/imply in Kconfig. This both cleans up the defconfig files as well as makes future changes easier.
Options implied/defaulted for all sub-arches:
- SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS
Options implied/defaulted for implied for A10 & gen5:
- FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE
Options implied/defaulted for A10:
- SPL_SYS_MALLOC_F_LEN
Options implied/defaulted for gen5:
- SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR
Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com
Changes in v2:
- added patch to imply/default common config options
arch/arm/Kconfig | 3 +++ arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++++++++ configs/socfpga_arria10_defconfig | 8 -------- configs/socfpga_arria5_defconfig | 10 ---------- configs/socfpga_cyclone5_defconfig | 10 ---------- configs/socfpga_dbm_soc1_defconfig | 10 ---------- configs/socfpga_de0_nano_soc_defconfig | 10 ---------- configs/socfpga_de10_nano_defconfig | 10 ---------- configs/socfpga_de1_soc_defconfig | 10 ---------- configs/socfpga_is1_defconfig | 8 -------- configs/socfpga_sockit_defconfig | 10 ---------- configs/socfpga_socrates_defconfig | 10 ---------- configs/socfpga_sr1500_defconfig | 10 ---------- configs/socfpga_stratix10_defconfig | 4 ---- configs/socfpga_vining_fpga_defconfig | 10 ---------- 15 files changed, 24 insertions(+), 120 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ded7c11a4c..71bb14acce 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -839,12 +839,15 @@ config ARCH_SOCFPGA imply DM_SPI imply DM_SPI_FLASH imply FAT_WRITE
- imply SPL
- imply SPL_DM imply SPL_LIBDISK_SUPPORT imply SPL_MMC_SUPPORT imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE imply SPL_SPI_FLASH_SUPPORT imply SPL_SPI_SUPPORT
- imply USE_TINY_PRINTF
config ARCH_SUNXI bool "Support sunxi (Allwinner) SoCs" diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig index 5e87371f8c..da801eb660 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig @@ -1,8 +1,25 @@ if ARCH_SOCFPGA
+config NR_DRAM_BANKS
- default 1
+config SPL_STACK_R_ADDR
- default 0x00800000 if TARGET_SOCFPGA_GEN5
+config SPL_SYS_MALLOC_F_LEN
- default 0x10000 if TARGET_SOCFPGA_ARRIA10
This is already defined in /Kconfig, won't you end up with duplicate/redefined symbols this way ?
CCing Yamada-san, since he's the Kconfig guru.

Marek Vasut marex@denx.de schrieb am Mo., 4. März 2019, 22:19:
On 3/4/19 9:53 PM, Simon Goldschmidt wrote:
This commit moves common config options used in all socfpga boards to select/imply in Kconfig. This both cleans up the defconfig files as well as makes future changes easier.
Options implied/defaulted for all sub-arches:
- SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS
Options implied/defaulted for implied for A10 & gen5:
- FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE
Options implied/defaulted for A10:
- SPL_SYS_MALLOC_F_LEN
Options implied/defaulted for gen5:
- SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR
Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com
Changes in v2:
- added patch to imply/default common config options
arch/arm/Kconfig | 3 +++ arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++++++++ configs/socfpga_arria10_defconfig | 8 -------- configs/socfpga_arria5_defconfig | 10 ---------- configs/socfpga_cyclone5_defconfig | 10 ---------- configs/socfpga_dbm_soc1_defconfig | 10 ---------- configs/socfpga_de0_nano_soc_defconfig | 10 ---------- configs/socfpga_de10_nano_defconfig | 10 ---------- configs/socfpga_de1_soc_defconfig | 10 ---------- configs/socfpga_is1_defconfig | 8 -------- configs/socfpga_sockit_defconfig | 10 ---------- configs/socfpga_socrates_defconfig | 10 ---------- configs/socfpga_sr1500_defconfig | 10 ---------- configs/socfpga_stratix10_defconfig | 4 ---- configs/socfpga_vining_fpga_defconfig | 10 ---------- 15 files changed, 24 insertions(+), 120 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ded7c11a4c..71bb14acce 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -839,12 +839,15 @@ config ARCH_SOCFPGA imply DM_SPI imply DM_SPI_FLASH imply FAT_WRITE
imply SPL
imply SPL_DM imply SPL_LIBDISK_SUPPORT imply SPL_MMC_SUPPORT imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE imply SPL_SPI_FLASH_SUPPORT imply SPL_SPI_SUPPORT
imply USE_TINY_PRINTF
config ARCH_SUNXI bool "Support sunxi (Allwinner) SoCs" diff --git a/arch/arm/mach-socfpga/Kconfig
b/arch/arm/mach-socfpga/Kconfig
index 5e87371f8c..da801eb660 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig @@ -1,8 +1,25 @@ if ARCH_SOCFPGA
+config NR_DRAM_BANKS
default 1
+config SPL_STACK_R_ADDR
default 0x00800000 if TARGET_SOCFPGA_GEN5
+config SPL_SYS_MALLOC_F_LEN
default 0x10000 if TARGET_SOCFPGA_ARRIA10
This is already defined in /Kconfig, won't you end up with duplicate/redefined symbols this way ?
I did not get errors. I copied the handling from SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE in the same file. Plus it seems like it's done like this in other Kconfig files, too.
CCing Yamada-san, since he's the Kconfig guru.
Right, getting more insight here would be nice.
Regards, Simon

On 3/4/19 10:23 PM, Simon Goldschmidt wrote:
Marek Vasut <marex@denx.de mailto:marex@denx.de> schrieb am Mo., 4. März 2019, 22:19:
On 3/4/19 9:53 PM, Simon Goldschmidt wrote: > This commit moves common config options used in all socfpga boards > to select/imply in Kconfig. This both cleans up the defconfig files > as well as makes future changes easier. > > Options implied/defaulted for all sub-arches: > - SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS > > Options implied/defaulted for implied for A10 & gen5: > - FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE > > Options implied/defaulted for A10: > - SPL_SYS_MALLOC_F_LEN > > Options implied/defaulted for gen5: > - SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com <mailto:simon.k.r.goldschmidt@gmail.com>> > --- > > Changes in v2: > - added patch to imply/default common config options > > arch/arm/Kconfig | 3 +++ > arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++++++++ > configs/socfpga_arria10_defconfig | 8 -------- > configs/socfpga_arria5_defconfig | 10 ---------- > configs/socfpga_cyclone5_defconfig | 10 ---------- > configs/socfpga_dbm_soc1_defconfig | 10 ---------- > configs/socfpga_de0_nano_soc_defconfig | 10 ---------- > configs/socfpga_de10_nano_defconfig | 10 ---------- > configs/socfpga_de1_soc_defconfig | 10 ---------- > configs/socfpga_is1_defconfig | 8 -------- > configs/socfpga_sockit_defconfig | 10 ---------- > configs/socfpga_socrates_defconfig | 10 ---------- > configs/socfpga_sr1500_defconfig | 10 ---------- > configs/socfpga_stratix10_defconfig | 4 ---- > configs/socfpga_vining_fpga_defconfig | 10 ---------- > 15 files changed, 24 insertions(+), 120 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index ded7c11a4c..71bb14acce 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -839,12 +839,15 @@ config ARCH_SOCFPGA > imply DM_SPI > imply DM_SPI_FLASH > imply FAT_WRITE > + imply SPL > + imply SPL_DM > imply SPL_LIBDISK_SUPPORT > imply SPL_MMC_SUPPORT > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE > imply SPL_SPI_FLASH_SUPPORT > imply SPL_SPI_SUPPORT > + imply USE_TINY_PRINTF > > config ARCH_SUNXI > bool "Support sunxi (Allwinner) SoCs" > diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig > index 5e87371f8c..da801eb660 100644 > --- a/arch/arm/mach-socfpga/Kconfig > +++ b/arch/arm/mach-socfpga/Kconfig > @@ -1,8 +1,25 @@ > if ARCH_SOCFPGA > > +config NR_DRAM_BANKS > + default 1 > + > +config SPL_STACK_R_ADDR > + default 0x00800000 if TARGET_SOCFPGA_GEN5 > + > +config SPL_SYS_MALLOC_F_LEN > + default 0x10000 if TARGET_SOCFPGA_ARRIA10 > + This is already defined in /Kconfig, won't you end up with duplicate/redefined symbols this way ?
I did not get errors. I copied the handling from SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE in the same file. Plus it seems like it's done like this in other Kconfig files, too.
I know it is done. I am not convinced it's right.
CCing Yamada-san, since he's the Kconfig guru.
Right, getting more insight here would be nice.
Yes please.

Am 04.03.2019 um 22:34 schrieb Marek Vasut:
On 3/4/19 10:23 PM, Simon Goldschmidt wrote:
Marek Vasut <marex@denx.de mailto:marex@denx.de> schrieb am Mo., 4. März 2019, 22:19:
On 3/4/19 9:53 PM, Simon Goldschmidt wrote: > This commit moves common config options used in all socfpga boards > to select/imply in Kconfig. This both cleans up the defconfig files > as well as makes future changes easier. > > Options implied/defaulted for all sub-arches: > - SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS > > Options implied/defaulted for implied for A10 & gen5: > - FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE > > Options implied/defaulted for A10: > - SPL_SYS_MALLOC_F_LEN > > Options implied/defaulted for gen5: > - SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com <mailto:simon.k.r.goldschmidt@gmail.com>> > --- > > Changes in v2: > - added patch to imply/default common config options > > arch/arm/Kconfig | 3 +++ > arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++++++++ > configs/socfpga_arria10_defconfig | 8 -------- > configs/socfpga_arria5_defconfig | 10 ---------- > configs/socfpga_cyclone5_defconfig | 10 ---------- > configs/socfpga_dbm_soc1_defconfig | 10 ---------- > configs/socfpga_de0_nano_soc_defconfig | 10 ---------- > configs/socfpga_de10_nano_defconfig | 10 ---------- > configs/socfpga_de1_soc_defconfig | 10 ---------- > configs/socfpga_is1_defconfig | 8 -------- > configs/socfpga_sockit_defconfig | 10 ---------- > configs/socfpga_socrates_defconfig | 10 ---------- > configs/socfpga_sr1500_defconfig | 10 ---------- > configs/socfpga_stratix10_defconfig | 4 ---- > configs/socfpga_vining_fpga_defconfig | 10 ---------- > 15 files changed, 24 insertions(+), 120 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index ded7c11a4c..71bb14acce 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -839,12 +839,15 @@ config ARCH_SOCFPGA > imply DM_SPI > imply DM_SPI_FLASH > imply FAT_WRITE > + imply SPL > + imply SPL_DM > imply SPL_LIBDISK_SUPPORT > imply SPL_MMC_SUPPORT > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE > imply SPL_SPI_FLASH_SUPPORT > imply SPL_SPI_SUPPORT > + imply USE_TINY_PRINTF > > config ARCH_SUNXI > bool "Support sunxi (Allwinner) SoCs" > diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig > index 5e87371f8c..da801eb660 100644 > --- a/arch/arm/mach-socfpga/Kconfig > +++ b/arch/arm/mach-socfpga/Kconfig > @@ -1,8 +1,25 @@ > if ARCH_SOCFPGA > > +config NR_DRAM_BANKS > + default 1 > + > +config SPL_STACK_R_ADDR > + default 0x00800000 if TARGET_SOCFPGA_GEN5 > + > +config SPL_SYS_MALLOC_F_LEN > + default 0x10000 if TARGET_SOCFPGA_ARRIA10 > + This is already defined in /Kconfig, won't you end up with duplicate/redefined symbols this way ?
I did not get errors. I copied the handling from SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE in the same file. Plus it seems like it's done like this in other Kconfig files, too.
I know it is done. I am not convinced it's right.
Would it be better acceptable if I moved the defaults to the Kconfig files where these settings are defined? I always thought it to be strange to clutter those with arch-specific settings, but I don't really have a strong preference...
Regards, Simon
CCing Yamada-san, since he's the Kconfig guru.
Right, getting more insight here would be nice.
Yes please.

On 3/5/19 9:28 PM, Simon Goldschmidt wrote:
Am 04.03.2019 um 22:34 schrieb Marek Vasut:
On 3/4/19 10:23 PM, Simon Goldschmidt wrote:
Marek Vasut <marex@denx.de mailto:marex@denx.de> schrieb am Mo., 4. März 2019, 22:19:
On 3/4/19 9:53 PM, Simon Goldschmidt wrote: > This commit moves common config options used in all socfpga boards > to select/imply in Kconfig. This both cleans up the defconfig files > as well as makes future changes easier. > > Options implied/defaulted for all sub-arches: > - SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS > > Options implied/defaulted for implied for A10 & gen5: > - FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE > > Options implied/defaulted for A10: > - SPL_SYS_MALLOC_F_LEN > > Options implied/defaulted for gen5: > - SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com mailto:simon.k.r.goldschmidt@gmail.com> > --- > > Changes in v2: > - added patch to imply/default common config options > > arch/arm/Kconfig | 3 +++ > arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++++++++ > configs/socfpga_arria10_defconfig | 8 -------- > configs/socfpga_arria5_defconfig | 10 ---------- > configs/socfpga_cyclone5_defconfig | 10 ---------- > configs/socfpga_dbm_soc1_defconfig | 10 ---------- > configs/socfpga_de0_nano_soc_defconfig | 10 ---------- > configs/socfpga_de10_nano_defconfig | 10 ---------- > configs/socfpga_de1_soc_defconfig | 10 ---------- > configs/socfpga_is1_defconfig | 8 -------- > configs/socfpga_sockit_defconfig | 10 ---------- > configs/socfpga_socrates_defconfig | 10 ---------- > configs/socfpga_sr1500_defconfig | 10 ---------- > configs/socfpga_stratix10_defconfig | 4 ---- > configs/socfpga_vining_fpga_defconfig | 10 ---------- > 15 files changed, 24 insertions(+), 120 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index ded7c11a4c..71bb14acce 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -839,12 +839,15 @@ config ARCH_SOCFPGA > imply DM_SPI > imply DM_SPI_FLASH > imply FAT_WRITE > + imply SPL > + imply SPL_DM > imply SPL_LIBDISK_SUPPORT > imply SPL_MMC_SUPPORT > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE > imply SPL_SPI_FLASH_SUPPORT > imply SPL_SPI_SUPPORT > + imply USE_TINY_PRINTF > > config ARCH_SUNXI > bool "Support sunxi (Allwinner) SoCs" > diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig > index 5e87371f8c..da801eb660 100644 > --- a/arch/arm/mach-socfpga/Kconfig > +++ b/arch/arm/mach-socfpga/Kconfig > @@ -1,8 +1,25 @@ > if ARCH_SOCFPGA > > +config NR_DRAM_BANKS > + default 1 > + > +config SPL_STACK_R_ADDR > + default 0x00800000 if TARGET_SOCFPGA_GEN5 > + > +config SPL_SYS_MALLOC_F_LEN > + default 0x10000 if TARGET_SOCFPGA_ARRIA10 > +
This is already defined in /Kconfig, won't you end up with duplicate/redefined symbols this way ?
I did not get errors. I copied the handling from SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE in the same file. Plus it seems like it's done like this in other Kconfig files, too.
I know it is done. I am not convinced it's right.
Would it be better acceptable if I moved the defaults to the Kconfig files where these settings are defined? I always thought it to be strange to clutter those with arch-specific settings, but I don't really have a strong preference...
I agree with you on this. I'd really like some reply from Yamada-san.

Am 05.03.2019 um 21:58 schrieb Marek Vasut:
On 3/5/19 9:28 PM, Simon Goldschmidt wrote:
Am 04.03.2019 um 22:34 schrieb Marek Vasut:
On 3/4/19 10:23 PM, Simon Goldschmidt wrote:
Marek Vasut <marex@denx.de mailto:marex@denx.de> schrieb am Mo., 4. März 2019, 22:19:
On 3/4/19 9:53 PM, Simon Goldschmidt wrote: > This commit moves common config options used in all socfpga boards > to select/imply in Kconfig. This both cleans up the defconfig files > as well as makes future changes easier. > > Options implied/defaulted for all sub-arches: > - SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS > > Options implied/defaulted for implied for A10 & gen5: > - FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE > > Options implied/defaulted for A10: > - SPL_SYS_MALLOC_F_LEN > > Options implied/defaulted for gen5: > - SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com mailto:simon.k.r.goldschmidt@gmail.com> > --- > > Changes in v2: > - added patch to imply/default common config options > > arch/arm/Kconfig | 3 +++ > arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++++++++ > configs/socfpga_arria10_defconfig | 8 -------- > configs/socfpga_arria5_defconfig | 10 ---------- > configs/socfpga_cyclone5_defconfig | 10 ---------- > configs/socfpga_dbm_soc1_defconfig | 10 ---------- > configs/socfpga_de0_nano_soc_defconfig | 10 ---------- > configs/socfpga_de10_nano_defconfig | 10 ---------- > configs/socfpga_de1_soc_defconfig | 10 ---------- > configs/socfpga_is1_defconfig | 8 -------- > configs/socfpga_sockit_defconfig | 10 ---------- > configs/socfpga_socrates_defconfig | 10 ---------- > configs/socfpga_sr1500_defconfig | 10 ---------- > configs/socfpga_stratix10_defconfig | 4 ---- > configs/socfpga_vining_fpga_defconfig | 10 ---------- > 15 files changed, 24 insertions(+), 120 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index ded7c11a4c..71bb14acce 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -839,12 +839,15 @@ config ARCH_SOCFPGA > imply DM_SPI > imply DM_SPI_FLASH > imply FAT_WRITE > + imply SPL > + imply SPL_DM > imply SPL_LIBDISK_SUPPORT > imply SPL_MMC_SUPPORT > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE > imply SPL_SPI_FLASH_SUPPORT > imply SPL_SPI_SUPPORT > + imply USE_TINY_PRINTF > > config ARCH_SUNXI > bool "Support sunxi (Allwinner) SoCs" > diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig > index 5e87371f8c..da801eb660 100644 > --- a/arch/arm/mach-socfpga/Kconfig > +++ b/arch/arm/mach-socfpga/Kconfig > @@ -1,8 +1,25 @@ > if ARCH_SOCFPGA > > +config NR_DRAM_BANKS > + default 1 > + > +config SPL_STACK_R_ADDR > + default 0x00800000 if TARGET_SOCFPGA_GEN5 > + > +config SPL_SYS_MALLOC_F_LEN > + default 0x10000 if TARGET_SOCFPGA_ARRIA10 > +
This is already defined in /Kconfig, won't you end up with duplicate/redefined symbols this way ?
I did not get errors. I copied the handling from SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE in the same file. Plus it seems like it's done like this in other Kconfig files, too.
I know it is done. I am not convinced it's right.
Would it be better acceptable if I moved the defaults to the Kconfig files where these settings are defined? I always thought it to be strange to clutter those with arch-specific settings, but I don't really have a strong preference...
I agree with you on this. I'd really like some reply from Yamada-san.
So without a reply from Yamada-san for 10 days, how do we continue here?
In the next version (v3), Patch 2/5 should be fixed for a10. I'd also extend that next version with further cleanup patches from an earlier series [1] since I have I2C EEPROM finally running with DM (tested on the socfpga_socrates board by using the "Phy1" daughter board and a matching FPGA configuration).
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=85229
Regards, Simon

Hi Mrek,
Am 15.03.2019 um 21:34 schrieb Simon Goldschmidt:
Am 05.03.2019 um 21:58 schrieb Marek Vasut:
On 3/5/19 9:28 PM, Simon Goldschmidt wrote:
Am 04.03.2019 um 22:34 schrieb Marek Vasut:
On 3/4/19 10:23 PM, Simon Goldschmidt wrote:
Marek Vasut <marex@denx.de mailto:marex@denx.de> schrieb am Mo., 4. März 2019, 22:19:
On 3/4/19 9:53 PM, Simon Goldschmidt wrote: > This commit moves common config options used in all socfpga boards > to select/imply in Kconfig. This both cleans up the defconfig files > as well as makes future changes easier. > > Options implied/defaulted for all sub-arches: > - SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS > > Options implied/defaulted for implied for A10 & gen5: > - FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE > > Options implied/defaulted for A10: > - SPL_SYS_MALLOC_F_LEN > > Options implied/defaulted for gen5: > - SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com mailto:simon.k.r.goldschmidt@gmail.com> > --- > > Changes in v2: > - added patch to imply/default common config options > > arch/arm/Kconfig | 3 +++ > arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++++++++ > configs/socfpga_arria10_defconfig | 8 -------- > configs/socfpga_arria5_defconfig | 10 ---------- > configs/socfpga_cyclone5_defconfig | 10 ---------- > configs/socfpga_dbm_soc1_defconfig | 10 ---------- > configs/socfpga_de0_nano_soc_defconfig | 10 ---------- > configs/socfpga_de10_nano_defconfig | 10 ---------- > configs/socfpga_de1_soc_defconfig | 10 ---------- > configs/socfpga_is1_defconfig | 8 -------- > configs/socfpga_sockit_defconfig | 10 ---------- > configs/socfpga_socrates_defconfig | 10 ---------- > configs/socfpga_sr1500_defconfig | 10 ---------- > configs/socfpga_stratix10_defconfig | 4 ---- > configs/socfpga_vining_fpga_defconfig | 10 ---------- > 15 files changed, 24 insertions(+), 120 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index ded7c11a4c..71bb14acce 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -839,12 +839,15 @@ config ARCH_SOCFPGA > imply DM_SPI > imply DM_SPI_FLASH > imply FAT_WRITE > + imply SPL > + imply SPL_DM > imply SPL_LIBDISK_SUPPORT > imply SPL_MMC_SUPPORT > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE > imply SPL_SPI_FLASH_SUPPORT > imply SPL_SPI_SUPPORT > + imply USE_TINY_PRINTF > > config ARCH_SUNXI > bool "Support sunxi (Allwinner) SoCs" > diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig > index 5e87371f8c..da801eb660 100644 > --- a/arch/arm/mach-socfpga/Kconfig > +++ b/arch/arm/mach-socfpga/Kconfig > @@ -1,8 +1,25 @@ > if ARCH_SOCFPGA > > +config NR_DRAM_BANKS > + default 1 > + > +config SPL_STACK_R_ADDR > + default 0x00800000 if TARGET_SOCFPGA_GEN5 > + > +config SPL_SYS_MALLOC_F_LEN > + default 0x10000 if TARGET_SOCFPGA_ARRIA10 > +
This is already defined in /Kconfig, won't you end up with duplicate/redefined symbols this way ?
I did not get errors. I copied the handling from SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE in the same file. Plus it seems like it's done like this in other Kconfig files, too.
I know it is done. I am not convinced it's right.
Would it be better acceptable if I moved the defaults to the Kconfig files where these settings are defined? I always thought it to be strange to clutter those with arch-specific settings, but I don't really have a strong preference...
I agree with you on this. I'd really like some reply from Yamada-san.
So without a reply from Yamada-san for 10 days, how do we continue here?
Gentle ping?
In the next version (v3), Patch 2/5 should be fixed for a10.
In v3, I'd remove patch 2/5 since it is already covered by a different series that properly cleans up using full malloc only in SPL [2] and I'll make this series depend on v3 of that:
[2] https://patchwork.ozlabs.org/project/uboot/list/?series=97430
Regards, Simon
I'd also extend that next version with further cleanup patches from an earlier series [1] since I have I2C EEPROM finally running with DM (tested on the socfpga_socrates board by using the "Phy1" daughter board and a matching FPGA configuration).
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=85229
Regards, Simon

Hi Simon,
Sorry, I completely missed this thread.
On Wed, Mar 20, 2019 at 7:40 PM Simon Goldschmidt simon.k.r.goldschmidt@gmail.com wrote:
Hi Mrek,
Am 15.03.2019 um 21:34 schrieb Simon Goldschmidt:
Am 05.03.2019 um 21:58 schrieb Marek Vasut:
On 3/5/19 9:28 PM, Simon Goldschmidt wrote:
Am 04.03.2019 um 22:34 schrieb Marek Vasut:
On 3/4/19 10:23 PM, Simon Goldschmidt wrote:
Marek Vasut <marex@denx.de mailto:marex@denx.de> schrieb am Mo., 4. März 2019, 22:19:
On 3/4/19 9:53 PM, Simon Goldschmidt wrote: > This commit moves common config options used in all socfpga
boards > to select/imply in Kconfig. This both cleans up the defconfig files > as well as makes future changes easier. > > Options implied/defaulted for all sub-arches: > - SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS > > Options implied/defaulted for implied for A10 & gen5: > - FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE > > Options implied/defaulted for A10: > - SPL_SYS_MALLOC_F_LEN > > Options implied/defaulted for gen5: > - SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com mailto:simon.k.r.goldschmidt@gmail.com> > --- > > Changes in v2: > - added patch to imply/default common config options > > arch/arm/Kconfig | 3 +++ > arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++++++++ > configs/socfpga_arria10_defconfig | 8 -------- > configs/socfpga_arria5_defconfig | 10 ---------- > configs/socfpga_cyclone5_defconfig | 10 ---------- > configs/socfpga_dbm_soc1_defconfig | 10 ---------- > configs/socfpga_de0_nano_soc_defconfig | 10 ---------- > configs/socfpga_de10_nano_defconfig | 10 ---------- > configs/socfpga_de1_soc_defconfig | 10 ---------- > configs/socfpga_is1_defconfig | 8 -------- > configs/socfpga_sockit_defconfig | 10 ---------- > configs/socfpga_socrates_defconfig | 10 ---------- > configs/socfpga_sr1500_defconfig | 10 ---------- > configs/socfpga_stratix10_defconfig | 4 ---- > configs/socfpga_vining_fpga_defconfig | 10 ---------- > 15 files changed, 24 insertions(+), 120 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index ded7c11a4c..71bb14acce 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -839,12 +839,15 @@ config ARCH_SOCFPGA > imply DM_SPI > imply DM_SPI_FLASH > imply FAT_WRITE > + imply SPL > + imply SPL_DM > imply SPL_LIBDISK_SUPPORT > imply SPL_MMC_SUPPORT > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE > imply SPL_SPI_FLASH_SUPPORT > imply SPL_SPI_SUPPORT > + imply USE_TINY_PRINTF > > config ARCH_SUNXI > bool "Support sunxi (Allwinner) SoCs" > diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig > index 5e87371f8c..da801eb660 100644 > --- a/arch/arm/mach-socfpga/Kconfig > +++ b/arch/arm/mach-socfpga/Kconfig > @@ -1,8 +1,25 @@ > if ARCH_SOCFPGA > > +config NR_DRAM_BANKS > + default 1 > + > +config SPL_STACK_R_ADDR > + default 0x00800000 if TARGET_SOCFPGA_GEN5 > + > +config SPL_SYS_MALLOC_F_LEN > + default 0x10000 if TARGET_SOCFPGA_ARRIA10 > +
This is already defined in /Kconfig, won't you end up with duplicate/redefined symbols this way ?
I did not get errors. I copied the handling from SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE in the same file. Plus it seems like it's done like this in other Kconfig files, too.
This is correct in terms of Kconfig grammar. You can define the same symbol multiple times.
For example,
if ARCH_SOCFPGA
config FOO default 100
endif
config FOO int "foo" default 10
... is equivalent to
config FOO default 100 if ARCH_SOCFPGA int "foo" default 10
You can exploit this trick.
However, I see one problem when we sync defconfig files globally with tools/moveconfig.py
savedefconfig sorts CONFIG options in the order they are parsed.
Every time people add/remove entry to/from their arch/arm/mach-*/Kconfig or board/*/Kconfig, the location where the symbol first appears changes.
That's is why symbols go up and down for every resync. For example, see commit fca0128da4803
I know it is done. I am not convinced it's right.
Would it be better acceptable if I moved the defaults to the Kconfig files where these settings are defined? I always thought it to be strange to clutter those with arch-specific settings,
I agree. We are screwed up with:
config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR hex "Address on the MMC to load U-Boot from" depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR default 0x50 if ARCH_SUNXI default 0x75 if ARCH_DAVINCI default 0x8a if ARCH_MX6 || ARCH_MX7 default 0x100 if ARCH_UNIPHIER default 0x140 if ARCH_MVEBU default 0x200 if ARCH_SOCFPGA || ARCH_AT91 default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \ OMAP54XX || AM33XX || AM43XX || ARCH_K3 default 0x4000 if ARCH_ROCKCHIP
When I introduced Kconfig to U-Boot, I did not mean to move CONFIG options verbatim from include/config/<board>.h to Kconfig files.
I expected old clutter things would be replaced with something cool. But, it did not happen. We are just moving CONFIG options to Kconfig as they are.
In old days, people added CONFIG_ prefix to anything, most of which are not configuration at all.
For example, CONFIG_BOOTARGS in configs/axm_defconfig is an extremely crazy case.
Probably, you want to see a solution instead of my complaint.
Let's use barebox (Bummer!)
But, hold on.
Barebox had already solved problems U-Boot is suffering from.
If you are annoyed by duplicated defconfigs, Barebox supports multiple boards mechanism. So just a single 'socfpga_defconfig' generates multiple board images.
The image is still small by exploiting dead code elimination.
$ make ARCH=arm socfpga_defconfig $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
will produce
SHIPPED images/barebox-socfpga-de0_nano_soc.img SHIPPED images/barebox-socfpga-sockit.img SHIPPED images/barebox-socfpga-socrates.img images built: barebox-socfpga-de0_nano_soc.img barebox-socfpga-sockit.img barebox-socfpga-socrates.img
I do not think we should change U-Boot in the same way, though. Probably, it is too late for U-Boot, and people who like cleaner code base can switch to barebox.
Anyway. Let's go back to U-Boot topic.
For the duplicated defconfig issue, recently we discussed here:
http://patchwork.ozlabs.org/patch/1043986/
I do not know super-cool solution for U-Boot.
At the cost of increased memory footprint, some defconfig could be merged, if Marek likes it.
(U-Boot needs to link boot code for all boards into a single SPL. That's the difference from Barebox.)
Thanks. Masahiro Yamada
but I don't really
have a strong preference...
I agree with you on this. I'd really like some reply from Yamada-san.
So without a reply from Yamada-san for 10 days, how do we continue here?
Gentle ping?
In the next version (v3), Patch 2/5 should be fixed for a10.
In v3, I'd remove patch 2/5 since it is already covered by a different series that properly cleans up using full malloc only in SPL [2] and I'll make this series depend on v3 of that:
[2] https://patchwork.ozlabs.org/project/uboot/list/?series=97430
Regards, Simon
I'd also extend that next version with further cleanup patches from an earlier series [1] since I have I2C EEPROM finally running with DM (tested on the socfpga_socrates board by using the "Phy1" daughter board and a matching FPGA configuration).
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=85229
Regards, Simon
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Hi,
On Thu, Mar 21, 2019 at 5:29 AM Masahiro Yamada yamada.masahiro@socionext.com wrote:
Hi Simon,
Sorry, I completely missed this thread.
No problem, this is not a too pressing issue, yet, since it's for the next merge window :-)
On Wed, Mar 20, 2019 at 7:40 PM Simon Goldschmidt simon.k.r.goldschmidt@gmail.com wrote:
Hi Mrek,
Am 15.03.2019 um 21:34 schrieb Simon Goldschmidt:
Am 05.03.2019 um 21:58 schrieb Marek Vasut:
On 3/5/19 9:28 PM, Simon Goldschmidt wrote:
Am 04.03.2019 um 22:34 schrieb Marek Vasut:
On 3/4/19 10:23 PM, Simon Goldschmidt wrote: > > > Marek Vasut <marex@denx.de mailto:marex@denx.de> schrieb am Mo., 4. > März 2019, 22:19: > > On 3/4/19 9:53 PM, Simon Goldschmidt wrote: > > This commit moves common config options used in all socfpga > boards > > to select/imply in Kconfig. This both cleans up the defconfig > files > > as well as makes future changes easier. > > > > Options implied/defaulted for all sub-arches: > > - SPL, SPL_DM, USE_TINY_PRINTF, NR_DRAM_BANKS > > > > Options implied/defaulted for implied for A10 & gen5: > > - FPGA_SOCFPGA, SYS_MALLOC_F_LEN, SYS_TEXT_BASE > > > > Options implied/defaulted for A10: > > - SPL_SYS_MALLOC_F_LEN > > > > Options implied/defaulted for gen5: > > - SPL_STACK_R, SPL_SYS_MALLOC_SIMPLE, SPL_STACK_R_ADDR > > > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com > mailto:simon.k.r.goldschmidt@gmail.com> > > --- > > > > Changes in v2: > > - added patch to imply/default common config options > > > > arch/arm/Kconfig | 3 +++ > > arch/arm/mach-socfpga/Kconfig | 21 > +++++++++++++++++++++ > > configs/socfpga_arria10_defconfig | 8 -------- > > configs/socfpga_arria5_defconfig | 10 ---------- > > configs/socfpga_cyclone5_defconfig | 10 ---------- > > configs/socfpga_dbm_soc1_defconfig | 10 ---------- > > configs/socfpga_de0_nano_soc_defconfig | 10 ---------- > > configs/socfpga_de10_nano_defconfig | 10 ---------- > > configs/socfpga_de1_soc_defconfig | 10 ---------- > > configs/socfpga_is1_defconfig | 8 -------- > > configs/socfpga_sockit_defconfig | 10 ---------- > > configs/socfpga_socrates_defconfig | 10 ---------- > > configs/socfpga_sr1500_defconfig | 10 ---------- > > configs/socfpga_stratix10_defconfig | 4 ---- > > configs/socfpga_vining_fpga_defconfig | 10 ---------- > > 15 files changed, 24 insertions(+), 120 deletions(-) > > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > > index ded7c11a4c..71bb14acce 100644 > > --- a/arch/arm/Kconfig > > +++ b/arch/arm/Kconfig > > @@ -839,12 +839,15 @@ config ARCH_SOCFPGA > > imply DM_SPI > > imply DM_SPI_FLASH > > imply FAT_WRITE > > + imply SPL > > + imply SPL_DM > > imply SPL_LIBDISK_SUPPORT > > imply SPL_MMC_SUPPORT > > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION > > imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE > > imply SPL_SPI_FLASH_SUPPORT > > imply SPL_SPI_SUPPORT > > + imply USE_TINY_PRINTF > > > > config ARCH_SUNXI > > bool "Support sunxi (Allwinner) SoCs" > > diff --git a/arch/arm/mach-socfpga/Kconfig > b/arch/arm/mach-socfpga/Kconfig > > index 5e87371f8c..da801eb660 100644 > > --- a/arch/arm/mach-socfpga/Kconfig > > +++ b/arch/arm/mach-socfpga/Kconfig > > @@ -1,8 +1,25 @@ > > if ARCH_SOCFPGA > > > > +config NR_DRAM_BANKS > > + default 1 > > + > > +config SPL_STACK_R_ADDR > > + default 0x00800000 if TARGET_SOCFPGA_GEN5 > > + > > +config SPL_SYS_MALLOC_F_LEN > > + default 0x10000 if TARGET_SOCFPGA_ARRIA10 > > + > > This is already defined in /Kconfig, won't you end up with > duplicate/redefined symbols this way ? > > > I did not get errors. I copied the handling > from SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE in the same file. Plus it > seems like it's done like this in other Kconfig files, too.
This is correct in terms of Kconfig grammar. You can define the same symbol multiple times.
For example,
if ARCH_SOCFPGA
config FOO default 100
endif
config FOO int "foo" default 10
... is equivalent to
config FOO default 100 if ARCH_SOCFPGA int "foo" default 10
You can exploit this trick.
However, I see one problem when we sync defconfig files globally with tools/moveconfig.py
savedefconfig sorts CONFIG options in the order they are parsed.
Every time people add/remove entry to/from their arch/arm/mach-*/Kconfig or board/*/Kconfig, the location where the symbol first appears changes.
That's is why symbols go up and down for every resync. For example, see commit fca0128da4803
I know it is done. I am not convinced it's right.
Would it be better acceptable if I moved the defaults to the Kconfig files where these settings are defined? I always thought it to be strange to clutter those with arch-specific settings,
I agree. We are screwed up with:
config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR hex "Address on the MMC to load U-Boot from" depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR default 0x50 if ARCH_SUNXI default 0x75 if ARCH_DAVINCI default 0x8a if ARCH_MX6 || ARCH_MX7 default 0x100 if ARCH_UNIPHIER default 0x140 if ARCH_MVEBU default 0x200 if ARCH_SOCFPGA || ARCH_AT91 default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \ OMAP54XX || AM33XX || AM43XX || ARCH_K3 default 0x4000 if ARCH_ROCKCHIP
When I introduced Kconfig to U-Boot, I did not mean to move CONFIG options verbatim from include/config/<board>.h to Kconfig files.
I expected old clutter things would be replaced with something cool. But, it did not happen. We are just moving CONFIG options to Kconfig as they are.
In old days, people added CONFIG_ prefix to anything, most of which are not configuration at all.
For example, CONFIG_BOOTARGS in configs/axm_defconfig is an extremely crazy case.
Probably, you want to see a solution instead of my complaint.
Let's use barebox (Bummer!)
But, hold on.
Barebox had already solved problems U-Boot is suffering from.
If you are annoyed by duplicated defconfigs, Barebox supports multiple boards mechanism. So just a single 'socfpga_defconfig' generates multiple board images.
The image is still small by exploiting dead code elimination.
$ make ARCH=arm socfpga_defconfig $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
will produce
SHIPPED images/barebox-socfpga-de0_nano_soc.img SHIPPED images/barebox-socfpga-sockit.img SHIPPED images/barebox-socfpga-socrates.img images built: barebox-socfpga-de0_nano_soc.img barebox-socfpga-sockit.img barebox-socfpga-socrates.img
I do not think we should change U-Boot in the same way, though. Probably, it is too late for U-Boot, and people who like cleaner code base can switch to barebox.
Anyway. Let's go back to U-Boot topic.
For the duplicated defconfig issue, recently we discussed here:
http://patchwork.ozlabs.org/patch/1043986/
I do not know super-cool solution for U-Boot.
At the cost of increased memory footprint, some defconfig could be merged, if Marek likes it.
(U-Boot needs to link boot code for all boards into a single SPL. That's the difference from Barebox.)
Ok, thanks for this information! I do think things could be imrpoved. I monitored the thread you references at the start but somehow got lost in between... However, I do not have any input right now as to how to improve the things mentioned in that thread.
Marek, being like that, I'll continue with v3 in the same way as v2, meaning the config items are duplicated in our mach's Kconfig. I think this is better than cluttering central Kconfig files with our defaults. I guess I'll append a patch that re-syncs the defconfigs if they change at all...
Regards, Simon
Thanks. Masahiro Yamada
but I don't really
have a strong preference...
I agree with you on this. I'd really like some reply from Yamada-san.
So without a reply from Yamada-san for 10 days, how do we continue here?
Gentle ping?
In the next version (v3), Patch 2/5 should be fixed for a10.
In v3, I'd remove patch 2/5 since it is already covered by a different series that properly cleans up using full malloc only in SPL [2] and I'll make this series depend on v3 of that:
[2] https://patchwork.ozlabs.org/project/uboot/list/?series=97430
Regards, Simon
I'd also extend that next version with further cleanup patches from an earlier series [1] since I have I2C EEPROM finally running with DM (tested on the socfpga_socrates board by using the "Phy1" daughter board and a matching FPGA configuration).
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=85229
Regards, Simon
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
-- Best Regards Masahiro Yamada

By enabling debug prints in malloc_simple, we can see that SPL for socfpga gen5 does by far not need the 8 KiB malloc pool currently allocated for SPL in pre-reloc phase.
On socfpga_socrates, 1304 bytes are currently used (and this increases by ~200 bytes only for the sdram/reset fixes in socfpga-next).
To prevent wasting precious SRAM space, let's reduce the initial heap used for SPL to 2 KiB. This is still some hundred bytes more than currently used. Also, the gen5 SPL enables stack and heap in DDR memory pretty early. Only the initial uclass/dm parsing, serial console and DDR initialization is done in the initial heap, so these 2 KiB should be enough for all boards.
Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com ---
Changes in v2: - added patch to reduce gen5 SPL initial malloc pool to 2 KiB
arch/arm/mach-socfpga/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig index da801eb660..38d7799881 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig @@ -8,6 +8,7 @@ config SPL_STACK_R_ADDR
config SPL_SYS_MALLOC_F_LEN default 0x10000 if TARGET_SOCFPGA_ARRIA10 + default 0x800 if TARGET_SOCFPGA_GEN5
config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE default 0xa2
participants (3)
-
Marek Vasut
-
Masahiro Yamada
-
Simon Goldschmidt