From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.groups.io with SMTP id smtpd.web12.35117.1585223620676884260 for ; Thu, 26 Mar 2020 04:53:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=Md7nFAZA; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.208.48, mailfrom: pete@akeo.ie) Received: by mail-ed1-f48.google.com with SMTP id cw6so5741580edb.9 for ; Thu, 26 Mar 2020 04:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FiwJHWDJKRw1OrVKszAGrevyghs5O3dUiW6SC9wUy+s=; b=Md7nFAZACf8UPmTaBbXG+G/Cx1rIJjsUaYzTauoTjkqnW9HaCOvK4t3Bt2mBZ++exH cUjbn0v2edRGCj/HTHnB5T7Qv1/b7hQnFElkk4percJlygnM3Sa3KWO/9/hXoIcsZacE zzeOgUFw/w4XWiSjzJmoW4DlytJDaAriVg2c6OmSkjVp9f4SPjrdwbx81HzqGwnE/YTs kGh5deu0te9lVoIWt4Jku9X7Wre0D3U7HWqDkpy7EajxohRJ47LasomUgl9B/HKsipWm 2rFc7lnakCyRGsWNLSET0NMXXYnyQ21XQ+EDWNz/tpUXe+dnHouKQAT0GKKl3q5hk3U/ o41w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FiwJHWDJKRw1OrVKszAGrevyghs5O3dUiW6SC9wUy+s=; b=E20NhIBVQoVn9xN0e40GDTUjDhI3yOjLZwIVbxrSwmH5SxLohN5HZFAazVlD0Ylm/2 1JEH7PkEHAjOlxZdzUwZg00uvj2yhPh7TU8Hy0G9qPlpQSDxQTTO4oCZ6rQhVIE7NdXH W+KIr9WMS6CpNriJfG0jwQphdtgk1oU/eX6+Ni9goDmw8j6dGo9s7tGkMjW1CfASQfmi nAj76tPJu+HDunxBYOhtsexGFaEz4hOyI8/vAdA1dfQIYDGe36hldm219DdjZe2ueiG7 2MyFyrqVGq3GrJD0xzou6Y/es58ZD9POugmjKN6kl8KnAyz7FoIV9tmZM572X31Nu/m1 rpZg== X-Gm-Message-State: ANhLgQ23i36EGStVWC83P+o/zbUSEoRwo7zDx2WfquKswIB7b7NVNbTX bLLDWQi9fGiHUEopw094LrGQ7ewhR8dhVg== X-Google-Smtp-Source: ADFU+vvXTL2pggfGy7MGfC+f4qDqlYv8BjTkFxQ9WduEMfWjuHakh/qSOIAK8lViEG2Xm1v5lcl5NQ== X-Received: by 2002:a17:907:262a:: with SMTP id aq10mr7190482ejc.377.1585223618628; Thu, 26 Mar 2020 04:53:38 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([84.203.78.33]) by smtp.gmail.com with ESMTPSA id bs8sm240534ejb.92.2020.03.26.04.53.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 04:53:38 -0700 (PDT) From: "Pete Batard" 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 Message-Id: <20200326115322.2880-5-pete@akeo.ie> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200326115322.2880-1-pete@akeo.ie> References: <20200326115322.2880-1-pete@akeo.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 -// 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