[coreboot-gerrit] Patch set updated for coreboot: payloads/external/tianocore: Update to build uefi corebootpayload

Philipp Deppenwiese (zaolin.daisuki@gmail.com) gerrit at coreboot.org
Mon Jan 16 22:28:45 CET 2017


Philipp Deppenwiese (zaolin.daisuki at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15057

-gerrit

commit 01e139679f090bc35850dbc2b80ebd2eee2f5dec
Author: Martin Roth <martinroth at google.com>
Date:   Thu Jun 2 16:42:29 2016 -0600

    payloads/external/tianocore: Update to build uefi corebootpayload
    
    Update the existing tianocore payload (which didn't do any more than
    adding an elf payload with a specific name) to fetch and build the
    UEFI corebootPayloadPackage
    
    Issues to debug:
    - Currently using the host compiler instead of the coreboot cross-
    compiler.  If the cross-compiler is used, the resulting binary does
    not run.
    - The IA32 X64 package isn't working.  The stable version picked here
    builds and starts to boot but the shell fails to load.  The
    origin/master version in the Tianocore repo doesn't build.
    - The debug build of the "stable version" fails at an assert in the
    RTC code.
    
    Change-Id: I9719ca5c39fccb856dfe096d449760a937d51fd1
    Signed-off-by: Martin Roth <martinroth at google.com>
    Signed-off-by: Philipp Deppenwiese <zaolin at das-labor.org>
---
 .gitignore                                 |   1 +
 payloads/Makefile.inc                      |   3 +-
 payloads/external/Makefile.inc             |  12 +++-
 payloads/external/tianocore/Kconfig        |  49 ++++++++++++-
 payloads/external/tianocore/Kconfig.name   |   4 +-
 payloads/external/tianocore/Makefile       | 108 +++++++++++++++++++++++++++++
 payloads/external/tianocore/edk2-pci.patch |  63 +++++++++++++++++
 7 files changed, 234 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index df7bff4..c771d4c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@ payloads/external/depthcharge/depthcharge/
 payloads/external/FILO/filo/
 payloads/external/GRUB2/grub2/
 payloads/external/SeaBIOS/seabios/
+payloads/external/tianocore/tianocore/
 payloads/external/U-Boot/u-boot/
 payloads/external/Memtest86Plus/memtest86plus/
 payloads/external/iPXE/ipxe/
diff --git a/payloads/Makefile.inc b/payloads/Makefile.inc
index 2d7edb6..63a2a45 100644
--- a/payloads/Makefile.inc
+++ b/payloads/Makefile.inc
@@ -30,7 +30,8 @@ payloads/external/SeaBIOS \
 payloads/external/U-Boot \
 payloads/external/Memtest86Plus \
 payloads/external/iPXE \
-payloads/external/tint
+payloads/external/tint \
+payloads/external/tianocore
 
 payloads/coreinfo/build/coreinfo.elf coreinfo:
 	$(MAKE) -C payloads/coreinfo defaultbuild
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc
index 29163d0..d59f5ba 100644
--- a/payloads/external/Makefile.inc
+++ b/payloads/external/Makefile.inc
@@ -107,7 +107,17 @@ payloads/external/depthcharge/depthcharge/build/depthcharge.elf depthcharge: $(D
 		BOARD=$(call ws_to_under,$(call strip_quotes,$(call tolower,$(CONFIG_MAINBOARD_PART_NUMBER)))) \
 		MFLAGS= MAKEFLAGS=
 
-# FILO
+payloads/external/tianocore/tianocore/Build/UEFIPAYLOAD.fd tianocore: $(DOTCONFIG)
+	$(MAKE) -C payloads/external/tianocore all \
+		HOSTCC="$(HOSTCC)" \
+		CC="$(HOSTCC)" \
+		CONFIG_TIANOCORE_MASTER=$(CONFIG_TIANOCORE_MASTER) \
+		CONFIG_TIANOCORE_STABLE=$(CONFIG_TIANOCORE_STABLE) \
+		CONFIG_TIANOCORE_REVISION=$(CONFIG_TIANOCORE_REVISION) \
+		CONFIG_TIANOCORE_REVISION_ID=$(CONFIG_TIANOCORE_REVISION_ID) \
+		CONFIG_TIANOCORE_DEBUG=$(CONFIG_TIANOCORE_DEBUG) \
+		CONFIG_TIANOCORE_TARGET_IA32=$(CONFIG_TIANOCORE_TARGET_IA32) \
+		MFLAGS= MAKEFLAGS=
 
 filo:
 	$(MAKE) -C payloads/external/FILO \
diff --git a/payloads/external/tianocore/Kconfig b/payloads/external/tianocore/Kconfig
index 8a98bd3..ab53efd 100644
--- a/payloads/external/tianocore/Kconfig
+++ b/payloads/external/tianocore/Kconfig
@@ -1,9 +1,54 @@
 if PAYLOAD_TIANOCORE
 
 config PAYLOAD_FILE
-	string "Tianocore firmware volume"
-	default "COREBOOT.fd"
+	string "Tianocore binary"
+	default "payloads/external/tianocore/tianocore/Build/UEFIPAYLOAD.fd"
 	help
 	  The result of a corebootPkg build
 
+choice
+	prompt "Tianocore version"
+	default TIANOCORE_STABLE
+
+config TIANOCORE_STABLE
+	bool "stable"
+	help
+	  Stable TianoCore version
+
+config TIANOCORE_MASTER
+	bool "master"
+	help
+	  Newest Tianocore version
+
+config TIANOCORE_REVISION
+	bool "git revision"
+	help
+	  Select this option if you have a specific commit or branch
+	  that you want to use as the revision from which to
+	  build Tianocore.
+
+	  You will be able to specify the name of a branch or a commit id
+	  later.
+
+endchoice
+
+config TIANOCORE_REVISION_ID
+	string "Insert a commit's SHA-1 or a branch name"
+	depends on TIANOCORE_REVISION
+	default "origin/master"
+	help
+	   The commit's SHA-1 or branch name of the revision to use.
+
+config TIANOCORE_TARGET_IA32
+	bool "Restrict Tianocore target architecture to IA32"
+	help
+	  By default, the Tianocore coreboot Payload Package binary will be
+	  built for both X64 and IA32 architectures.  By selecting this option,
+	  the target architecture can be restricted to only IA32.
+
+config TIANOCORE_DEBUG
+	bool "Generate Tianocore debug build"
+	help
+	  Generate a debug build instead of a release build.
+
 endif
diff --git a/payloads/external/tianocore/Kconfig.name b/payloads/external/tianocore/Kconfig.name
index d57f7e1..d394a9e 100644
--- a/payloads/external/tianocore/Kconfig.name
+++ b/payloads/external/tianocore/Kconfig.name
@@ -1,8 +1,8 @@
 config PAYLOAD_TIANOCORE
-	bool "Tiano Core"
+	bool "Tianocore coreboot payload package"
 	help
 	  Select this option if you want to build a coreboot image
-	  with a Tiano Core payload. If you don't know what this is
+	  with a Tianocore payload. If you don't know what this is
 	  about, just leave it enabled.
 
 	  See http://coreboot.org/Payloads for more information.
diff --git a/payloads/external/tianocore/Makefile b/payloads/external/tianocore/Makefile
new file mode 100644
index 0000000..b950e09
--- /dev/null
+++ b/payloads/external/tianocore/Makefile
@@ -0,0 +1,108 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2016 Google Inc.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+
+# force the shell to bash - the edksetup.sh script doesn't work with dash
+export SHELL := env bash
+
+STABLE_COMMIT_ID=13a50a6fe1dcfa6600c38456ee24e0f9ecf51b5f
+TAG-$(CONFIG_TIANOCORE_MASTER)=origin/master
+TAG-$(CONFIG_TIANOCORE_STABLE)=$(STABLE_COMMIT_ID)
+
+project_name=Tianocore
+project_dir=$(CURDIR)/tianocore
+project_git_repo=https://github.com/tianocore/edk2
+
+export EDK_TOOLS_PATH=$(project_dir)/BaseTools
+
+ifeq ($(CONFIG_TIANOCORE_DEBUG),y)
+BUILD_TYPE=DEBUG
+else
+BUILD_TYPE=RELEASE
+endif
+
+all: build
+
+$(project_dir):
+	echo "    Cloning $(project_name) from Git"
+	git clone $(project_git_repo) $(project_dir)
+
+fetch: $(project_dir)
+	cd $(project_dir); \
+		git show $(TAG-y) >/dev/null 2>&1 ; \
+		if [ $$? -ne 0 ] || [ "$(TAG-y)" = "origin/master" ]; then \
+			echo "    Fetching new commits from the $(project_name) repo"; \
+			git fetch; \
+		fi
+
+checkout: fetch
+	echo "    Checking out $(project_name) revision $(TAG-y)"
+	cd  $(project_dir); \
+		git checkout master; \
+		git branch -D coreboot 2>/dev/null; \
+		git checkout -b coreboot $(TAG-y)
+
+checktools:
+	printf "Checking uuid-dev..."
+	echo "#include <uuid/uuid.h>" > libtest.c
+	echo "int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }" >> libtest.c
+	$(HOSTCC) $(HOSTCCFLAGS) libtest.c -o libtest >/dev/null 2>&1 && printf " found uuid-dev.\n" || \
+		( printf " Not found.\n"; echo "ERROR: please_install uuid-dev (uuid-devel)"; exit 1 )
+	rm -rf libtest.c libtest
+	printf "Checking nasm..."
+	type nasm > /dev/null 2>&1 && printf " found nasm.\n" || \
+		( printf " Not found.\n"; echo "Error: Please install nasm."; exit 1 )
+
+patch:
+	echo "Patching edk2..."
+	cd  $(project_dir); \
+		patch --binary -p1 < $(project_dir)/../edk2-pci.patch
+
+config: checkout checktools
+	unset CC; $(MAKE) -C $(project_dir)/BaseTools
+	cd $(project_dir); \
+		export EDK_TOOLS_PATH=$(project_dir)/BaseTools; \
+		export WORKSPACE=$(project_dir); \
+		. ./edksetup.sh BaseTools
+	if [ "$$( $(CC) --version | grep "4\.8")" != "" ]; then \
+		echo "Compatible version of GCC found!"; \
+	else \
+		echo "Could not determine compatible GCC version. You need to install GCC 4.8!"; \
+		exit 1; \
+	fi
+
+build: config patch
+	echo "    build       $(project_name) $(TAG-y)"
+ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
+	cd $(project_dir); \
+		export EDK_TOOLS_PATH=$(project_dir)/BaseTools; \
+		export WORKSPACE=$(project_dir); \
+		. ./edksetup.sh BaseTools; \
+		build -a IA32 -t GCC48 -p CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc -b $(BUILD_TYPE)
+else
+	cd $(project_dir); \
+		export EDK_TOOLS_PATH=$(project_dir)/BaseTools; \
+		export WORKSPACE=$(project_dir); \
+		. ./edksetup.sh BaseTools; \
+		build -a IA32 -a X64 -t GCC48 -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc -b $(BUILD_TYPE)
+endif
+	mv $(project_dir)/Build/CorebootPayloadPkg*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd
+
+clean:
+	test -d $(project_dir) && (cd $(project_dir); rm -rf Build) || exit 0
+
+distclean:
+	rm -rf $(project_dir)
+
+.PHONY: all fetch checkout checktools patch config build clean distclean
diff --git a/payloads/external/tianocore/edk2-pci.patch b/payloads/external/tianocore/edk2-pci.patch
new file mode 100644
index 0000000..ee63666
--- /dev/null
+++ b/payloads/external/tianocore/edk2-pci.patch
@@ -0,0 +1,63 @@
+commit eac8d08f59613c1905202bf9a24974472c813c83
+Author: Matt Devo <matt.devillier at gmail.com>
+Date:   Mon Jan 16 13:31:33 2017 -0600
+
+    CorebootPayloadPkg: use PciNoEnumeration from DuetPkg
+    
+    Use PciRootBridgeNoEnumeration/PciBusNoEnumeration from DuetPkg
+    since the MdeModulePkg PCI init is broken, and unnecessary since
+    coreboot has already setup all PCI devices
+    
+    Signed-off-by: Matt Devo <matt.devillier at gmail.com>
+
+diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.fdf b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
+index 303e626842..7a601dd067 100644
+--- a/CorebootPayloadPkg/CorebootPayloadPkg.fdf
++++ b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
+@@ -124,8 +124,8 @@ INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
+ #
+ # PCI Support
+ #
+-INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+-INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
++INF DuetPkg//PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf
++INF DuetPkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf
+ 
+ #
+ # ISA Support
+diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+index cdfcb75b59..26609bc184 100644
+--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
++++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+@@ -450,11 +450,8 @@
+   #
+   # PCI Support
+   #
+-  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+-  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
+-    <LibraryClasses>
+-      PciHostBridgeLib|CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
+-  }
++  DuetPkg//PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf
++  DuetPkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf
+ 
+   #
+   # SCSI/ATA/IDE/DISK Support
+diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+index 6b16af63ba..68e5d63299 100644
+--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
++++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+@@ -451,11 +451,8 @@
+   #
+   # PCI Support
+   #
+-  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+-  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
+-    <LibraryClasses>
+-      PciHostBridgeLib|CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
+-  }
++  DuetPkg//PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf
++  DuetPkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf
+ 
+   #
+   # SCSI/ATA/IDE/DISK Support



More information about the coreboot-gerrit mailing list