payloads/external/tianocore: Add and apply patches for tianocore

Create a directory patches, and add necessary patches to be applied to
upstream tianocore.

Patches include:
-Patch for no PCI address enumeration
-Patches to enable keyboard input
-Patch to disable serial to speed up boot process.

Patches pulled from https://github.com/MattDevo/edk2.

Additionally, modify tianocore Makefile to apply patches during build.

Change-Id: I4eaa602418995a68753b1ed13af8c6374eaa312f
Signed-off-by: Evelyn Huang <evhuang@google.com>
Reviewed-on: https://review.coreboot.org/20639
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Evelyn Huang 2017-06-26 13:36:57 -06:00 committed by Martin Roth
parent 6c9c196f1c
commit 285f9f2fe3
6 changed files with 2803 additions and 0 deletions

View File

@ -61,6 +61,12 @@ $(project_dir)/.version_$(TAG-y): fetch
git checkout master; \
git branch -D coreboot 2>/dev/null; \
git checkout -b coreboot $(TAG-y); \
for patch in $(CURDIR)/patches/*.patch; do \
echo "Applying $$patch"; \
cd $(project_dir); \
git am --keep-cr $$patch || \
( echo " Error when applying patches.\n"; git am --abort; exit 1; ); \
done; \
if ! [ "$(TAG-y)" = "origin/master" ] ; then \
touch $(project_dir)/.version_$(STABLE_COMMIT_ID); \
fi; \

View File

@ -0,0 +1,65 @@
From 4f9d41e69356ce7486b0c74a754ff494256723de Mon Sep 17 00:00:00 2001
From: CoolStar <coolstarorganization@gmail.com>
Date: Sun, 4 Dec 2016 11:23:38 -0800
Subject: [PATCH] PCI: use Duet's PciNoEnumeration
---
CorebootPayloadPkg/CorebootPayloadPkg.fdf | 4 ++--
CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc | 7 ++-----
CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 7 ++-----
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.fdf b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
index 303e626842..a39e3999ba 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..e838aca61d 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..c25d821fd4 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
--
2.13.2.725.g09c95d1e9-goog

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,86 @@
From 760f1cafdd689beedc8418ab89e856b54296389c Mon Sep 17 00:00:00 2001
From: CoolStar <coolstarorganization@gmail.com>
Date: Sun, 4 Dec 2016 12:07:30 -0800
Subject: [PATCH] CorebootBdsLib: Call End of DXE event to allow booting 3rd
party efi binaries.
---
.../Library/CorebootBdsLib/BdsPlatform.c | 42 ++++++++++++++++++++++
.../Library/CorebootBdsLib/PlatformBds.inf | 1 +
2 files changed, 43 insertions(+)
diff --git a/CorebootModulePkg/Library/CorebootBdsLib/BdsPlatform.c b/CorebootModulePkg/Library/CorebootBdsLib/BdsPlatform.c
index b6253a17f8..cf3e5320cb 100644
--- a/CorebootModulePkg/Library/CorebootBdsLib/BdsPlatform.c
+++ b/CorebootModulePkg/Library/CorebootBdsLib/BdsPlatform.c
@@ -1129,6 +1129,46 @@ Returns:
Status = BaseMemoryTest (MemoryTestLevel);
}
+VOID
+EFIAPI
+InternalBdsEmptyCallbackFuntion (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ return;
+}
+
+VOID
+InstallReadyToLock (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ EFI_EVENT EndOfDxeEvent;
+
+ DEBUG((DEBUG_INFO,"InstallReadyToLock entering......\n"));
+ //
+ // Inform the SMM infrastructure that we're entering BDS and may run 3rd party code hereafter
+ // Since PI1.2.1, we need signal EndOfDxe as ExitPmAuth
+ //
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ InternalBdsEmptyCallbackFuntion,
+ NULL,
+ &gEfiEndOfDxeEventGroupGuid,
+ &EndOfDxeEvent
+ );
+ ASSERT_EFI_ERROR (Status);
+ gBS->SignalEvent (EndOfDxeEvent);
+ gBS->CloseEvent (EndOfDxeEvent);
+ DEBUG((DEBUG_INFO,"All EndOfDxe callbacks have returned successfully\n"));
+
+ DEBUG((DEBUG_INFO,"InstallReadyToLock end\n"));
+ return;
+}
+
VOID
EFIAPI
PlatformBdsPolicyBehavior (
@@ -1164,6 +1204,8 @@ Returns:
EFI_INPUT_KEY Key;
EFI_BOOT_MODE BootMode;
+ InstallReadyToLock();
+
//
// Init the time out value
//
diff --git a/CorebootModulePkg/Library/CorebootBdsLib/PlatformBds.inf b/CorebootModulePkg/Library/CorebootBdsLib/PlatformBds.inf
index 578c74afae..992bd846bd 100644
--- a/CorebootModulePkg/Library/CorebootBdsLib/PlatformBds.inf
+++ b/CorebootModulePkg/Library/CorebootBdsLib/PlatformBds.inf
@@ -58,6 +58,7 @@
gEfiSmbiosTableGuid
gEfiAcpiTableGuid
gLdrMemoryDescriptorGuid
+ gEfiEndOfDxeEventGroupGuid
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
--
2.13.2.725.g09c95d1e9-goog

View File

@ -0,0 +1,56 @@
From 77c5dfcce842819215490fe63c481860fa7d752d Mon Sep 17 00:00:00 2001
From: CoolStar <coolstarorganization@gmail.com>
Date: Sun, 4 Dec 2016 11:50:00 -0800
Subject: [PATCH] CorebootPayloadPkg: Add PS/2 keyboard drivers.
---
CorebootPayloadPkg/CorebootPayloadPkg.fdf | 3 +++
CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc | 3 +++
CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 3 +++
3 files changed, 9 insertions(+)
diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.fdf b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
index 347e9c75ce..a347af0c9a 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkg.fdf
+++ b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
@@ -132,6 +132,9 @@ INF DuetPkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf
# ISA Support
#
INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
+INF PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf
+INF IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf
+INF IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf
#
# Console Support
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index 5ce823bb95..60ee064c59 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -492,6 +492,9 @@
# ISA Support
#
MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
+ PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf
+ IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf
+ IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf
#
# Console Support
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
index fea297a77a..167329c897 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
@@ -493,6 +493,9 @@
# ISA Support
#
MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
+ PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf
+ IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf
+ IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf
#
# Console Support
--
2.13.2.725.g09c95d1e9-goog

View File

@ -0,0 +1,39 @@
From 77f75370d6fbfefb04456f6e1c32c85d4bac8bf5 Mon Sep 17 00:00:00 2001
From: Matt Devo <matt.devillier@gmail.com>
Date: Thu, 23 Feb 2017 14:11:14 -0600
Subject: [PATCH] CorebootPayloadPkg: don't use serial output
---
CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc | 2 +-
CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index 1d80fc4f5c..ce360c9e9e 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -261,7 +261,7 @@
#
################################################################################
[PcdsFeatureFlag]
- gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE
+ gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
index 52b26eb3d0..a27b0873a1 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
@@ -261,7 +261,7 @@
#
################################################################################
[PcdsFeatureFlag]
- gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE
+ gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
--
2.13.2.725.g09c95d1e9-goog