[U-Boot] [PATCH 0/3] MIPS: fix building and linking of standalone programs

Daniel Schwierzeck daniel.schwierzeck at gmail.com
Sun Sep 23 17:15:14 UTC 2018


This series fixes the long-time broken support of standalone
programs on MIPS. All MIPS standalone programs now use the
main MIPS linker script and all available code size optimizations.
Finally the deprecated Makefiles arch/mips/cpu/mips[32,64]/config.mk
could be removed.

The series also improves the passing of additional linker flags
to standalone programs by introducing a Makefile variable
LDFLAGS_STANDALONE. Currently the variable CONFIG_STANDALONE_LOAD_ADDR
is misused on some archs to pass the path to the linker script. The
variable LDFLAGS_STANDALONE now provides a cleaner way to do that.
Furthermore it is now possible to migrate CONFIG_STANDALONE_LOAD_ADDR
to Kconfig as a hex symbol.

Sample test session with Malta board in Qemu:

U-Boot 2018.09-00270-g19936da8bc (Sep 23 2018 - 18:43:17 +0200)

Board: MIPS Malta CoreLV
DRAM:  256 MiB
Flash: 4 MiB
*** Warning - bad CRC, using default environment

In:    serial at 3f8
Out:   serial at 3f8
Err:   serial at 3f8
Net:   pcnet#0
IDE:   Bus 0: not available
malta #
malta #
malta # dhcp 80200000 hello_world.bin
BOOTP broadcast 1
DHCP client bound to address 10.0.2.15 (3 ms)
Using pcnet#0 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'hello_world.bin'.
Load address: 0x80200000
Loading: ###
	 32.2 MiB/s
done
Bytes transferred = 33784 (83f8 hex)
malta # go 80200000
Example expects ABI version 9
Actual U-Boot ABI version 9
Hello World
argc = 1
argv[0] = "80200000"
argv[1] = "<NULL>"
Hit any key to exit ...

malta # go 80200000 666
Example expects ABI version 9
Actual U-Boot ABI version 9
Hello World
argc = 2
argv[0] = "80200000"
argv[1] = "666"
argv[2] = "<NULL>"
Hit any key to exit ...



Daniel Schwierzeck (3):
  Kbuild: add LDFLAGS_STANDALONE
  Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS
  MIPS: fix linking of standalone programs

 arch/mips/config.mk            |  5 ++++
 arch/mips/cpu/mips32/config.mk |  7 ------
 arch/mips/cpu/mips64/config.mk |  7 ------
 arch/nds32/config.mk           |  4 ++--
 arch/riscv/config.mk           |  4 ++--
 arch/sh/config.mk              |  2 +-
 config.mk                      |  2 ++
 examples/standalone/Makefile   |  8 ++++---
 examples/standalone/mips.lds   | 42 ----------------------------------
 examples/standalone/mips64.lds | 42 ----------------------------------
 10 files changed, 17 insertions(+), 106 deletions(-)
 delete mode 100644 arch/mips/cpu/mips32/config.mk
 delete mode 100644 arch/mips/cpu/mips64/config.mk
 delete mode 100644 examples/standalone/mips.lds
 delete mode 100644 examples/standalone/mips64.lds

-- 
2.19.0



More information about the U-Boot mailing list