Kconfig: move CONFIG_STANDALONE_LOAD_ADDR to Kconfig
Subsystems (12)
cover Kconfig: move CONFIG_STANDALONE_LOAD_ADDR to Kconfig
Create a new Kconfig menu called 'Standalone programs' with 'Program load address' as menu entry. It's possible now to build without the standalone example. Anyway the default value for CONFIG_STANDALONE is 'y' to maintain the current behavior.
The first two patches prepared the config header files 'include/configs/opos6uldev.h' and 'include/configs/sunxi-common.h' so moveconfig.py didn't complain anymore.
This patch series depends on the series:
https://patchwork.ozlabs.org/project/uboot/list/?series=67121
Daniel Schwierzeck (3):
arm: opos6uldev: use real value for CONFIG_STANDALONE_LOAD_ADDR
arm: sunxi: use real values for CONFIG_STANDALONE_LOAD_ADDR
Kconfig: move CONFIG_STANDALONE_LOAD_ADDR to Kconfig
Kconfig | 2 ++ README | 8 -------- arch/arc/Kconfig | 3 +++ arch/arc/config.mk | 3 --- arch/arm/Kconfig | 7 +++++++ arch/arm/config.mk | 8 -------- .../arm/include/asm/arch-fsl-layerscape/config.h | 2 -- arch/m68k/Kconfig | 3 +++ arch/m68k/config.mk | 2 -- arch/microblaze/Kconfig | 3 +++ arch/microblaze/config.mk | 2 -- arch/mips/Kconfig | 4 ++++ arch/mips/config.mk | 2 -- arch/nds32/Kconfig | 3 +++ arch/nds32/config.mk | 1 - arch/nios2/Kconfig | 3 +++ arch/nios2/config.mk | 2 -- arch/powerpc/Kconfig | 3 +++ arch/powerpc/config.mk | 1 - arch/riscv/Kconfig | 3 +++ arch/riscv/config.mk | 1 - arch/sandbox/Kconfig | 3 +++ arch/sh/Kconfig | 3 +++ arch/sh/config.mk | 1 - arch/x86/Kconfig | 3 +++ arch/x86/config.mk | 2 -- arch/xtensa/Kconfig | 3 +++ config.mk | 1 - configs/display5_defconfig | 1 + configs/display5_factory_defconfig | 1 + configs/kzm9g_defconfig | 1 + configs/opos6uldev_defconfig | 1 + examples/Makefile | 2 +- examples/standalone/Kconfig | 14 ++++++++++++++ include/configs/display5.h | 1 - include/configs/kzm9g.h | 2 -- include/configs/opos6uldev.h | 3 --- include/configs/sunxi-common.h | 3 --- include/configs/xtfpga.h | 16 ---------------- scripts/config_whitelist.txt | 1 - 40 files changed, 65 insertions(+), 63 deletions(-) create mode 100644 examples/standalone/Kconfig
Signature · 1 line
2.19.0
PATCH 1/3 arm: opos6uldev: use real value for CONFIG_STANDALONE_LOAD_ADDR
Standalone programs on opos6uldev are linked to 0x82000000. Use this value directly to prepare for Kconfig migration of CONFIG_STANDALONE_LOAD_ADDR.
---
include/configs/opos6uldev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/opos6uldev.h +1 -1
@@ -22,7 +22,7 @@#define CONFIG_SYS_MALLOC_LEN (16 << 20)/* Miscellaneous configurable options */ -#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR +#define CONFIG_STANDALONE_LOAD_ADDR 0x82000000/* Physical Memory Map */ #define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR
Signature · 1 line
2.19.0
PATCH 2/3 arm: sunxi: use real values for CONFIG_STANDALONE_LOAD_ADDR
In reply to Daniel SchwierzeckAll standalone programs on sunxi boards are linked to 0x42000000. Exceptions are only sun9i boards with a link address of 0x22000000. Use these values directly to prepare for Kconfig migration of CONFIG_STANDALONE_LOAD_ADDR.
---
include/configs/sunxi-common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/configs/sunxi-common.h +5 -1
@@ -170,7 +170,11 @@#define CONFIG_SYS_PBSIZE 1024/* Print Buffer Size */ /* standalone support */ -#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR +#ifdef CONFIG_MACH_SUN9I +#define CONFIG_STANDALONE_LOAD_ADDR 0x22000000 +#else +#define CONFIG_STANDALONE_LOAD_ADDR 0x42000000 +#endif /* FLASH and environment organization */
Signature · 1 line
2.19.0
PATCH 3/3 Kconfig: move CONFIG_STANDALONE_LOAD_ADDR to Kconfig
In reply to Daniel SchwierzeckCreate a new Kconfig menu called 'Standalone programs' with 'Program load address' as menu entry. It's possible now to build without the standalone example. Anyway the default value for CONFIG_STANDALONE is 'y' to maintain the current behavior.
---
Kconfig | 2 ++ README | 8 -------- arch/arc/Kconfig | 3 +++ arch/arc/config.mk | 3 --- arch/arm/Kconfig | 7 +++++++ arch/arm/config.mk | 8 -------- .../arm/include/asm/arch-fsl-layerscape/config.h | 2 -- arch/m68k/Kconfig | 3 +++ arch/m68k/config.mk | 2 -- arch/microblaze/Kconfig | 3 +++ arch/microblaze/config.mk | 2 -- arch/mips/Kconfig | 4 ++++ arch/mips/config.mk | 2 -- arch/nds32/Kconfig | 3 +++ arch/nds32/config.mk | 1 - arch/nios2/Kconfig | 3 +++ arch/nios2/config.mk | 2 -- arch/powerpc/Kconfig | 3 +++ arch/powerpc/config.mk | 1 - arch/riscv/Kconfig | 3 +++ arch/riscv/config.mk | 1 - arch/sandbox/Kconfig | 3 +++ arch/sh/Kconfig | 3 +++ arch/sh/config.mk | 1 - arch/x86/Kconfig | 3 +++ arch/x86/config.mk | 2 -- arch/xtensa/Kconfig | 3 +++ config.mk | 1 - configs/display5_defconfig | 1 + configs/display5_factory_defconfig | 1 + configs/kzm9g_defconfig | 1 + configs/opos6uldev_defconfig | 1 + examples/Makefile | 2 +- examples/standalone/Kconfig | 14 ++++++++++++++ include/configs/display5.h | 1 - include/configs/kzm9g.h | 2 -- include/configs/opos6uldev.h | 3 --- include/configs/sunxi-common.h | 7 ------- include/configs/xtfpga.h | 16 ---------------- scripts/config_whitelist.txt | 1 - 40 files changed, 65 insertions(+), 67 deletions(-) create mode 100644 examples/standalone/Kconfig
Kconfig +2 -0
@@ -491,6 +491,8 @@ source "dts/Kconfig" source "env/Kconfig" +source "examples/standalone/Kconfig" + source "net/Kconfig" source "drivers/Kconfig"
README +0 -8
@@ -2377,14 +2377,6 @@ FIT uImage format: -150 common/cmd_nand.c Incorrect FIT image format 151 common/cmd_nand.c FIT image format OK -- Standalone program support: - CONFIG_STANDALONE_LOAD_ADDR - - This option defines a board specific value for the - address where standalone program gets loaded, thus - overwriting the architecture dependent default - settings. - - Frame Buffer Address: CONFIG_FB_ADDR
arch/arc/Kconfig +3 -0
@@ -8,6 +8,9 @@ config SYS_CPU default "arcv1" if ISA_ARCOMPACT default "arcv2" if ISA_ARCV2 +config STANDALONE_LOAD_ADDR + default 0x82000000 + choice prompt "ARC Instruction Set" default ISA_ARCOMPACT
arch/arc/config.mk +0 -3
@@ -53,6 +53,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections # Needed for relocation LDFLAGS_FINAL += -pie --gc-sections - -# Load address for standalone apps -CONFIG_STANDALONE_LOAD_ADDR ?= 0x82000000
arch/arm/Kconfig +7 -0
@@ -4,6 +4,13 @@ menu "ARM architecture" config SYS_ARCH default "arm" +config STANDALONE_LOAD_ADDR + default 0x80300000 if ARCH_OMAP2PLUS + default 0x80300000 if FSL_LAYERSCAPE + default 0x22000000 if MACH_SUN9I + default 0x42000000 if ARCH_SUNXI + default 0xc100000 + config ARM64 bool select PHYS_64BIT
arch/arm/config.mk +0 -8
@@ -3,14 +3,6 @@ # (C) Copyright 2000-2002 # Wolfgang Denk, DENX Software Engineering, wd at denx.de. -ifndef CONFIG_STANDALONE_LOAD_ADDR -ifneq ($(CONFIG_ARCH_OMAP2PLUS),) -CONFIG_STANDALONE_LOAD_ADDR = 0x80300000 -else -CONFIG_STANDALONE_LOAD_ADDR = 0xc100000 -endif -endif - CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata-sections CFLAGS_EFI := -fpic -fshort-wchar
arch/arm/include/asm/arch-fsl-layerscape/config.h +0 -2
@@ -9,8 +9,6 @@#include <linux/kconfig.h> #include <fsl_ddrc_version.h> -#define CONFIG_STANDALONE_LOAD_ADDR 0x80300000 -/* * Reserve secure memory * To be aligned with MMU block size
arch/m68k/Kconfig +3 -0
@@ -4,6 +4,9 @@ menu "M68000 architecture" config SYS_ARCH default "m68k" +config STANDALONE_LOAD_ADDR + default 0x20000 + # processor family config MCF520x bool
arch/m68k/config.mk +0 -2
@@ -7,8 +7,6 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := m68k-elf- endif -CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000 - PLATFORM_CPPFLAGS += -D__M68K__ PLATFORM_LDFLAGS += -n PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
arch/microblaze/Kconfig +3 -0
@@ -4,6 +4,9 @@ menu "MicroBlaze architecture" config SYS_ARCH default "microblaze" +config STANDALONE_LOAD_ADDR + default 0x80F00000 + choice prompt "Target select" optional
arch/microblaze/config.mk +0 -2
@@ -10,8 +10,6 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := mb- endif -CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000 - PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__ ifeq ($(CONFIG_SPL_BUILD),)
arch/mips/Kconfig +4 -0
@@ -8,6 +8,10 @@ config SYS_CPU default "mips32" if CPU_MIPS32 default "mips64" if CPU_MIPS64 +config STANDALONE_LOAD_ADDR + default 0x80200000 if CPU_MIPS32 + default 0xffffffff80200000 if CPU_MIPS64 + choice prompt "Target select" optional
arch/mips/config.mk +0 -2
@@ -25,14 +25,12 @@ ifdef CONFIG_32BIT PLATFORM_CPPFLAGS += -mabi=32 PLATFORM_LDFLAGS += -m $(32bit-emul) OBJCOPYFLAGS += -O $(32bit-bfd) -CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 endif ifdef CONFIG_64BIT PLATFORM_CPPFLAGS += -mabi=64 PLATFORM_LDFLAGS += -m$(64bit-emul) OBJCOPYFLAGS += -O $(64bit-bfd) -CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 endif PLATFORM_CPPFLAGS += -D__MIPS__
arch/nds32/Kconfig +3 -0
@@ -4,6 +4,9 @@ menu "NDS32 architecture" config SYS_ARCH default "nds32" +config STANDALONE_LOAD_ADDR + default 0x300000 + choice prompt "Target select" optional
arch/nds32/config.mk +0 -1
@@ -12,7 +12,6 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := nds32le-linux- endif -CONFIG_STANDALONE_LOAD_ADDR = 0x300000 LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/nds32.lds PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -mrelax
arch/nios2/Kconfig +3 -0
@@ -11,4 +11,7 @@ config SYS_CONFIG_NAME The header file include/configs/<CONFIG_SYS_CONFIG_NAME>.h should be included from include/config.h. +config STANDALONE_LOAD_ADDR + default 0x02000000 + endmenu
arch/nios2/config.mk +0 -2
@@ -8,8 +8,6 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := nios2-elf- endif -CONFIG_STANDALONE_LOAD_ADDR ?= 0x02000000 - PLATFORM_CPPFLAGS += -D__NIOS2__ PLATFORM_CPPFLAGS += -G0
arch/powerpc/Kconfig +3 -0
@@ -4,6 +4,9 @@ menu "PowerPC architecture" config SYS_ARCH default "powerpc" +config STANDALONE_LOAD_ADDR + default 0x40000 + choice prompt "CPU select" optional
arch/powerpc/config.mk +0 -1
@@ -7,7 +7,6 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := ppc_8xx- endif -CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000 LDFLAGS_FINAL += --gc-sections LDFLAGS_FINAL += --bss-plt PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections \
arch/riscv/Kconfig +3 -0
@@ -4,6 +4,9 @@ menu "RISCV architecture" config SYS_ARCH default "riscv" +config STANDALONE_LOAD_ADDR + default 0x00000000 + choice prompt "Target select" optional
arch/riscv/config.mk +0 -1
@@ -27,7 +27,6 @@ PLATFORM_LDFLAGS += -m $(64bit-emul) EFI_LDS := elf_riscv64_efi.lds endif -CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/riscv.lds PLATFORM_CPPFLAGS += -ffixed-gp -fpic
arch/sandbox/Kconfig +3 -0
@@ -10,6 +10,9 @@ config SYS_BOARD config SYS_CPU default "sandbox" +config STANDALONE_LOAD_ADDR + default 0x0 + config SANDBOX64 bool "Use 64-bit addresses" select PHYS_64BIT
arch/sh/Kconfig +3 -0
@@ -125,6 +125,9 @@ config SYS_CPU default "sh3" if CPU_SH3 default "sh4" if CPU_SH4 +config STANDALONE_LOAD_ADDR + default 0x8C000000 + source "arch/sh/lib/Kconfig" source "board/alphaproject/ap_sh4a_4a/Kconfig"
arch/sh/config.mk +0 -1
@@ -7,7 +7,6 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := sh4-linux- endif -CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000 ifeq ($(CPU),sh2) LDFLAGS_STANDALONE += -EB endif
arch/x86/Kconfig +3 -0
@@ -4,6 +4,9 @@ menu "x86 architecture" config SYS_ARCH default "x86" +config STANDALONE_LOAD_ADDR + default 0x40000 + choice prompt "Run U-Boot in 32/64-bit mode" default X86_RUN_32BIT
arch/x86/config.mk +0 -2
@@ -3,8 +3,6 @@ # (C) Copyright 2000-2002 # Wolfgang Denk, DENX Software Engineering, wd at denx.de. -CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000 - PLATFORM_CPPFLAGS += -fno-strict-aliasing PLATFORM_CPPFLAGS += -fomit-frame-pointer PF_CPPFLAGS_X86 := $(call cc-option, -fno-toplevel-reorder, \
arch/xtensa/Kconfig +3 -0
@@ -8,6 +8,9 @@ config SYS_ARCH config SYS_CPU string "Xtensa Core Variant" +config STANDALONE_LOAD_ADDR + default 0x00800000 + choice prompt "Target select"
config.mk +0 -1
@@ -77,4 +77,3 @@ export PLATFORM_CPPFLAGS export RELFLAGS export LDFLAGS_FINAL export LDFLAGS_STANDALONE -export CONFIG_STANDALONE_LOAD_ADDR
configs/display5_defconfig +1 -0
@@ -1,4 +1,5 @@ CONFIG_ARM=y +CONFIG_STANDALONE_LOAD_ADDR=0x10001000 CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 CONFIG_SPL_GPIO_SUPPORT=y
configs/display5_factory_defconfig +1 -0
@@ -1,4 +1,5 @@ CONFIG_ARM=y +CONFIG_STANDALONE_LOAD_ADDR=0x10001000 CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 CONFIG_SPL_GPIO_SUPPORT=y
configs/kzm9g_defconfig +1 -0
@@ -1,4 +1,5 @@ CONFIG_ARM=y +CONFIG_STANDALONE_LOAD_ADDR=0x41000000 # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x00000000
configs/opos6uldev_defconfig +1 -0
@@ -1,4 +1,5 @@ CONFIG_ARM=y +CONFIG_STANDALONE_LOAD_ADDR=0x82000000 CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x87800000 CONFIG_SPL_GPIO_SUPPORT=y
examples/Makefile +1 -1
@@ -6,6 +6,6 @@ ifdef FTRACE subdir-ccflags-y += -finstrument-functions -DFTRACE endif -subdir-y += standalone +subdir-$(CONFIG_STANDALONE) += standalone subdir-$(CONFIG_API) += api endif
examples/standalone/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +menuconfig STANDALONE + bool "Standalone programs" + default y + +if STANDALONE + +config STANDALONE_LOAD_ADDR + hex "Program load address" + help + This option defines the address where a standalone program is linked to + and where it is loaded to in RAM. In most cases you can use the default + value defined by your architecture. + +endif # STANDALONE
include/configs/display5.h +0 -1
@@ -350,7 +350,6 @@#define CONFIG_SYS_MAXARGS 32#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE -#define CONFIG_STANDALONE_LOAD_ADDR 0x10001000#define CONFIG_SYS_HZ 1000/* Physical Memory Map */
include/configs/kzm9g.h +0 -2
@@ -60,8 +60,6 @@#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024)#define CONFIG_SYS_BOOTMAPSZ (8 * 1024 * 1024) -#define CONFIG_STANDALONE_LOAD_ADDR 0x41000000 -/* FLASH */ #define CONFIG_FLASH_CFI_DRIVER #define CONFIG_SYS_FLASH_CFI
include/configs/opos6uldev.h +0 -3
@@ -21,9 +21,6 @@/* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (16 << 20) -/* Miscellaneous configurable options */ -#define CONFIG_STANDALONE_LOAD_ADDR 0x82000000 -/* Physical Memory Map */ #define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
include/configs/sunxi-common.h +0 -7
@@ -169,13 +169,6 @@#define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ #define CONFIG_SYS_PBSIZE 1024/* Print Buffer Size */ -/* standalone support */ -#ifdef CONFIG_MACH_SUN9I -#define CONFIG_STANDALONE_LOAD_ADDR 0x22000000 -#else -#define CONFIG_STANDALONE_LOAD_ADDR 0x42000000 -#endif -/* FLASH and environment organization */ #define CONFIG_SYS_MONITOR_LEN (768 << 10)/* 768 KiB */
include/configs/xtfpga.h +0 -16
@@ -74,22 +74,6 @@#define CONFIG_SYS_MEMTEST_START MEMADDR(0x01000000)#define CONFIG_SYS_MEMTEST_END MEMADDR(0x02000000) -/* Load address for stand-alone applications. -* MEMADDR cannot be used here, because the definition needs to be -* a plain number as it's used as -Ttext argument for ld in standalone -* example makefile. -* Handle noMMU vs MMUv2 vs MMUv3 distinction here manually. -*/ -#if XCHAL_HAVE_PTP_MMU -#if XCHAL_VECBASE_RESET_VADDR ==XCHAL_VECBASE_RESET_PADDR -#define CONFIG_STANDALONE_LOAD_ADDR 0x00800000 -#else -#define CONFIG_STANDALONE_LOAD_ADDR 0xd0800000 -#endif -#else -#define CONFIG_STANDALONE_LOAD_ADDR 0x60800000 -#endif -#if defined(CONFIG_MAX_MEM_MAPPED ) && \CONFIG_MAX_MEM_MAPPED <CONFIG_SYS_SDRAM_SIZE #define CONFIG_SYS_MEMORY_SIZE CONFIG_MAX_MEM_MAPPED
scripts/config_whitelist.txt +0 -1
@@ -1970,7 +1970,6 @@ CONFIG_SSP1_BASE CONFIG_SSP2_BASE CONFIG_SSP3_BASE CONFIG_STACKBASE -CONFIG_STANDALONE_LOAD_ADDR CONFIG_STATIC_BOARD_REV CONFIG_STD_DEVICES_SETTINGS CONFIG_STM32_FLASH
Signature · 1 line
2.19.0
Max Filippov
maintainerPATCH 3/3 Kconfig: move CONFIG_STANDALONE_LOAD_ADDR to Kconfig
Quoted 6 lines · Daniel Schwierzeck
Create a new
Kconfigmenu called 'Standalone programs' with 'Program load address' as menu entry. It's possible now to build without the standalone example. Anyway the default value forCONFIG_STANDALONEis 'y' to maintain the current behavior.Signed-off-by Daniel Schwierzeck <[email protected]>
[...]
arch/xtensa/Kconfig config SYS_ARCH · line 13
Quoted 11 lines
arch/xtensa/Kconfig +3
-0@@ -8,6 +8,9 @@ config SYS_ARCH config SYS_CPU string "Xtensa Core Variant" +config STANDALONE_LOAD_ADDR + default 0x00800000 +
This doesn't preserve current address assignment for xtensa XTFPGA boards:
Quoted 11 lines
include/configs/xtfpga.h +0
-5@@ -74,22 +74,6 @@#define CONFIG_SYS_MEMTEST_START MEMADDR(0x01000000)#define CONFIG_SYS_MEMTEST_END MEMADDR(0x02000000) -/* Load address for stand-alone applications. -* MEMADDR cannot be used here, because the definition needs to be -* a plain number as it's used as -Ttext argument for ld in standalone -* example makefile. -* Handle noMMU vs MMUv2 vs MMUv3 distinction here manually.
include/configs/xtfpga.h line 91
Quoted 10 lines
include/configs/xtfpga.h +0
-10-*/ -#if XCHAL_HAVE_PTP_MMU -#if XCHAL_VECBASE_RESET_VADDR ==XCHAL_VECBASE_RESET_PADDR -#define CONFIG_STANDALONE_LOAD_ADDR 0x00800000 -#else -#define CONFIG_STANDALONE_LOAD_ADDR 0xd0800000 -#endif -#else -#define CONFIG_STANDALONE_LOAD_ADDR 0x60800000 -#endif
OTOH I don't see any way to express this in Kconfig.
Signature · 2 lines
Thanks. -- Max
PATCH 3/3 Kconfig: move CONFIG_STANDALONE_LOAD_ADDR to Kconfig
Quoted 41 lines · Max Filippov
Quoted 6 lines · Daniel Schwierzeck
Create a new
Kconfigmenu called 'Standalone programs' with 'Program load address' as menu entry. It's possible now to build without the standalone example. Anyway the default value forCONFIG_STANDALONEis 'y' to maintain the current behavior.Signed-off-by Daniel Schwierzeck <[email protected]>[...]
arch/xtensa/Kconfig config SYS_ARCH · line 13
Quoted 11 lines
arch/xtensa/Kconfig +3
-0@@ -8,6 +8,9 @@ config SYS_ARCH config SYS_CPU string "Xtensa Core Variant" +config STANDALONE_LOAD_ADDR + default 0x00800000 +This doesn't preserve current address assignment for xtensa XTFPGA boards:
Quoted 15 lines
include/configs/xtfpga.h +0
-9@@ -74,22 +74,6 @@#define CONFIG_SYS_MEMTEST_START MEMADDR(0x01000000)#define CONFIG_SYS_MEMTEST_END MEMADDR(0x02000000) -/* Load address for stand-alone applications. -* MEMADDR cannot be used here, because the definition needs to be -* a plain number as it's used as -Ttext argument for ld in standalone -* example makefile. -* Handle noMMU vs MMUv2 vs MMUv3 distinction here manually. -*/ -#if XCHAL_HAVE_PTP_MMU -#if XCHAL_VECBASE_RESET_VADDR ==XCHAL_VECBASE_RESET_PADDR -#define CONFIG_STANDALONE_LOAD_ADDR 0x00800000
Quoted 9 lines
include/configs/xtfpga.h line 91
Quoted 6 lines
include/configs/xtfpga.h +0
-6-#else -#define CONFIG_STANDALONE_LOAD_ADDR 0xd0800000 -#endif -#else -#define CONFIG_STANDALONE_LOAD_ADDR 0x60800000 -#endif OTOH I don't see any way to express this in
Kconfig.
I see you set the SYS_CPU string manually. I think this is error-prone and not user-friendly. I suggest to convert this to Kconfig symbols like this:
config SYS_CPU
default "dc232b" if CPU_DC232B default "dc233c" if CPU_DC233C default "de212" if CPU_DE212
choice
prompt "Xtensa Core Variant"
default CPU_DC233C
config CPU_DC232B
bool "dc232b"
config CPU_DC233C
bool "dc233c"
config CPU_DE212
bool "de212"
endchoice
Then the user can only choose between the three supported cores and SYS_CPU will be automatically updated. The default value for STANDALONE_LOAD_ADDR could be set like this:
config STANDALONE_LOAD_ADDR
default 0xd0800000 if CPU_DC232B default 0x00800000 if CPU_DC233C default 0x60800000 if CPU_DE212
Alternatively you model the MMU configuration also as Kconfig symbol which can be selected by those CPU_* symbols. Then you set the default value of STANDALONE_LOAD_ADDR dependent on that MMU setting. What do you think?
Signature · 9 lines
- Daniel -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180924/e198da17/attachment.sig>
Max Filippov
maintainerPATCH 3/3 Kconfig: move CONFIG_STANDALONE_LOAD_ADDR to Kconfig
Hi Daniel,
Quoted 16 lines · Daniel Schwierzeck
I see you set the
SYS_CPUstring manually. I think this is error-prone and not user-friendly. I suggest to convert this toKconfigsymbols like this:config
SYS_CPUdefault "dc232b" if CPU_DC232B default "dc233c" if CPU_DC233C default "de212" if CPU_DE212choice
prompt "Xtensa Core Variant"
defaultCPU_DC233Cconfig
CPU_DC232Bbool "dc232b"
Quoted 7 lines
config
CPU_DC233Cbool "dc233c"config
CPU_DE212bool "de212"endchoice
These cpus are just a few examples included into the u-boot that cover three major xtensa MMU types. There's no fixed list of xtensa CPUs and users are expected to add CPUs that they configure themselves.
Quoted 5 lines
Then the user can only choose between the three supported cores and
SYS_CPUwill be automatically updated. The default value forSTANDALONE_LOAD_ADDRcould be set like this:
/fac/proj_software/filippov/git/homewood/logs/log.DC_212GP.7441 configSTANDALONE_LOAD_ADDR
Quoted 8 lines
default 0xd0800000 if CPU_DC232B default 0x00800000 if CPU_DC233C default 0x60800000 if CPU_DE212Alternatively you model the MMU configuration also as
Kconfigsymbol which can be selected by those CPU_* symbols. Then you set the default value ofSTANDALONE_LOAD_ADDRdependent on that MMU setting. What do you think?
That is possible, but is also not user-friendly: the headers that describe CPU are generated by the xtensa CPU build process and currently the user just copies them into arch/xtensa/include/asm and selects correct CPU name. Remaining information is extracted from these headers.
If the user is asked to select CPU MMU type in Kconfig that's a space for an error. We can add a check that MMU type configured in Kconfig matches selected CPU type.
Or we could generate Kconfig snippet for each CPU and make Kconfig include it. Let me look at it closer.
Signature · 2 lines
Thanks. -- Max