From 95c331b94b1d04ea34b480c83613c2141a02697e Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Fri, 14 Sep 2018 01:21:05 -0700 Subject: rampayload: Add the linuxcheck payload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The i386.c file uses standard 3f8 UART for some simple diagnostic prints, and the libpayload console otherwise. This payload was used to debug Linux as a rampayload and was very helpful for that work. Change-Id: I1cce5528780cd825fd91a88137fa70abd9f218e7 Signed-off-by: Ronald G. Minnich Reviewed-on: https://review.coreboot.org/28600 Reviewed-by: Jonathan Neuschäfer Tested-by: build bot (Jenkins) --- payloads/linuxcheck/Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 payloads/linuxcheck/Makefile (limited to 'payloads/linuxcheck/Makefile') diff --git a/payloads/linuxcheck/Makefile b/payloads/linuxcheck/Makefile new file mode 100644 index 0000000000..b967369e1a --- /dev/null +++ b/payloads/linuxcheck/Makefile @@ -0,0 +1,37 @@ +LIBPAYLOAD_DIR=$(CURDIR)/libpayload +XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile +# build libpayload and put .config file in $(CURDIR) instead of ../libpayload +# to avoid pollute the libpayload source directory and possible conflicts +LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config" +CFLAGS += -Wall -Werror -Os -ffreestanding -nostdinc -nostdlib +ifeq ($(CONFIG_ARCH_X86),y) +TARGETARCH = i386 +endif + +all: linuxcheck.elf + +$(LIBPAYLOAD_DIR): + $(MAKE) -C ../libpayload $(LPOPTS) defconfig + $(MAKE) -C ../libpayload $(LPOPTS) + $(MAKE) -C ../libpayload $(LPOPTS) install + +ifneq ($(strip $(wildcard libpayload)),) +include $(XCOMPILE) +LPGCC = CC="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc" +%.elf: %.c Makefile + $(LPGCC) $(CFLAGS) -o $*.elf $*.c $(TARGETARCH).c +else +# If libpayload is not found, first build libpayload, +# then do the make, this time it'll find libpayload +# and generate the linuxcheck.elf target +%.elf: $(LIBPAYLOAD_DIR) + $(MAKE) all +endif + +clean: + rm -f linuxcheck.elf + +distclean: clean + rm -rf build libpayload .config .config.old + +.PHONY: all clean distclean -- cgit v1.2.3