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>
This commit is contained in:
Sami Mujawar 2019-07-09 16:18:27 +01:00 committed by mergify[bot]
parent d39271f114
commit 7c10e8abb6
1 changed files with 17 additions and 10 deletions

View File

@ -175,7 +175,7 @@ GET_OBJECT_LIST (
CM_ARM_SERIAL_PORT_INFO 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. the Configuration Manager.
@param [in] SerialPortInfo Pointer to the Serial Port Information. @param [in] SerialPortInfo Pointer to the Serial Port Information.
@ -353,6 +353,12 @@ BuildDbg2Table (
AcpiDbg2.Dbg2DeviceInfo[DBG_PORT_INDEX_PORT1].Dbg2Device.PortSubtype = AcpiDbg2.Dbg2DeviceInfo[DBG_PORT_INDEX_PORT1].Dbg2Device.PortSubtype =
SerialPortInfo->PortSubtype; SerialPortInfo->PortSubtype;
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 // Initialize the serial port
Status = SetupDebugUart (SerialPortInfo); Status = SetupDebugUart (SerialPortInfo);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
@ -363,6 +369,7 @@ BuildDbg2Table (
)); ));
goto error_handler; goto error_handler;
} }
}
*Table = (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2; *Table = (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2;