TianoCore EDK2 master
|
#include <IndustryStandard/DebugPort2Table.h>
#include <Library/AcpiLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Protocol/AcpiTable.h>
#include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h>
#include <Library/AcpiHelperLib.h>
#include <Library/AmlLib/AmlLib.h>
#include <Protocol/ConfigurationManagerProtocol.h>
Go to the source code of this file.
Macros | |
#define | MIN_UART_ADDRESS_LENGTH 0x1000U |
Variables | |
CHAR8 | ssdtserialporttemplate_aml_code [] |
SSDT Serial Port Fixup Library.
Copyright (c) 2019 - 2024, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SsdtSerialPortFixupLib.c.
#define MIN_UART_ADDRESS_LENGTH 0x1000U |
UART address range length.
Definition at line 45 of file SsdtSerialPortFixupLib.c.
EFI_STATUS EFIAPI BuildSsdtSerialPortTable | ( | IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * | AcpiTableInfo, |
IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO * | SerialPortInfo, | ||
IN CONST CHAR8 * | Name, | ||
IN CONST UINT64 | Uid, | ||
OUT EFI_ACPI_DESCRIPTION_HEADER ** | Table | ||
) |
Build a SSDT table describing the input serial port.
The table created by this function must be freed by FreeSsdtSerialTable.
[in] | AcpiTableInfo | Pointer to the ACPI table information. |
[in] | SerialPortInfo | Serial port to describe in the SSDT table. |
[in] | Name | The Name to give to the Device. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. |
[in] | Uid | UID for the Serial Port. |
[out] | Table | If success, pointer to the created SSDT table. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | Could not find information. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
Definition at line 482 of file SsdtSerialPortFixupLib.c.
STATIC EFI_STATUS EFIAPI FixupCrs | ( | IN AML_ROOT_NODE_HANDLE | RootNodeHandle, |
IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO * | SerialPortInfo | ||
) |
Fixup the Serial Port _CRS values (BaseAddress, ...).
[in] | RootNodeHandle | Pointer to the root of an AML tree. |
[in] | SerialPortInfo | Pointer to a Serial Port Information structure. Get the Serial Port Information from there. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Could not find information. |
EFI_OUT_OF_RESOURCES | Out of resources. |
Definition at line 292 of file SsdtSerialPortFixupLib.c.
STATIC EFI_STATUS EFIAPI FixupIds | ( | IN AML_ROOT_NODE_HANDLE | RootNodeHandle, |
IN CONST UINT64 | Uid, | ||
IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO * | SerialPortInfo | ||
) |
Fixup the Serial Port Ids (_UID, _HID, _CID).
[in] | RootNodeHandle | Pointer to the root of an AML tree. |
[in] | Uid | UID for the Serial Port. |
[in] | SerialPortInfo | Pointer to a Serial Port Information structure. Get the Serial Port Information from there. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Could not find information. |
EFI_OUT_OF_RESOURCES | Out of resources. |
Definition at line 165 of file SsdtSerialPortFixupLib.c.
STATIC EFI_STATUS EFIAPI FixupName | ( | IN AML_ROOT_NODE_HANDLE | RootNodeHandle, |
IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO * | SerialPortInfo, | ||
IN CONST CHAR8 * | Name | ||
) |
Fixup the Serial Port device name.
[in] | RootNodeHandle | Pointer to the root of an AML tree. |
[in] | SerialPortInfo | Pointer to a Serial Port Information structure. Get the Serial Port Information from there. |
[in] | Name | The Name to give to the Device. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Could not find information. |
EFI_OUT_OF_RESOURCES | Out of resources. |
Definition at line 368 of file SsdtSerialPortFixupLib.c.
STATIC EFI_STATUS EFIAPI FixupSerialPortInfo | ( | IN AML_ROOT_NODE_HANDLE | RootNodeHandle, |
IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO * | SerialPortInfo, | ||
IN CONST CHAR8 * | Name, | ||
IN CONST UINT64 | Uid, | ||
OUT EFI_ACPI_DESCRIPTION_HEADER ** | Table | ||
) |
Fixup the Serial Port Information in the AML tree.
For each template value:
[in] | RootNodeHandle | Pointer to the root of the AML tree. |
[in] | SerialPortInfo | Pointer to a Serial Port Information structure. Get the Serial Port Information from there. |
[in] | Name | The Name to give to the Device. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. |
[in] | Uid | UID for the Serial Port. |
[out] | Table | If success, contains the serialized SSDT table. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Could not find information. |
EFI_OUT_OF_RESOURCES | Out of resources. |
Definition at line 412 of file SsdtSerialPortFixupLib.c.
EFI_STATUS EFIAPI FreeSsdtSerialPortTable | ( | IN EFI_ACPI_DESCRIPTION_HEADER * | Table | ) |
Free an SSDT table previously created by the BuildSsdtSerialTable function.
[in] | Table | Pointer to a SSDT table allocated by the BuildSsdtSerialTable function. |
EFI_SUCCESS | Success. |
Definition at line 454 of file SsdtSerialPortFixupLib.c.
EFI_STATUS EFIAPI ValidateSerialPortInfo | ( | IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO * | SerialPortInfoTable, |
IN UINT32 | SerialPortCount | ||
) |
Validate the Serial Port Information.
[in] | SerialPortInfoTable | Table of CM_ARCH_COMMON_SERIAL_PORT_INFO. |
[in] | SerialPortCount | Count of SerialPort in the table. |
EFI_SUCCESS | Success. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Definition at line 57 of file SsdtSerialPortFixupLib.c.
|
extern |
C array containing the compiled AML template. This symbol is defined in the auto generated C file containing the AML bytecode array.