/** @file\r
SPCR 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
// Update the base address\r
AcpiSpcr.BaseAddress.Address = 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: SPCR: 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
+ AcpiSpcr.BaseAddress.AccessSize = EFI_ACPI_6_3_DWORD;\r
+ } else {\r
+ AcpiSpcr.BaseAddress.AccessSize = SerialPortInfo->AccessSize;\r
+ }\r
+\r
// Update the UART interrupt\r
AcpiSpcr.GlobalSystemInterrupt = SerialPortInfo->Interrupt;\r
\r