This brings this table in line with what we have for Pi 4 and
will enable factorization of ACPI code between the two platforms.
Signed-off-by: Pete Batard <pete@akeo.ie>
---
Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h | 24 ++++++++++++++++----
Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc | 14 ++++++------
2 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h
index 3e68923d3c05..9c76624e4ac8 100644
--- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h
+++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h
@@ -2,6 +2,7 @@
*
* RPi3 defines for constructing ACPI tables
*
+ * Copyright (c) 2019, ARM Ltd. All rights reserved.
* Copyright (c) 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
* Copyright (c) Microsoft Corporation. All rights reserved.
*
@@ -12,7 +13,7 @@
#ifndef __ACPITABLES_H__
#define __ACPITABLES_H__
-#include <IndustryStandard/Acpi50.h>
+#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
@@ -29,6 +30,21 @@
#define EFI_ACPI_CREATOR_REVISION 0x00000097
#define EFI_ACPI_VENDOR_ID SIGNATURE_32 ('M','S','F','T')
+
+// A macro to initialise the common header part of EFI ACPI tables as defined by
+// EFI_ACPI_DESCRIPTION_HEADER structure.
+#define ACPI_HEADER(Signature, Type, Revision) { \
+ Signature, /* UINT32 Signature */ \
+ sizeof (Type), /* UINT32 Length */ \
+ Revision, /* UINT8 Revision */ \
+ 0, /* UINT8 Checksum */ \
+ EFI_ACPI_OEM_ID, /* UINT8 OemId[6] */ \
+ EFI_ACPI_OEM_TABLE_ID, /* UINT64 OemTableId */ \
+ EFI_ACPI_OEM_REVISION, /* UINT32 OemRevision */ \
+ EFI_ACPI_CREATOR_ID, /* UINT32 CreatorId */ \
+ EFI_ACPI_CREATOR_REVISION /* UINT32 CreatorRevision */ \
+ }
+
#define EFI_ACPI_CSRT_REVISION 0x00000005
#define EFI_ACPI_CSRT_DEVICE_ID_DMA 0x00000009 // Fixed id
#define EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP 0x0 // Count up from 0
@@ -36,7 +52,7 @@
#define RPI3_DMA_CHANNEL_COUNT 10 // All 10 DMA channels are listed, including the reserved ones
#define RPI3_DMA_USED_CHANNEL_COUNT 5 // Use 5 DMA channels
-#define EFI_ACPI_5_0_CSRT_REVISION 0x00000000
+#define EFI_ACPI_5_1_CSRT_REVISION 0x00000000
typedef enum
{
@@ -68,7 +84,7 @@ typedef struct
UINT16 Revision; // 2 bytes
UINT16 Reserved; // 2 bytes
UINT32 SharedInfoLength; // 4 bytes
-} EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER;
+} EFI_ACPI_5_1_CSRT_RESOURCE_GROUP_HEADER;
//------------------------------------------------------------------------
// CSRT Resource Descriptor 12 bytes total
@@ -79,6 +95,6 @@ typedef struct
UINT16 ResourceType; // 2 bytes
UINT16 ResourceSubType; // 2 bytes
UINT32 UID; // 4 bytes
-} EFI_ACPI_5_0_CSRT_RESOURCE_DESCRIPTOR_HEADER;
+} EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER;
#endif // __ACPITABLES_H__
diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc b/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc
index 62f1a1fbdf19..0a8393a8076b 100644
--- a/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc
+++ b/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc
@@ -39,7 +39,7 @@ typedef struct
//------------------------------------------------------------------------
typedef struct
{
- EFI_ACPI_5_0_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaControllerHeader;
+ EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaControllerHeader;
DMA_CONTROLLER_VENDOR_DATA ControllerVendorData;
} RD_DMA_CONTROLLER;
@@ -59,7 +59,7 @@ typedef struct
//------------------------------------------------------------------------
typedef struct
{
- EFI_ACPI_5_0_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaChannelHeader;
+ EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaChannelHeader;
DMA_CHANNEL_VENDOR_DATA ChannelVendorData;
} RD_DMA_CHANNEL;
@@ -69,7 +69,7 @@ typedef struct
typedef struct
{
- EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER ResGroupHeader;
+ EFI_ACPI_5_1_CSRT_RESOURCE_GROUP_HEADER ResGroupHeader;
RD_DMA_CONTROLLER DmaController;
RD_DMA_CHANNEL DmaChannels[RPI3_DMA_CHANNEL_COUNT];
} RG_DMA;
@@ -85,17 +85,17 @@ typedef struct
// DMA Resource Group
RG_DMA DmaResourceGroup;
-} EFI_ACPI_5_0_CSRT_TABLE;
+} EFI_ACPI_5_1_CSRT_TABLE;
-EFI_ACPI_5_0_CSRT_TABLE Csrt =
+EFI_ACPI_5_1_CSRT_TABLE Csrt =
{
//------------------------------------------------------------------------
// ACPI Table Header
//------------------------------------------------------------------------
{
- EFI_ACPI_5_0_CORE_SYSTEM_RESOURCE_TABLE_SIGNATURE, // Signature "CSRT"
+ EFI_ACPI_5_1_CORE_SYSTEM_RESOURCE_TABLE_SIGNATURE, // Signature "CSRT"
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + sizeof (RG_DMA), // Length
- EFI_ACPI_5_0_CSRT_REVISION, // Revision
+ EFI_ACPI_5_1_CSRT_REVISION, // Revision
0x00, // Checksum calculated at runtime.
EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field "BC2836"
EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long) "RPI3EDK2"
--
2.21.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#55071): https://edk2.groups.io/g/devel/message/55071
Mute This Topic: https://groups.io/mt/71605846/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-