diff options
author | Sami Mujawar <sami.mujawar@arm.com> | 2019-07-09 16:18:27 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-03-29 16:53:35 +0000 |
commit | 7c10e8abb6d457250bdc4b56612b1c36bed5915d (patch) | |
tree | d7260280d2cf6fb1976e2e12818799f09fc599bd /DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | |
parent | d39271f114f035bb0a6ccf404c64f9131a9e45d8 (diff) | |
download | edk2-7c10e8abb6d457250bdc4b56612b1c36bed5915d.tar.gz edk2-7c10e8abb6d457250bdc4b56612b1c36bed5915d.tar.bz2 edk2-7c10e8abb6d457250bdc4b56612b1c36bed5915d.zip |
DynamicTablesPkg: Serial debug port initialisation
The ARM DCC serial port subtype is an option that is
supported by the DBG2 generator. However, the serial
port initialisation should only be done for PL011/SBSA
compatible UARTs.
Add check to conditionally initialise the serial port.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Diffstat (limited to 'DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c')
-rw-r--r-- | DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c index 346ab5b22f..51c843d25f 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c @@ -175,7 +175,7 @@ GET_OBJECT_LIST ( CM_ARM_SERIAL_PORT_INFO
);
-/** Initialize the PL011 UART with the parameters obtained from
+/** Initialize the PL011/SBSA UART with the parameters obtained from
the Configuration Manager.
@param [in] SerialPortInfo Pointer to the Serial Port Information.
@@ -353,15 +353,22 @@ BuildDbg2Table ( AcpiDbg2.Dbg2DeviceInfo[DBG_PORT_INDEX_PORT1].Dbg2Device.PortSubtype =
SerialPortInfo->PortSubtype;
- // Initialize the serial port
- Status = SetupDebugUart (SerialPortInfo);
- if (EFI_ERROR (Status)) {
- DEBUG ((
- DEBUG_ERROR,
- "ERROR: DBG2: Failed to configure debug serial port. Status = %r\n",
- Status
- ));
- goto error_handler;
+ if ((SerialPortInfo->PortSubtype ==
+ EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART) ||
+ (SerialPortInfo->PortSubtype ==
+ EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X) ||
+ (SerialPortInfo->PortSubtype ==
+ EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART)) {
+ // Initialize the serial port
+ Status = SetupDebugUart (SerialPortInfo);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((
+ DEBUG_ERROR,
+ "ERROR: DBG2: Failed to configure debug serial port. Status = %r\n",
+ Status
+ ));
+ goto error_handler;
+ }
}
*Table = (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2;
|