From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.3455.1616579178012723209 for ; Wed, 24 Mar 2021 02:46:18 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: sunny.wang@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8549F1FB; Wed, 24 Mar 2021 02:46:07 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 93C9E3F718; Wed, 24 Mar 2021 02:46:05 -0700 (PDT) From: "Sunny Wang" To: devel@edk2.groups.io Cc: Sunny Wang , Samer El-Haj-Mahmoud , Sami Mujawar , Jeremy Linton , Pete Batard , Ard Biesheuvel , Sunny Wang Subject: [PATCH v2 1/2] Platform/RaspberryPi: Dynamically build UARTs info in ACPI Date: Wed, 24 Mar 2021 17:45:23 +0800 Message-Id: <20210324094524.184-1-Sunny.Wang@arm.com> X-Mailer: git-send-email 2.31.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Changes:=0D 1. Add code to ConfigDxe driver and AcpiTables module to dynamically=0D build either Mini UART or PL011 UART info in ACPI. This fixes the=0D issue discussed in https://github.com/pftf/RPi4/issues/118.=0D 2. Cleanup by moving duplicate Debug Port 2 table related defines and=0D structures to a newly created header file (RpiDebugPort2Table.h).=0D =0D Testing Done:=0D - Booted to UEFI shell and use acpiview command to check the result of=0D the different UART settings in config.txt (enabling either Mini UART=0D or PL011) and SPCR, DBG2 tables and device BTH0 are dynamically=0D changed as expected.=0D =0D Cc: Samer El-Haj-Mahmoud =0D Cc: Sami Mujawar =0D Cc: Jeremy Linton =0D Cc: Pete Batard =0D Cc: Ard Biesheuvel =0D Signed-off-by: Sunny Wang =0D ---=0D .../RaspberryPi/AcpiTables/AcpiTables.inf | 9 +-=0D .../RaspberryPi/AcpiTables/Dbg2MiniUart.aslc | 82 ++++++++=0D .../AcpiTables/{Dbg2.aslc =3D> Dbg2Pl011.aslc} | 187 ++++++++---------=0D .../RaspberryPi/AcpiTables/SpcrMiniUart.aslc | 92 +++++++++=0D .../AcpiTables/{Spcr.aslc =3D> SpcrPl011.aslc} | 188 +++++++++---------=0D Platform/RaspberryPi/AcpiTables/Uart.asl | 10 +-=0D .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 107 +++++++++-=0D .../IndustryStandard/RpiDebugPort2Table.h | 34 ++++=0D 8 files changed, 497 insertions(+), 212 deletions(-)=0D create mode 100644 Platform/RaspberryPi/AcpiTables/Dbg2MiniUart.aslc=0D rename Platform/RaspberryPi/AcpiTables/{Dbg2.aslc =3D> Dbg2Pl011.aslc} (72= %)=0D create mode 100644 Platform/RaspberryPi/AcpiTables/SpcrMiniUart.aslc=0D rename Platform/RaspberryPi/AcpiTables/{Spcr.aslc =3D> SpcrPl011.aslc} (87= %)=0D create mode 100644 Platform/RaspberryPi/Include/IndustryStandard/RpiDebugP= ort2Table.h=0D =0D diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf b/Platform/Rasp= berryPi/AcpiTables/AcpiTables.inf=0D index d3363a76a1..fc8e927138 100644=0D --- a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf=0D +++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf=0D @@ -2,7 +2,7 @@=0D #=0D # ACPI table data and ASL sources required to boot the platform.=0D #=0D -# Copyright (c) 2019, ARM Limited. All rights reserved.=0D +# Copyright (c) 2019-2021, ARM Limited. All rights reserved.=0D # Copyright (c) 2017, Andrey Warkentin =0D # Copyright (c) Microsoft Corporation. All rights reserved.=0D #=0D @@ -28,12 +28,14 @@=0D Emmc.asl=0D Madt.aslc=0D Fadt.aslc=0D - Dbg2.aslc=0D + Dbg2MiniUart.aslc=0D + Dbg2Pl011.aslc=0D Gtdt.aslc=0D Iort.aslc=0D Dsdt.asl=0D Csrt.aslc=0D - Spcr.aslc=0D + SpcrMiniUart.aslc=0D + SpcrPl011.aslc=0D Pptt.aslc=0D SsdtThermal.asl=0D =0D @@ -71,3 +73,4 @@=0D =0D [BuildOptions]=0D GCC:*_*_*_ASL_FLAGS =3D -vw3133 -vw3150=0D +=0D diff --git a/Platform/RaspberryPi/AcpiTables/Dbg2MiniUart.aslc b/Platform/R= aspberryPi/AcpiTables/Dbg2MiniUart.aslc=0D new file mode 100644=0D index 0000000000..c83b978731=0D --- /dev/null=0D +++ b/Platform/RaspberryPi/AcpiTables/Dbg2MiniUart.aslc=0D @@ -0,0 +1,82 @@=0D +/** @file=0D + *=0D + * Debug Port Table (DBG2)=0D + *=0D + * Copyright (c) 2019, Pete Batard =0D + * Copyright (c) 2012-2021, ARM Limited. All rights reserved.=0D + *=0D + * SPDX-License-Identifier: BSD-2-Clause-Patent=0D + *=0D + **/=0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +#include "AcpiTables.h"=0D +=0D +#pragma pack(1)=0D +=0D +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_BCM2835_UART=0D +#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_= BASE_ADDRESS=0D +#define RPI_UART_LENGTH BCM2836_MINI_UART_= LENGTH=0D +//=0D +// RPI_UART_STR should match the value used Uart.asl=0D +//=0D +#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'G', 'D', 'V', '0', '.', 'U', 'R', 'T', 'M', 0x00 }=0D +=0D +#define DBG2_DEBUG_PORT_DDI(NumReg, SubType, UartBase, UartAddrLen, UartNa= meStr) { \=0D + { = \=0D + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, /* U= INT8 Revision */ \=0D + sizeof (DBG2_DEBUG_DEVICE_INFORMATION), /* U= INT16 Length */ \=0D + NumReg, /* U= INT8 NumberofGenericAddressRegisters */ \=0D + RPI_DBG2_NAMESPACESTRING_FIELD_SIZE, /* U= INT16 NameSpaceStringLength */ \=0D + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), /* U= INT16 NameSpaceStringOffset */ \=0D + 0, /* U= INT16 OemDataLength */ \=0D + 0, /* U= INT16 OemDataOffset */ \=0D + EFI_ACPI_DBG2_PORT_TYPE_SERIAL, /* U= INT16 Port Type */ \=0D + SubType, /* U= INT16 Port Subtype */ \=0D + {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, /* U= INT8 Reserved[2] */ \=0D + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), /* U= INT16 BaseAddressRegister Offset */ \=0D + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) /* U= INT16 AddressSize Offset */ \=0D + }, = \=0D + ARM_GAS32 (UartBase), /* EFI_ACPI_6_3_GENER= IC_ADDRESS_STRUCTURE BaseAddressRegister */ \=0D + UartAddrLen, /* UINT32 AddressSiz= e */ \=0D + UartNameStr /* UINT8 NameSpaceS= tring[MAX_DBG2_NAME_LEN] */ \=0D + }=0D +=0D +=0D +STATIC DBG2_TABLE Dbg2 =3D {=0D + {=0D + ACPI_HEADER (=0D + EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE,=0D + DBG2_TABLE,=0D + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION=0D + ),=0D + OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo),=0D + RPI_DBG2_NUM_DEBUG_PORTS /* U= INT32 NumberDbgDeviceInfo */=0D + },=0D + {=0D + /*=0D + * Kernel Debug Port=0D + */=0D + DBG2_DEBUG_PORT_DDI (=0D + RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,=0D + RPI_UART_INTERFACE_TYPE,=0D + RPI_UART_BASE_ADDRESS,=0D + RPI_UART_LENGTH,=0D + RPI_UART_STR=0D + ),=0D + }=0D +};=0D +=0D +#pragma pack()=0D +=0D +//=0D +// Reference the table being generated to prevent the optimizer from remov= ing=0D +// the data structure from the executable=0D +//=0D +VOID* CONST ReferenceAcpiTable =3D &Dbg2;=0D +=0D diff --git a/Platform/RaspberryPi/AcpiTables/Dbg2.aslc b/Platform/Raspberry= Pi/AcpiTables/Dbg2Pl011.aslc=0D similarity index 72%=0D rename from Platform/RaspberryPi/AcpiTables/Dbg2.aslc=0D rename to Platform/RaspberryPi/AcpiTables/Dbg2Pl011.aslc=0D index e3f2adae7e..dccfa24601 100644=0D --- a/Platform/RaspberryPi/AcpiTables/Dbg2.aslc=0D +++ b/Platform/RaspberryPi/AcpiTables/Dbg2Pl011.aslc=0D @@ -1,105 +1,82 @@=0D -/** @file=0D - *=0D - * Debug Port Table (DBG2)=0D - *=0D - * Copyright (c) 2019, Pete Batard =0D - * Copyright (c) 2012-2020, ARM Limited. All rights reserved.=0D - *=0D - * SPDX-License-Identifier: BSD-2-Clause-Patent=0D - *=0D - **/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include "AcpiTables.h"=0D -=0D -#pragma pack(1)=0D -=0D -#define RPI_DBG2_NUM_DEBUG_PORTS 1=0D -#define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1=0D -#define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 15=0D -=0D -#if (RPI_MODEL =3D=3D 4)=0D -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_ARM_PL011_UART=0D -#define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART= _BASE_ADDRESS=0D -#define RPI_UART_LENGTH BCM2836_PL011_UART= _LENGTH=0D -#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'G', 'D', 'V', '0', '.', 'U', 'R', 'T', '0', 0x00 }=0D -#else=0D -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_BCM2835_UART=0D -#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_= BASE_ADDRESS=0D -#define RPI_UART_LENGTH BCM2836_MINI_UART_= LENGTH=0D -//=0D -// RPI_UART_STR should match the value used Uart.asl=0D -//=0D -#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'G', 'D', 'V', '0', '.', 'U', 'R', 'T', 'M', 0x00 }=0D -#endif=0D -=0D -typedef struct {=0D - EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device;=0D - EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddressRegiste= r;=0D - UINT32 AddressSize;=0D - UINT8 NameSpaceString[RP= I_DBG2_NAMESPACESTRING_FIELD_SIZE];=0D -} DBG2_DEBUG_DEVICE_INFORMATION;=0D -=0D -typedef struct {=0D - EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description;=0D - DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[RPI= _DBG2_NUM_DEBUG_PORTS];=0D -} DBG2_TABLE;=0D -=0D -=0D -#define DBG2_DEBUG_PORT_DDI(NumReg, SubType, UartBase, UartAddrLen, UartNa= meStr) { \=0D - { = \=0D - EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, /* U= INT8 Revision */ \=0D - sizeof (DBG2_DEBUG_DEVICE_INFORMATION), /* U= INT16 Length */ \=0D - NumReg, /* U= INT8 NumberofGenericAddressRegisters */ \=0D - RPI_DBG2_NAMESPACESTRING_FIELD_SIZE, /* U= INT16 NameSpaceStringLength */ \=0D - OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), /* U= INT16 NameSpaceStringOffset */ \=0D - 0, /* U= INT16 OemDataLength */ \=0D - 0, /* U= INT16 OemDataOffset */ \=0D - EFI_ACPI_DBG2_PORT_TYPE_SERIAL, /* U= INT16 Port Type */ \=0D - SubType, /* U= INT16 Port Subtype */ \=0D - {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, /* U= INT8 Reserved[2] */ \=0D - OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), /* U= INT16 BaseAddressRegister Offset */ \=0D - OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) /* U= INT16 AddressSize Offset */ \=0D - }, = \=0D - ARM_GAS32 (UartBase), /* EFI_ACPI_6_3_GENER= IC_ADDRESS_STRUCTURE BaseAddressRegister */ \=0D - UartAddrLen, /* UINT32 AddressSiz= e */ \=0D - UartNameStr /* UINT8 NameSpaceS= tring[MAX_DBG2_NAME_LEN] */ \=0D - }=0D -=0D -=0D -STATIC DBG2_TABLE Dbg2 =3D {=0D - {=0D - ACPI_HEADER (=0D - EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE,=0D - DBG2_TABLE,=0D - EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION=0D - ),=0D - OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo),=0D - RPI_DBG2_NUM_DEBUG_PORTS /* U= INT32 NumberDbgDeviceInfo */=0D - },=0D - {=0D - /*=0D - * Kernel Debug Port=0D - */=0D - DBG2_DEBUG_PORT_DDI (=0D - RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,=0D - RPI_UART_INTERFACE_TYPE,=0D - RPI_UART_BASE_ADDRESS,=0D - RPI_UART_LENGTH,=0D - RPI_UART_STR=0D - ),=0D - }=0D -};=0D -=0D -#pragma pack()=0D -=0D -//=0D -// Reference the table being generated to prevent the optimizer from remov= ing=0D -// the data structure from the executable=0D -//=0D -VOID* CONST ReferenceAcpiTable =3D &Dbg2;=0D +/** @file=0D + *=0D + * Debug Port Table (DBG2)=0D + *=0D + * Copyright (c) 2019, Pete Batard =0D + * Copyright (c) 2012-2021, ARM Limited. All rights reserved.=0D + *=0D + * SPDX-License-Identifier: BSD-2-Clause-Patent=0D + *=0D + **/=0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +#include "AcpiTables.h"=0D +=0D +#pragma pack(1)=0D +=0D +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_ARM_PL011_UART=0D +#define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART= _BASE_ADDRESS=0D +#define RPI_UART_LENGTH BCM2836_PL011_UART= _LENGTH=0D +//=0D +// RPI_UART_STR should match the value used Uart.asl=0D +//=0D +#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'G', 'D', 'V', '0', '.', 'U', 'R', 'T', '0', 0x00 }=0D +=0D +#define DBG2_DEBUG_PORT_DDI(NumReg, SubType, UartBase, UartAddrLen, UartNa= meStr) { \=0D + { = \=0D + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, /* U= INT8 Revision */ \=0D + sizeof (DBG2_DEBUG_DEVICE_INFORMATION), /* U= INT16 Length */ \=0D + NumReg, /* U= INT8 NumberofGenericAddressRegisters */ \=0D + RPI_DBG2_NAMESPACESTRING_FIELD_SIZE, /* U= INT16 NameSpaceStringLength */ \=0D + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), /* U= INT16 NameSpaceStringOffset */ \=0D + 0, /* U= INT16 OemDataLength */ \=0D + 0, /* U= INT16 OemDataOffset */ \=0D + EFI_ACPI_DBG2_PORT_TYPE_SERIAL, /* U= INT16 Port Type */ \=0D + SubType, /* U= INT16 Port Subtype */ \=0D + {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, /* U= INT8 Reserved[2] */ \=0D + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), /* U= INT16 BaseAddressRegister Offset */ \=0D + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) /* U= INT16 AddressSize Offset */ \=0D + }, = \=0D + ARM_GAS32 (UartBase), /* EFI_ACPI_6_3_GENER= IC_ADDRESS_STRUCTURE BaseAddressRegister */ \=0D + UartAddrLen, /* UINT32 AddressSiz= e */ \=0D + UartNameStr /* UINT8 NameSpaceS= tring[MAX_DBG2_NAME_LEN] */ \=0D + }=0D +=0D +=0D +STATIC DBG2_TABLE Dbg2 =3D {=0D + {=0D + ACPI_HEADER (=0D + EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE,=0D + DBG2_TABLE,=0D + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION=0D + ),=0D + OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo),=0D + RPI_DBG2_NUM_DEBUG_PORTS /* U= INT32 NumberDbgDeviceInfo */=0D + },=0D + {=0D + /*=0D + * Kernel Debug Port=0D + */=0D + DBG2_DEBUG_PORT_DDI (=0D + RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,=0D + RPI_UART_INTERFACE_TYPE,=0D + RPI_UART_BASE_ADDRESS,=0D + RPI_UART_LENGTH,=0D + RPI_UART_STR=0D + ),=0D + }=0D +};=0D +=0D +#pragma pack()=0D +=0D +//=0D +// Reference the table being generated to prevent the optimizer from remov= ing=0D +// the data structure from the executable=0D +//=0D +VOID* CONST ReferenceAcpiTable =3D &Dbg2;=0D +=0D diff --git a/Platform/RaspberryPi/AcpiTables/SpcrMiniUart.aslc b/Platform/R= aspberryPi/AcpiTables/SpcrMiniUart.aslc=0D new file mode 100644=0D index 0000000000..aaf5c5317e=0D --- /dev/null=0D +++ b/Platform/RaspberryPi/AcpiTables/SpcrMiniUart.aslc=0D @@ -0,0 +1,92 @@=0D +/** @file=0D +* SPCR Table=0D +*=0D +* Copyright (c) 2019 Pete Batard =0D +* Copyright (c) 2014-2021, ARM Limited. All rights reserved.=0D +*=0D +* SPDX-License-Identifier: BSD-2-Clause-Patent=0D +*=0D +**/=0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +#include "AcpiTables.h"=0D +=0D +#define RPI_UART_FLOW_CONTROL_NONE 0=0D +=0D +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART=0D +#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_BASE_ADDRES= S=0D +#define RPI_UART_INTERRUPT BCM2836_MINI_UART_INTERRUPT=0D +=0D +STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr =3D {=0D + ACPI_HEADER (=0D + EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION=0D + ),=0D + // UINT8 InterfaceType;=0D + RPI_UART_INTERFACE_TYPE,=0D + // UINT8 Reserved1[3];=0D + {=0D + EFI_ACPI_RESERVED_BYTE,=0D + EFI_ACPI_RESERVED_BYTE,=0D + EFI_ACPI_RESERVED_BYTE=0D + },=0D + // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddress;=0D + ARM_GAS32 (RPI_UART_BASE_ADDRESS),=0D + // UINT8 InterruptType;=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC,=0D + // UINT8 Irq;=0D + 0, // Not used on ARM=0D + // UINT32 GlobalSystemInterrupt;=0D + RPI_UART_INTERRUPT,=0D + // UINT8 BaudRate;=0D +#if (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 9600)=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600,=0D +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 19200)=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200,=0D +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 57600)=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600,=0D +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 115200)=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,=0D +#else=0D +#error Unsupported SPCR Baud Rate=0D +#endif=0D + // UINT8 Parity;=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,=0D + // UINT8 StopBits;=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1,=0D + // UINT8 FlowControl;=0D + RPI_UART_FLOW_CONTROL_NONE,=0D + // UINT8 TerminalType;=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8,=0D + // UINT8 Reserved2;=0D + EFI_ACPI_RESERVED_BYTE,=0D + // UINT16 PciDeviceId;=0D + 0xFFFF,=0D + // UINT16 PciVendorId;=0D + 0xFFFF,=0D + // UINT8 PciBusNumber;=0D + 0x00,=0D + // UINT8 PciDeviceNumber;=0D + 0x00,=0D + // UINT8 PciFunctionNumber;=0D + 0x00,=0D + // UINT32 PciFlags;=0D + 0x00000000,=0D + // UINT8 PciSegment;=0D + 0x00,=0D + // UINT32 Reserved3;=0D + EFI_ACPI_RESERVED_DWORD=0D +};=0D +=0D +//=0D +// Reference the table being generated to prevent the optimizer from remov= ing the=0D +// data structure from the executable=0D +//=0D +VOID* CONST ReferenceAcpiTable =3D &Spcr;=0D +=0D diff --git a/Platform/RaspberryPi/AcpiTables/Spcr.aslc b/Platform/Raspberry= Pi/AcpiTables/SpcrPl011.aslc=0D similarity index 87%=0D rename from Platform/RaspberryPi/AcpiTables/Spcr.aslc=0D rename to Platform/RaspberryPi/AcpiTables/SpcrPl011.aslc=0D index 07df3a718d..5a540adf08 100644=0D --- a/Platform/RaspberryPi/AcpiTables/Spcr.aslc=0D +++ b/Platform/RaspberryPi/AcpiTables/SpcrPl011.aslc=0D @@ -1,97 +1,91 @@=0D -/** @file=0D -* SPCR Table=0D -*=0D -* Copyright (c) 2019 Pete Batard =0D -* Copyright (c) 2014-2016, ARM Limited. All rights reserved.=0D -*=0D -* SPDX-License-Identifier: BSD-2-Clause-Patent=0D -*=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include "AcpiTables.h"=0D -=0D -#define RPI_UART_FLOW_CONTROL_NONE 0=0D -=0D -// Prefer PL011 serial output on the Raspberry Pi 4=0D -#if (RPI_MODEL =3D=3D 4)=0D -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART=0D -#define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRE= SS=0D -#define RPI_UART_INTERRUPT BCM2836_PL011_UART_INTERRUPT= =0D -#else=0D -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART=0D -#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_BASE_ADDRES= S=0D -#define RPI_UART_INTERRUPT BCM2836_MINI_UART_INTERRUPT=0D -#endif=0D -STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr =3D {=0D - ACPI_HEADER (=0D - EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION=0D - ),=0D - // UINT8 InterfaceType;=0D - RPI_UART_INTERFACE_TYPE,=0D - // UINT8 Reserved1[3];=0D - {=0D - EFI_ACPI_RESERVED_BYTE,=0D - EFI_ACPI_RESERVED_BYTE,=0D - EFI_ACPI_RESERVED_BYTE=0D - },=0D - // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddress;=0D - ARM_GAS32 (RPI_UART_BASE_ADDRESS),=0D - // UINT8 InterruptType;=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC,=0D - // UINT8 Irq;=0D - 0, // Not used on ARM=0D - // UINT32 GlobalSystemInterrupt;=0D - RPI_UART_INTERRUPT,=0D - // UINT8 BaudRate;=0D -#if (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 9600)=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600,=0D -#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 19200)=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200,=0D -#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 57600)=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600,=0D -#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 115200)=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,=0D -#else=0D -#error Unsupported SPCR Baud Rate=0D -#endif=0D - // UINT8 Parity;=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,=0D - // UINT8 StopBits;=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1,=0D - // UINT8 FlowControl;=0D - RPI_UART_FLOW_CONTROL_NONE,=0D - // UINT8 TerminalType;=0D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8,=0D - // UINT8 Reserved2;=0D - EFI_ACPI_RESERVED_BYTE,=0D - // UINT16 PciDeviceId;=0D - 0xFFFF,=0D - // UINT16 PciVendorId;=0D - 0xFFFF,=0D - // UINT8 PciBusNumber;=0D - 0x00,=0D - // UINT8 PciDeviceNumber;=0D - 0x00,=0D - // UINT8 PciFunctionNumber;=0D - 0x00,=0D - // UINT32 PciFlags;=0D - 0x00000000,=0D - // UINT8 PciSegment;=0D - 0x00,=0D - // UINT32 Reserved3;=0D - EFI_ACPI_RESERVED_DWORD=0D -};=0D -=0D -//=0D -// Reference the table being generated to prevent the optimizer from remov= ing the=0D -// data structure from the executable=0D -//=0D -VOID* CONST ReferenceAcpiTable =3D &Spcr;=0D +/** @file=0D +* SPCR Table=0D +*=0D +* Copyright (c) 2019 Pete Batard =0D +* Copyright (c) 2014-2021, ARM Limited. All rights reserved.=0D +*=0D +* SPDX-License-Identifier: BSD-2-Clause-Patent=0D +*=0D +**/=0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +#include "AcpiTables.h"=0D +=0D +#define RPI_UART_FLOW_CONTROL_NONE 0=0D +=0D +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART=0D +#define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRE= SS=0D +#define RPI_UART_INTERRUPT BCM2836_PL011_UART_INTERRUPT= =0D +=0D +STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr =3D {=0D + ACPI_HEADER (=0D + EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION=0D + ),=0D + // UINT8 InterfaceType;=0D + RPI_UART_INTERFACE_TYPE,=0D + // UINT8 Reserved1[3];=0D + {=0D + EFI_ACPI_RESERVED_BYTE,=0D + EFI_ACPI_RESERVED_BYTE,=0D + EFI_ACPI_RESERVED_BYTE=0D + },=0D + // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddress;=0D + ARM_GAS32 (RPI_UART_BASE_ADDRESS),=0D + // UINT8 InterruptType;=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC,=0D + // UINT8 Irq;=0D + 0, // Not used on ARM=0D + // UINT32 GlobalSystemInterrupt;=0D + RPI_UART_INTERRUPT,=0D + // UINT8 BaudRate;=0D +#if (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 9600)=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600,=0D +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 19200)=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200,=0D +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 57600)=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600,=0D +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 115200)=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,=0D +#else=0D +#error Unsupported SPCR Baud Rate=0D +#endif=0D + // UINT8 Parity;=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,=0D + // UINT8 StopBits;=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1,=0D + // UINT8 FlowControl;=0D + RPI_UART_FLOW_CONTROL_NONE,=0D + // UINT8 TerminalType;=0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8,=0D + // UINT8 Reserved2;=0D + EFI_ACPI_RESERVED_BYTE,=0D + // UINT16 PciDeviceId;=0D + 0xFFFF,=0D + // UINT16 PciVendorId;=0D + 0xFFFF,=0D + // UINT8 PciBusNumber;=0D + 0x00,=0D + // UINT8 PciDeviceNumber;=0D + 0x00,=0D + // UINT8 PciFunctionNumber;=0D + 0x00,=0D + // UINT32 PciFlags;=0D + 0x00000000,=0D + // UINT8 PciSegment;=0D + 0x00,=0D + // UINT32 Reserved3;=0D + EFI_ACPI_RESERVED_DWORD=0D +};=0D +=0D +//=0D +// Reference the table being generated to prevent the optimizer from remov= ing the=0D +// data structure from the executable=0D +//=0D +VOID* CONST ReferenceAcpiTable =3D &Spcr;=0D diff --git a/Platform/RaspberryPi/AcpiTables/Uart.asl b/Platform/RaspberryP= i/AcpiTables/Uart.asl=0D index 81ae6711af..8ce297078d 100644=0D --- a/Platform/RaspberryPi/AcpiTables/Uart.asl=0D +++ b/Platform/RaspberryPi/AcpiTables/Uart.asl=0D @@ -2,6 +2,7 @@=0D *=0D * [DSDT] Serial devices (UART).=0D *=0D + * Copyright (c) 2021, ARM Limited. All rights reserved.=0D * Copyright (c) 2020, Pete Batard =0D * Copyright (c) 2018, Andrey Warkentin =0D * Copyright (c) Microsoft Corporation. All rights reserved.=0D @@ -101,7 +102,10 @@ Device(BTH0)=0D {=0D Name (RBUF, ResourceTemplate ()=0D {=0D - // BT UART: URT0 (PL011) or URTM (miniUART)=0D + //=0D + // BT UART: ResourceSource will be dynamically updated to=0D + // either URT0 (PL011) or URTM (miniUART) during boot=0D + //=0D UARTSerialBus(=0D 115200, // InitialBaudRate: in BPS=0D , // BitsPerByte: default to 8 bits=0D @@ -126,11 +130,7 @@ Device(BTH0)=0D // no flow control.=0D 16, // ReceiveBufferSize=0D 16, // TransmitBufferSize=0D -#if (RPI_MODEL =3D=3D 4)=0D - "\\_SB.GDV0.URTM", // ResourceSource:=0D -#else=0D "\\_SB.GDV0.URT0", // ResourceSource:=0D -#endif=0D // UART bus controller name=0D , // ResourceSourceIndex: assumed to be 0=0D , // ResourceUsage: assumed to be=0D diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c=0D index 22f86d4d44..68ba14c846 100644=0D --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c=0D +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c=0D @@ -1,6 +1,6 @@=0D /** @file=0D *=0D - * Copyright (c) 2019 - 2020, ARM Limited. All rights reserved.=0D + * Copyright (c) 2019 - 2021, ARM Limited. All rights reserved.=0D * Copyright (c) 2018 - 2020, Andrei Warkentin =0D *=0D * SPDX-License-Identifier: BSD-2-Clause-Patent=0D @@ -12,6 +12,9 @@=0D #include =0D #include =0D #include =0D +#include =0D +#include =0D +=0D #include =0D #include =0D #include =0D @@ -40,6 +43,8 @@ STATIC UINT32 mModelFamily =3D 0;=0D STATIC UINT32 mModelInstalledMB =3D 0;=0D =0D STATIC EFI_MAC_ADDRESS mMacAddress;=0D +BOOLEAN mUsePl011Uart;=0D +BOOLEAN mUseMiniUart;=0D =0D /*=0D * The GUID inside Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf and= =0D @@ -699,6 +704,71 @@ UpdateSdtNameOps (=0D }=0D }=0D =0D +//=0D +// BTH0._HID.BCM2EA6=0D +//=0D +#define BTH0_HID_PATTERN_LEN 17=0D +=0D +//=0D +// \_SB.GDV0.URT=0D +//=0D +#define RESOURCE_SOURCE_PATTERN_LEN 13=0D +=0D +//=0D +// Scan the given namespace table (DSDT/SSDT) for AML NameOps=0D +// listed in the NameOpReplace structure. If one is found then=0D +// update the value in the table from the specified Pcd=0D +//=0D +// This allows us to have conditionals in AML controlled=0D +// by options in the BDS or detected during firmware bootstrap.=0D +// We could extend this concept for strings/etc but due to len=0D +// variations its probably easier to encode the strings=0D +// in the ASL and pick the correct one based off a variable.=0D +//=0D +STATIC=0D +VOID=0D +UpdateDevBth0 (=0D + EFI_ACPI_DESCRIPTION_HEADER *AcpiTable=0D + )=0D +{=0D + UINTN Index;=0D + CHAR8 Bth0HidPattern[BTH0_HID_PATTERN_LEN] =3D {0x42, 0x54, 0x48, 0x30= , 0x08, 0x5F, 0X48, 0x49, 0x44, 0x0D, 0x42, 0x43, 0x4D, 0x32, 0x45, 0x41, 0= x36};=0D + CHAR8 ResourceSourcePattern[BTH0_HID_PATTERN_LEN] =3D {0x5C, 0x5F, 0x5= 3, 0x42, 0x2E, 0x47, 0X44, 0x56, 0x30, 0x2E, 0x55, 0x52, 0x54};=0D + BOOLEAN FoundBth0HidPattern;=0D + UINT8 *SdtPtr;=0D + UINT32 SdtSize;=0D +=0D + FoundBth0HidPattern =3D FALSE;=0D + SdtSize =3D AcpiTable->Length;=0D +=0D + if (SdtSize > 0) {=0D + SdtPtr =3D (UINT8 *)AcpiTable;=0D + for (Index =3D 0; Index < (SdtSize - BTH0_HID_PATTERN_LEN); Index++) {= =0D + if (!FoundBth0HidPattern) {=0D + if (CompareMem (SdtPtr + Index, Bth0HidPattern, BTH0_HID_PATTERN_L= EN) =3D=3D 0) {=0D + FoundBth0HidPattern =3D TRUE;=0D + }=0D + } else {=0D + if (CompareMem (SdtPtr + Index, ResourceSourcePattern, RESOURCE_SO= URCE_PATTERN_LEN) =3D=3D 0) {=0D + if (mUsePl011Uart) {=0D + //=0D + // Since PL011 has been set as Primary UART, set the last char= in=0D + // ResourceSource string to 'M' (0x4D) so that Mini UART can b= e used as Secondary UART for BlueTooth.=0D + //=0D + SdtPtr[Index + RESOURCE_SOURCE_PATTERN_LEN] =3D 0x4D;=0D + } else if (mUseMiniUart) {=0D + //=0D + // Since Mini UART has been set as Primary UART, set the last = char in=0D + // ResourceSource string to '0' (0x30) so that PL011 can be us= ed as Secondary UART for BlueTooth.=0D + //=0D + SdtPtr[Index + RESOURCE_SOURCE_PATTERN_LEN] =3D 0x30;=0D + }=0D + break;=0D + }=0D + }=0D + }=0D + }=0D +}=0D =0D STATIC=0D BOOLEAN=0D @@ -770,8 +840,14 @@ HandleDynamicNamespace (=0D {=0D UINTN Tables;=0D =0D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE *SpcrTable;=0D + DBG2_TABLE *Dbg2Table;=0D +=0D switch (AcpiHeader->Signature) {=0D case SIGNATURE_32 ('D', 'S', 'D', 'T'):=0D + UpdateDevBth0 (AcpiHeader);=0D + return TRUE;=0D +=0D case SIGNATURE_32 ('S', 'S', 'D', 'T'):=0D for (Tables =3D 0; SdtTables[Tables].OemTableId; Tables++) {=0D if (AcpiHeader->OemTableId =3D=3D SdtTables[Tables].OemTableId) {=0D @@ -779,14 +855,37 @@ HandleDynamicNamespace (=0D }=0D }=0D DEBUG ((DEBUG_ERROR, "Found namespace table not in table list.\n"));=0D -=0D return FALSE;=0D +=0D case SIGNATURE_32 ('I', 'O', 'R', 'T'):=0D // only enable the IORT on machines with >3G and no limit=0D // to avoid problems with rhel/centos and other older OSs=0D if (PcdGet32 (PcdRamLimitTo3GB) || !PcdGet32 (PcdRamMoreThan3GB)) {=0D return FALSE;=0D }=0D + return TRUE;=0D +=0D + case SIGNATURE_32 ('S', 'P', 'C', 'R'):=0D + SpcrTable =3D (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE *)AcpiHe= ader;=0D + if (mUsePl011Uart && (SpcrTable->InterfaceType =3D=3D EFI_ACPI_SERIAL_= PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART)) {=0D + return TRUE;=0D + } else if (mUseMiniUart && (SpcrTable->InterfaceType =3D=3D EFI_ACPI_S= ERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART)) {=0D + return TRUE;=0D + } else {=0D + return FALSE;=0D + }=0D + return TRUE;=0D +=0D + case SIGNATURE_32 ('D', 'B', 'G', '2'):=0D + Dbg2Table =3D (DBG2_TABLE *)AcpiHeader;=0D + if (mUsePl011Uart && (Dbg2Table->Dbg2DeviceInfo[0].Dbg2Device.PortSubt= ype =3D=3D EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART)) {=0D + return TRUE;=0D + } else if (mUseMiniUart && (Dbg2Table->Dbg2DeviceInfo[0].Dbg2Device.Po= rtSubtype =3D=3D EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_BCM2835_UART)) {=0D + return TRUE;=0D + } else {=0D + return FALSE;=0D + }=0D + return TRUE;=0D }=0D =0D return TRUE;=0D @@ -803,6 +902,9 @@ ConfigInitialize (=0D EFI_STATUS Status;=0D EFI_EVENT EndOfDxeEvent;=0D =0D + mUsePl011Uart =3D ((MmioRead32(GPIO_BASE_ADDRESS + 4) & 0x0003F000) =3D= =3D 0x00024000);=0D + mUseMiniUart =3D ((MmioRead32(GPIO_BASE_ADDRESS + 4) & 0x0003F000) =3D= =3D 0x00012000);=0D +=0D Status =3D gBS->LocateProtocol (&gRaspberryPiFirmwareProtocolGuid,=0D NULL, (VOID**)&mFwProtocol);=0D ASSERT_EFI_ERROR (Status);=0D @@ -859,3 +961,4 @@ ConfigInitialize (=0D =0D return EFI_SUCCESS;=0D }=0D +=0D diff --git a/Platform/RaspberryPi/Include/IndustryStandard/RpiDebugPort2Tab= le.h b/Platform/RaspberryPi/Include/IndustryStandard/RpiDebugPort2Table.h=0D new file mode 100644=0D index 0000000000..8f7452f97a=0D --- /dev/null=0D +++ b/Platform/RaspberryPi/Include/IndustryStandard/RpiDebugPort2Table.h=0D @@ -0,0 +1,34 @@=0D +/** @file=0D +=0D + Copyright (c) 2021, ARM Limited. All rights reserved.=0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D + **/=0D +#ifndef __RPI_DEBUG_PORT_2_H__=0D +#define __RPI_DEBUG_PORT_2_H__=0D +=0D +#include =0D +=0D +#define RPI_DBG2_NUM_DEBUG_PORTS 1=0D +#define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1=0D +#define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 15=0D +=0D +#pragma pack(1)=0D +=0D +=0D +typedef struct {=0D + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device;=0D + EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddressRegiste= r;=0D + UINT32 AddressSize;=0D + UINT8 NameSpaceString[RP= I_DBG2_NAMESPACESTRING_FIELD_SIZE];=0D +} DBG2_DEBUG_DEVICE_INFORMATION;=0D +=0D +typedef struct {=0D + EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description;=0D + DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[RPI= _DBG2_NUM_DEBUG_PORTS];=0D +} DBG2_TABLE;=0D +=0D +#pragma pack()=0D +#endif //__RPI_DEBUG_PORT_2_H__=0D +=0D --=0D 2.31.0.windows.1=0D =0D