Asami Doi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33287
Change subject: payloads/libpayload: Update a Makefile and a wrappter of a compiler in libpayload in order to build sample payload for QEMU/ARM. ......................................................................
payloads/libpayload: Update a Makefile and a wrappter of a compiler in libpayload in order to build sample payload for QEMU/ARM.
Change-Id: Ia32872c43a99357aa966de3582f6fdb2e2652517 Signed-off-by: Asami Doi doiasami1219@gmail.com --- M payloads/libpayload/bin/lpgcc A payloads/libpayload/configs/config.emulation-qemu-arm M payloads/libpayload/drivers/Makefile.inc M payloads/libpayload/include/arm/arch/io.h M payloads/libpayload/sample/Makefile 5 files changed, 25 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/33287/1
diff --git a/payloads/libpayload/bin/lpgcc b/payloads/libpayload/bin/lpgcc index b3ef342..b636080 100755 --- a/payloads/libpayload/bin/lpgcc +++ b/payloads/libpayload/bin/lpgcc @@ -200,5 +200,5 @@ # header to be placed below 0x2000 in the resulting image. See: # http://www.gnu.org/software/grub/manual/multiboot/html_node/OS-image-format....
- $DEFAULT_CC $_LDFLAGS $HEAD_O $CMDLINE $_CFLAGS -lpayload $_LIBGCC + $DEFAULT_CC $_LDFLAGS $HEAD_O $CMDLINE $_CFLAGS -lpayload $_LIBGCC -lc fi diff --git a/payloads/libpayload/configs/config.emulation-qemu-arm b/payloads/libpayload/configs/config.emulation-qemu-arm new file mode 100644 index 0000000..e498126 --- /dev/null +++ b/payloads/libpayload/configs/config.emulation-qemu-arm @@ -0,0 +1,10 @@ +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_USB=y +CONFIG_LP_USB_OHCI=y +CONFIG_LP_USB_EHCI=y +CONFIG_LP_USB_XHCI=y + diff --git a/payloads/libpayload/drivers/Makefile.inc b/payloads/libpayload/drivers/Makefile.inc index b4e7594..7c555fd 100644 --- a/payloads/libpayload/drivers/Makefile.inc +++ b/payloads/libpayload/drivers/Makefile.inc @@ -50,9 +50,7 @@ libc-$(CONFIG_LP_NVRAM) += options.c
# Timer drivers -ifneq ($(CONFIG_LP_TIMER_GENERIC_HZ),0) libc-y += timer/generic.c -endif libc-$(CONFIG_LP_TIMER_RDTSC) += timer/rdtsc.c libc-$(CONFIG_LP_TIMER_IMG_PISTACHIO) += timer/img_pistachio.c libc-$(CONFIG_LP_TIMER_ARM64_ARCH) += timer/arm64_arch_timer.c diff --git a/payloads/libpayload/include/arm/arch/io.h b/payloads/libpayload/include/arm/arch/io.h index 2743852..58b8a22 100644 --- a/payloads/libpayload/include/arm/arch/io.h +++ b/payloads/libpayload/include/arm/arch/io.h @@ -34,6 +34,14 @@ #include <stdint.h> #include <arch/cache.h>
+#define inb(a) read8((const void *) (a)) +#define inw(a) read16((const void *) (a)) +#define inl(a) read32((const void *) (a)) + +#define outb(v, a) write8((void *) (&v), a) +#define outw(v, a) write16((void *) (&v), a) +#define outl(v, a) write32((void *) (&v), a) + /* * readb/w/l writeb/w/l are deprecated. use read8/16/32 and write8/16/32 * instead for future development. 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