From a816c298821ea7d587d615b178754ced8b4660bf Mon Sep 17 00:00:00 2001 From: Sergii Dmytruk Date: Wed, 27 Oct 2021 00:23:14 +0300 Subject: payloads/external: add skiboot (for QEMU/Power9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option to build skiboot as a payload. This makes QEMU Power9 board simpler to use as skiboot is necessary anyway. Change-Id: I0b49ea7464c97cc2ff0d5030629deed549851372 Signed-off-by: Igor Bagnucki Signed-off-by: Krystian Hebel Signed-off-by: Sergii Dmytruk Reviewed-on: https://review.coreboot.org/c/coreboot/+/58656 Tested-by: build bot (Jenkins) Reviewed-by: Michał Żygowski --- payloads/Makefile.inc | 1 + payloads/external/.gitignore | 2 ++ payloads/external/Makefile.inc | 7 +++++++ payloads/external/skiboot/Kconfig | 21 ++++++++++++++++++++ payloads/external/skiboot/Kconfig.name | 8 ++++++++ payloads/external/skiboot/Makefile | 36 ++++++++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+) create mode 100644 payloads/external/skiboot/Kconfig create mode 100644 payloads/external/skiboot/Kconfig.name create mode 100644 payloads/external/skiboot/Makefile (limited to 'payloads') diff --git a/payloads/Makefile.inc b/payloads/Makefile.inc index 83194c2ec5ae..a182bd65ad26 100644 --- a/payloads/Makefile.inc +++ b/payloads/Makefile.inc @@ -28,6 +28,7 @@ payloads/external/tianocore \ payloads/external/GRUB2 \ payloads/external/LinuxBoot \ payloads/external/Yabits \ +payloads/external/skiboot \ force-payload: diff --git a/payloads/external/.gitignore b/payloads/external/.gitignore index ebca42908b8f..9aaa95c03862 100644 --- a/payloads/external/.gitignore +++ b/payloads/external/.gitignore @@ -8,3 +8,5 @@ tint/tint/ U-Boot/u-boot/ Memtest86Plus/memtest86plus/ iPXE/ipxe/ +skiboot/skiboot +skiboot/build diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc index 072d8d120e7b..836dda2d3c5f 100644 --- a/payloads/external/Makefile.inc +++ b/payloads/external/Makefile.inc @@ -332,3 +332,10 @@ payloads/external/Yabits/uefi/build/uefi.elf yabits: payloads/external/BOOTBOOT/bootboot/dist/bootbootcb.elf: $(MAKE) -C payloads/external/BOOTBOOT all + +# skiboot + +payloads/external/skiboot/build/skiboot.elf: + $(MAKE) -C payloads/external/skiboot all \ + CONFIG_SKIBOOT_GIT_REPO=$(CONFIG_SKIBOOT_GIT_REPO) \ + CONFIG_SKIBOOT_REVISION=$(CONFIG_SKIBOOT_REVISION) diff --git a/payloads/external/skiboot/Kconfig b/payloads/external/skiboot/Kconfig new file mode 100644 index 000000000000..3198358ecbae --- /dev/null +++ b/payloads/external/skiboot/Kconfig @@ -0,0 +1,21 @@ +## SPDX-License-Identifier: GPL-2.0-only + +if PAYLOAD_SKIBOOT + +config PAYLOAD_FILE + default "payloads/external/skiboot/build/skiboot.elf" + +config SKIBOOT_GIT_REPO + string "Git repository of skiboot payload" + default "https://github.com/open-power/skiboot" + help + Git repository which will be used to clone skiboot. + +config SKIBOOT_REVISION + string "Revision of skiboot payload" + default "d93ddbd39b4eeac0bc11dacbdadea76df2996c13" if BOARD_EMULATION_QEMU_POWER9 + help + Revision, that skiboot repository will be checked out to, before building + an image. + +endif # PAYLOAD_SKIBOOT diff --git a/payloads/external/skiboot/Kconfig.name b/payloads/external/skiboot/Kconfig.name new file mode 100644 index 000000000000..92d47e178267 --- /dev/null +++ b/payloads/external/skiboot/Kconfig.name @@ -0,0 +1,8 @@ +## SPDX-License-Identifier: GPL-2.0-only + +config PAYLOAD_SKIBOOT + bool "skiboot" + depends on ARCH_PPC64 + help + Select this option if you want to build a coreboot image + with a skiboot payload. diff --git a/payloads/external/skiboot/Makefile b/payloads/external/skiboot/Makefile new file mode 100644 index 000000000000..5cf630ea2546 --- /dev/null +++ b/payloads/external/skiboot/Makefile @@ -0,0 +1,36 @@ +## SPDX-License-Identifier: GPL-2.0-only + +build_dir=$(CURDIR)/build +skiboot_dir=$(CURDIR)/skiboot +skiboot_git_repo=$(CONFIG_SKIBOOT_GIT_REPO) +skiboot_revision=$(CONFIG_SKIBOOT_REVISION) +skiboot_elf=$(build_dir)/skiboot.elf +skiboot_cross=$(or $(CROSS),powerpc64-linux-gnu-) + +unexport $(COREBOOT_EXPORTS) + +.PHONY: all clean distclean + +all: $(skiboot_elf) + +$(skiboot_elf): | $(skiboot_dir) $(build_dir) + +$(MAKE) -C $(skiboot_dir) CROSS="$(skiboot_cross)" + cp $(skiboot_dir)/skiboot.elf $@ + # skiboot is always built with debug information due to unconditional -ggdb + $(skiboot_cross)strip $@ + +$(skiboot_dir): + git clone $(skiboot_git_repo) $(skiboot_dir) + git -C $(skiboot_dir) checkout $(skiboot_revision) + +$(build_dir): + mkdir -p $(build_dir) + +distclean: clean + rm -rf $(skiboot_dir) + +clean: + # Redefine RM because it's used like `$(RM) non-existent-file` + # Also ignore useless messages about removing test files + [ ! -d $(skiboot_dir) ] || $(MAKE) -C $(skiboot_dir) RM="rm -rf" clean > /dev/null + rm -rf $(build_dir) -- cgit v1.2.3