Browse Source

Platform/RPi: Move away from AcpiPlatformDxe for loading ACPI tables

Move away from AcpiPlatformDxe for loading ACPI tables. Instead, use
ConfigDxe. This will allow selective loading/patching to enable
different SBBR/EBBR profiles.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Andrei Warkentin 4 years ago
parent
commit
cd6474cbed

+ 12 - 0
Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c

@@ -8,6 +8,7 @@
  **/
 
 #include <Uefi.h>
+#include <Library/AcpiLib.h>
 #include <Library/HiiLib.h>
 #include <Library/DebugLib.h>
 #include <Library/IoLib.h>
@@ -26,6 +27,14 @@ extern UINT8 ConfigDxeStrings[];
 
 STATIC RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol;
 
+/*
+ * The GUID inside Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf and
+ * Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf _must_ match below.
+ */
+STATIC CONST EFI_GUID mAcpiTableFile = {
+  0x7E374E25, 0x8E01, 0x4FEE, { 0x87, 0xf2, 0x39, 0x0C, 0x23, 0xC6, 0x06, 0xCD }
+};
+
 typedef struct {
   VENDOR_DEVICE_PATH VendorDevicePath;
   EFI_DEVICE_PATH_PROTOCOL End;
@@ -408,5 +417,8 @@ ConfigInitialize (
     DEBUG ((DEBUG_ERROR, "Couldn't install ConfigDxe configuration pages: %r\n", Status));
   }
 
+  Status = LocateAndInstallAcpiFromFv (&mAcpiTableFile);
+  ASSERT_EFI_ERROR (Status);
+
   return EFI_SUCCESS;
 }

+ 2 - 0
Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf

@@ -35,6 +35,7 @@
   MdeModulePkg/MdeModulePkg.dec
   Silicon/Broadcom/Bcm283x/Bcm283x.dec
   Platform/RaspberryPi/RaspberryPi.dec
+  EmbeddedPkg/EmbeddedPkg.dec
 
 [LibraryClasses]
   BaseLib
@@ -46,6 +47,7 @@
   UefiDriverEntryPoint
   HiiLib
   GpioLib
+  AcpiLib
 
 [Guids]
   gConfigDxeFormSetGuid

+ 1 - 1
Platform/RaspberryPi/RPi3/RPi3.dsc

@@ -346,6 +346,7 @@
   PlatformBootManagerLib|Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
   CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
+  AcpiLib|EmbeddedPkg/Library/AcpiLib/AcpiLib.inf
 
 [LibraryClasses.common.UEFI_DRIVER]
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
@@ -548,7 +549,6 @@
   # ACPI Support
   #
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
   Platform/RaspberryPi/AcpiTables/AcpiTables.inf
 

+ 0 - 1
Platform/RaspberryPi/RPi3/RPi3.fdf

@@ -240,7 +240,6 @@ READ_LOCK_STATUS   = TRUE
   # ACPI Support
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
   INF RuleOverride = ACPITABLE Platform/RaspberryPi/AcpiTables/AcpiTables.inf
 

+ 1 - 1
Platform/RaspberryPi/RPi4/RPi4.dsc

@@ -369,6 +369,7 @@
   PlatformBootManagerLib|Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
   CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
+  AcpiLib|EmbeddedPkg/Library/AcpiLib/AcpiLib.inf
 
 [LibraryClasses.common.UEFI_DRIVER]
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
@@ -588,7 +589,6 @@
   # ACPI Support
   #
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
   Platform/RaspberryPi/AcpiTables/AcpiTables.inf
 

+ 0 - 1
Platform/RaspberryPi/RPi4/RPi4.fdf

@@ -236,7 +236,6 @@ READ_LOCK_STATUS   = TRUE
   # ACPI Support
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
   INF RuleOverride = ACPITABLE Platform/RaspberryPi/AcpiTables/AcpiTables.inf