[edk2-devel] [edk2-platforms][PATCH 4/6] Platform/RPi/AcpiTables: Clean up ACPI IDs

Pete Batard pete at akeo.ie
Thu Mar 26 11:53:20 UTC 2020


Only apply the "BC2836" override to the one table that needs it for
Pi 3, instead of setting it globally.
Use more appropriate OEM and Vendor IDs for hardware that is
produced by the Raspberry Pi Foundation.
Ensure that the Pi 3 and Pi 4 have different OEM IDs.
Additionally fix a comment typo (MEMORY32SETBASE -> MEMORY32FIXED).

Signed-off-by: Pete Batard <pete at akeo.ie>
---
 Platform/RaspberryPi/AcpiTables/AcpiTables.h | 22 ++++++++++----------
 Platform/RaspberryPi/AcpiTables/Dsdt.asl     |  2 +-
 Platform/RaspberryPi/AcpiTables/Fadt.aslc    | 10 +++++++++
 3 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.h b/Platform/RaspberryPi/AcpiTables/AcpiTables.h
index 712a4a5806ae..dfae763d8107 100644
--- a/Platform/RaspberryPi/AcpiTables/AcpiTables.h
+++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.h
@@ -16,25 +16,25 @@
 
 #include <IndustryStandard/Acpi.h>
 
-// The ASL compiler can't perform arithmetic on MEMORY32SETBASE ()
-// parameters so you can't pass a constant like BASE + OFFSET (the
-// compiler just silently sets it to zero). So we need a macro that
-// can perform arithmetic base address update with an offset.
+// The ASL compiler can't perform arithmetic on MEMORY32FIXED ()
+// parameters so you can't pass a constant like BASE + OFFSET.
+// We therefore define a macro that can perform arithmetic base
+// address update with an offset.
 #define MEMORY32SETBASE(BufName, MemName, VarName, Offset)       \
     CreateDwordField (^BufName, ^MemName._BAS, VarName)          \
     Add (BCM2836_SOC_REGISTERS, Offset, VarName)
 
+#define EFI_ACPI_OEM_ID                       {'R','P','I','F','D','N'}
 #if (RPI_MODEL == 3)
-#define EFI_ACPI_OEM_ID                       {'B','C','2','8','3','6'}
-#else
-#define EFI_ACPI_OEM_ID                       {'M','C','R','S','F','T'}
+#define EFI_ACPI_OEM_TABLE_ID                 SIGNATURE_64 ('R','P','I','3',' ',' ',' ',' ')
+#elif (RPI_MODEL == 4)
+#define EFI_ACPI_OEM_TABLE_ID                 SIGNATURE_64 ('R','P','I','4',' ',' ',' ',' ')
 #endif
-#define EFI_ACPI_OEM_TABLE_ID                 SIGNATURE_64 ('R','P','I','_','E','D','K','2')
-#define EFI_ACPI_OEM_REVISION                 0x00000100
+#define EFI_ACPI_OEM_REVISION                 0x00000200
 #define EFI_ACPI_CREATOR_ID                   SIGNATURE_32 ('E','D','K','2')
-#define EFI_ACPI_CREATOR_REVISION             0x00000100
+#define EFI_ACPI_CREATOR_REVISION             0x00000200
 
-#define EFI_ACPI_VENDOR_ID                    SIGNATURE_32 ('M','S','F','T')
+#define EFI_ACPI_VENDOR_ID                    SIGNATURE_32 ('R','P','I','F')
 
 // A macro to initialise the common header part of EFI ACPI tables as defined by
 // EFI_ACPI_DESCRIPTION_HEADER structure.
diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryPi/AcpiTables/Dsdt.asl
index 2e63091cdba0..1ca55ff12e35 100644
--- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl
+++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl
@@ -25,7 +25,7 @@
 #define BCM_ALT4 0x3
 #define BCM_ALT5 0x2
 
-DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2)
+DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI", 2)
 {
   Scope (\_SB_)
   {
diff --git a/Platform/RaspberryPi/AcpiTables/Fadt.aslc b/Platform/RaspberryPi/AcpiTables/Fadt.aslc
index ebf58fb7fc3c..3e3d68703298 100644
--- a/Platform/RaspberryPi/AcpiTables/Fadt.aslc
+++ b/Platform/RaspberryPi/AcpiTables/Fadt.aslc
@@ -16,6 +16,16 @@
 
 #include "AcpiTables.h"
 
+/*
+ * Windows 10 on the Raspberry Pi 3 requires a specific OEM Id for FADT.
+ * We replace the one that was defined in "AcpiTables.h", so that it is
+ * picked by the ACPI_HEADER () macro.
+ */
+#if (RPI_MODEL == 3)
+#undef  EFI_ACPI_OEM_ID
+#define EFI_ACPI_OEM_ID         {'B','C','2','8','3','6'}
+#endif
+
 /*
  * Note: Use ACPI 5.1 since we need to match MADT ACPI requirements
  */
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56398): https://edk2.groups.io/g/devel/message/56398
Mute This Topic: https://groups.io/mt/72561826/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list