/** @file\r
DBG2 Table Generator\r
\r
- Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.<BR>\r
+ Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>\r
\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].BaseAddressRegister.Address =\r
SerialPortInfo->BaseAddress;\r
\r
+ // Set the access size\r
+ if (SerialPortInfo->AccessSize >= EFI_ACPI_6_3_QWORD) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ DEBUG ((\r
+ DEBUG_ERROR,\r
+ "ERROR: DBG2: Access size must be <= 3 (DWORD). Status = %r\n",\r
+ Status\r
+ ));\r
+ goto error_handler;\r
+ } else if (SerialPortInfo->AccessSize == EFI_ACPI_6_3_UNDEFINED) {\r
+ // 0 Undefined (legacy reasons)\r
+ // Default to DWORD access size as the access\r
+ // size field was introduced at a later date\r
+ // and some ConfigurationManager implementations\r
+ // may not be providing this field data\r
+ AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].BaseAddressRegister.AccessSize =\r
+ EFI_ACPI_6_3_DWORD;\r
+ } else {\r
+ AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].BaseAddressRegister.AccessSize =\r
+ SerialPortInfo->AccessSize;\r
+ }\r
+\r
// Update the serial port subtype\r
AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].Dbg2Device.PortSubtype =\r
SerialPortInfo->PortSubtype;\r