public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pete Batard" <pete@akeo.ie>
To: devel@edk2.groups.io
Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com,
	awarkentin@vmware.com
Subject: [edk2-platforms][PATCH 4/6] Platform/RPi/AcpiTables: Clean up ACPI IDs
Date: Thu, 26 Mar 2020 11:53:20 +0000	[thread overview]
Message-ID: <20200326115322.2880-5-pete@akeo.ie> (raw)
In-Reply-To: <20200326115322.2880-1-pete@akeo.ie>

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@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


  parent reply	other threads:[~2020-03-26 11:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 11:53 [edk2-platforms][PATCH 0/6] Platforms/RPi/AcpiTables: ACPI platform improvements Pete Batard
2020-03-26 11:53 ` [edk2-platforms][PATCH 1/6] Platform/RPi/AcpiTables: Fix Pi 4 interrupts values Pete Batard
2020-03-26 11:53 ` [edk2-platforms][PATCH 2/6] Platform/RPi/AcpiTables: Replace VendorLong () blobs with PinFunction () Pete Batard
2020-03-26 11:53 ` [edk2-platforms][PATCH 3/6] Platform/RPi/AcpiTables: Use PCDs in MADT Pete Batard
2020-03-26 11:53 ` Pete Batard [this message]
2020-03-26 11:53 ` [edk2-platforms][PATCH 5/6] Platform/RPi/AcpiTables: Move GPU devices into a separate ASL file Pete Batard
2020-03-26 11:53 ` [edk2-platforms][PATCH 6/6] Platform/RPi/AcpiTables: Describe DMA constraints for devices behind GPU Pete Batard
2020-03-26 14:06 ` [edk2-platforms][PATCH 0/6] Platforms/RPi/AcpiTables: ACPI platform improvements Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200326115322.2880-5-pete@akeo.ie \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox