"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

examples: eliminate CONFIG_STANDALONE_LOAD_ADDR

CONFIG_STANDALONE_LOAD_ADDR has been used for examples/standalone
but not for examples/api.

The suitability of an address to load an ELF binary and run it does
not only depend on the architecture but also on the memory layout of
the board which is not reflected in the default value of
CONFIG_STANDALONE_LOAD_ADDR.

Commit 32b7e39db4d3 ("Convert CONFIG_STANDALONE_LOAD_ADDR to Kconfig")
set the default on RISC-V to 0x0 though most boards used 0x80200000
before the patch.

On most boards we can assume 8 MiB of memory available above $loadaddr.
So we can safely use $loadaddr + 4 MiB as load address for the standalone
example and eliminate CONFIG_STANDALONE_LOAD_ADDR altogether.

Fixes: 32b7e39db4d3 ("Convert CONFIG_STANDALONE_LOAD_ADDR to Kconfig")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

authored by

Heinrich Schuchardt and committed by
Tom Rini
72bbb645 1df9cbd7

+5 -22
-20
api/Kconfig
··· 19 19 U-Boot provides an API for standalone applications. Examples are 20 20 provided in directory examples/. 21 21 22 - config STANDALONE_LOAD_ADDR 23 - depends on EXAMPLES 24 - hex "Address in memory to link standalone applications to" 25 - default 0xffffffff80200000 if MIPS && 64BIT 26 - default 0x8c000000 if SH 27 - default 0x82000000 if ARC 28 - default 0x80f00000 if MICROBLAZE 29 - default 0x80300000 if ARCH_OMAP2PLUS || FSL_LSCH2 || FSL_LSCH3 30 - default 0x80200000 if MIPS && 32BIT 31 - default 0x0c100000 if ARM 32 - default 0x02000000 if NIOS2 33 - default 0x00040000 if PPC || X86 34 - default 0x00020000 if M68K 35 - default 0x0 if RISCV 36 - default SYS_LOAD_ADDR 37 - help 38 - This option defines a board specific value for the address where 39 - standalone program gets loaded, thus overwriting the architecture 40 - dependent default settings. 41 - 42 22 endmenu
-1
config.mk
··· 76 76 export RELFLAGS 77 77 export LDFLAGS_FINAL 78 78 export LDFLAGS_STANDALONE 79 - export CONFIG_STANDALONE_LOAD_ADDR
+5 -1
examples/standalone/Makefile
··· 7 7 extra-$(CONFIG_SPI_FLASH_ATMEL) += atmel_df_pow2 8 8 extra-$(CONFIG_PPC) += sched 9 9 10 + # Environment variable loadaddr is set from CONFIG_SYS_LOAD_ADDR. 11 + # Run the examples 4 MiB above this address. 12 + LOAD_ADDR:=${shell printf 0x%X $$(( $(CONFIG_SYS_LOAD_ADDR) + 0x400000 ))} 13 + 10 14 # 11 15 # Some versions of make do not handle trailing white spaces properly; 12 16 # leading to build failures. The problem was found with GNU Make 3.80. ··· 46 50 # source file. 47 51 ccflags-y += $(call cc-option,-fno-toplevel-reorder) 48 52 49 - LDFLAGS_STANDALONE += -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) 53 + LDFLAGS_STANDALONE += -Ttext $(LOAD_ADDR) 50 54 51 55 ######################################################################### 52 56