"Das U-Boot" Source Tree
0
fork

Configure Feed

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

examples/api: improve determination of LOAD_ADDR

The current load address for the 'demo' binary does not work for
qemu_arm_defconfig.

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.

On most boards we can assume that 8 MiB of memory is available above
$loadaddr. So $loadaddr + 0x400000 should work there.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

authored by

Heinrich Schuchardt and committed by
Tom Rini
1df9cbd7 881f0b77

+3 -20
+3 -20
examples/api/Makefile
··· 5 5 # Provide symbol API_BUILD to signal that the API example is being built. 6 6 KBUILD_CPPFLAGS += -DAPI_BUILD 7 7 8 - ifeq ($(ARCH),powerpc) 9 - LOAD_ADDR = 0x40000 10 - endif 11 - ifeq ($(ARCH),arm) 12 - ifdef CONFIG_64BIT 13 - LOAD_ADDR = 0x40400000 14 - else 15 - LOAD_ADDR = 0x1000000 16 - endif 17 - endif 18 - ifeq ($(ARCH),mips) 19 - ifdef CONFIG_64BIT 20 - LOAD_ADDR = 0xffffffff80200000 21 - else 22 - LOAD_ADDR = 0x80200000 23 - endif 24 - endif 25 - ifeq ($(ARCH),riscv) 26 - LOAD_ADDR = 0x84000000 27 - endif 8 + # Environment variable loadaddr is set from CONFIG_SYS_LOAD_ADDR. 9 + # Run the examples 4 MiB above this address. 10 + LOAD_ADDR:=${shell printf 0x%X $$(( $(CONFIG_SYS_LOAD_ADDR) + 0x400000 ))} 28 11 29 12 # Resulting ELF and binary exectuables will be named demo and demo.bin 30 13 extra-y = demo