Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33287 )
Change subject: payloads/libpayload: Update a Makefile for sample libpayload and make a configuraton for QEMU/ARM. ......................................................................
payloads/libpayload: Update a Makefile for sample libpayload and make a configuraton for QEMU/ARM.
This CL allows building a sample libpayload for QEMU/ARM.
Change-Id: Ia32872c43a99357aa966de3582f6fdb2e2652517 Signed-off-by: Asami Doi doiasami1219@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/33287 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Raul Rangel rrangel@chromium.org Reviewed-by: Julius Werner jwerner@chromium.org --- M payloads/libpayload/README A payloads/libpayload/configs/config.emulation-qemu-arm M payloads/libpayload/sample/Makefile 3 files changed, 21 insertions(+), 8 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved Raul Rangel: Looks good to me, approved
diff --git a/payloads/libpayload/README b/payloads/libpayload/README index fdf9b18..d35f685 100644 --- a/payloads/libpayload/README +++ b/payloads/libpayload/README @@ -22,12 +22,18 @@
$ make
- $ sudo make install (optional, will install into /opt per default) + $ make install (optional, will install into ./install per default)
-As libpayload is for 32bit x86 systems only, you might have to install the -32bit libgcc version, otherwise your payloads will fail to compile. +On x86 systems, libpayload will always be 32-bit even if your host OS runs +in 64-bit, so you might have to install the 32-bit libgcc version. On Debian systems you'd do 'apt-get install gcc-multilib' for example.
+Run 'make distclean' before switching boards. This command will remove +your current .config file, so you need 'make menuconfig' again or +'make defconfig' in order to set up configuration. Default configuration +is based on 'configs/defconfig'. See the configs/ directory for examples +of configuration. +
Usage ----- diff --git a/payloads/libpayload/configs/config.emulation-qemu-arm b/payloads/libpayload/configs/config.emulation-qemu-arm new file mode 100644 index 0000000..4b69caf --- /dev/null +++ b/payloads/libpayload/configs/config.emulation-qemu-arm @@ -0,0 +1,6 @@ +CONFIG_LP_ARCH_ARM=y +CONFIG_LP_STACK_SIZE=64000 +CONFIG_LP_BASE_ADDRESS=0x62030000 +CONFIG_LP_TINYCURSES=y +CONFIG_LP_8250_SERIAL_CONSOLE=y +CONFIG_LP_TIMER_GENERIC_HZ=1000000 diff --git a/payloads/libpayload/sample/Makefile b/payloads/libpayload/sample/Makefile index 5931d5e..18121df 100644 --- a/payloads/libpayload/sample/Makefile +++ b/payloads/libpayload/sample/Makefile @@ -28,19 +28,20 @@ ##
# Sample libpayload Makefile. -include ../.xcompile include ../.config +include ../.xcompile
-ARCH-$(CONFIG_LP_ARCH_ARMV) := arm -ARCH-$(CONFIG_LP_ARCH_POWERPC) := powerpc -ARCH-$(CONFIG_LP_ARCH_X86) := i386 +ARCH-$(CONFIG_LP_ARCH_ARM) := arm +ARCH-$(CONFIG_LP_ARCH_X86) := x86_32 +ARCH-$(CONFIG_LP_ARCH_ARM64) := arm64 +ARCH-$(CONFIG_LP_ARCH_MIPS) := mips
CC := $(CC_$(ARCH-y)) AS := $(AS_$(ARCH-y)) LIBPAYLOAD_DIR := ../install/libpayload XCC := CC="$(CC)" $(LIBPAYLOAD_DIR)/bin/lpgcc XAS := AS="$(AS)" $(LIBPAYLOAD_DIR)/bin/lpas -CFLAGS := -Wall -Werror -Os +CFLAGS := -fno-builtin -Wall -Werror -Os TARGET := hello OBJS := $(TARGET).o