TianoCore EDK2 master
|
#include <IndustryStandard/DebugPort2Table.h>
#include <Library/AcpiLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Protocol/AcpiTable.h>
#include <Protocol/SerialIo.h>
#include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h>
#include <Library/SsdtSerialPortFixupLib.h>
#include <Library/TableHelperLib.h>
#include <Protocol/ConfigurationManagerProtocol.h>
#include "Dbg2Generator.h"
Go to the source code of this file.
Data Structures | |
struct | DBG2_DEBUG_DEVICE_INFORMATION |
struct | DBG2_TABLE |
Macros | |
#define | DBG2_NUM_DEBUG_PORTS 1 |
#define | DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1 |
#define | INDEX_DBG_PORT0 0 |
#define | NAME_STR_DBG_PORT0 "COM0" |
#define | NAMESPACE_STR_DBG_PORT0 "\\_SB_.COM0" |
#define | UID_DBG_PORT0 0 |
#define | DBG2_NAMESPACESTRING_FIELD_SIZE sizeof (NAMESPACE_STR_DBG_PORT0) |
#define | PL011_UART_LENGTH 0x1000 |
#define | DBG2_DEBUG_PORT_DDI( SubType, UartBase, UartAddrLen, UartNameStr) |
#define | DBG2_GENERATOR_REVISION CREATE_REVISION (1, 0) |
Functions | |
GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjSerialDebugPortInfo, CM_ARCH_COMMON_SERIAL_PORT_INFO) | |
STATIC EFI_STATUS | SetupDebugUart (IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO *CONST SerialPortInfo) |
STATIC EFI_STATUS EFIAPI | FreeDbg2TableEx (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT EFI_ACPI_DESCRIPTION_HEADER ***CONST Table, IN CONST UINTN TableCount) |
STATIC EFI_STATUS EFIAPI | BuildDbg2TableEx (IN CONST ACPI_TABLE_GENERATOR *This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER ***Table, OUT UINTN *CONST TableCount) |
EFI_STATUS EFIAPI | AcpiDbg2LibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS EFIAPI | AcpiDbg2LibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
STATIC DBG2_TABLE | AcpiDbg2 |
STATIC CONST ACPI_TABLE_GENERATOR | Dbg2Generator |
DBG2 Table Generator
Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Dbg2Generator.c.
#define DBG2_DEBUG_PORT_DDI | ( | SubType, | |
UartBase, | |||
UartAddrLen, | |||
UartNameStr | |||
) |
A helper macro used for initializing the debug port device information structure.
[in] | SubType | The DBG Port SubType. |
[in] | UartBase | The UART port base address. |
[in] | UartAddrLen | The UART port address range length. |
[in] | UartNameStr | The UART port name string. |
Definition at line 111 of file Dbg2Generator.c.
#define DBG2_GENERATOR_REVISION CREATE_REVISION (1, 0) |
This macro defines the DBG2 Table Generator revision.
Definition at line 519 of file Dbg2Generator.c.
#define DBG2_NAMESPACESTRING_FIELD_SIZE sizeof (NAMESPACE_STR_DBG_PORT0) |
The length of the namespace string.
Definition at line 69 of file Dbg2Generator.c.
#define DBG2_NUM_DEBUG_PORTS 1 |
ARM standard DBG2 Table Generator
Constructs the DBG2 table for corresponding DBG2 peripheral.
Requirements: The following Configuration Manager Object(s) are required by this Generator:
Definition at line 44 of file Dbg2Generator.c.
#define DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1 |
The number of Generic Address Registers presented in the debug device information.
Definition at line 49 of file Dbg2Generator.c.
#define INDEX_DBG_PORT0 0 |
The index for the debug port 0 in the Debug port information list.
Definition at line 53 of file Dbg2Generator.c.
#define NAME_STR_DBG_PORT0 "COM0" |
A string representing the name of the debug port 0.
Definition at line 57 of file Dbg2Generator.c.
#define NAMESPACE_STR_DBG_PORT0 "\\_SB_.COM0" |
A string representing the full path name of the debug port 0.
Definition at line 61 of file Dbg2Generator.c.
#define PL011_UART_LENGTH 0x1000 |
The PL011 UART address range length.
Definition at line 73 of file Dbg2Generator.c.
#define UID_DBG_PORT0 0 |
An UID representing the debug port 0.
Definition at line 65 of file Dbg2Generator.c.
EFI_STATUS EFIAPI AcpiDbg2LibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Register the Generator with the ACPI Table Factory.
[in] | ImageHandle | The handle to the image. |
[in] | SystemTable | Pointer to the System Table. |
EFI_SUCCESS | The Generator is registered. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_ALREADY_STARTED | The Generator for the Table ID is already registered. |
Definition at line 562 of file Dbg2Generator.c.
EFI_STATUS EFIAPI AcpiDbg2LibDestructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Deregister the Generator from the ACPI Table Factory.
[in] | ImageHandle | The handle to the image. |
[in] | SystemTable | Pointer to the System Table. |
EFI_SUCCESS | The Generator is deregistered. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | The Generator is not registered. |
Definition at line 586 of file Dbg2Generator.c.
STATIC EFI_STATUS EFIAPI BuildDbg2TableEx | ( | IN CONST ACPI_TABLE_GENERATOR * | This, |
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST | AcpiTableInfo, | ||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, | ||
OUT EFI_ACPI_DESCRIPTION_HEADER *** | Table, | ||
OUT UINTN *CONST | TableCount | ||
) |
Construct the DBG2 ACPI table and its associated SSDT table.
This function invokes the Configuration Manager protocol interface to get the required hardware information for generating the ACPI table.
If this function allocates any resources then they must be freed in the FreeXXXXTableResourcesEx function.
[in] | This | Pointer to the ACPI table generator. |
[in] | AcpiTableInfo | Pointer to the ACPI table information. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol interface. |
[out] | Table | Pointer to a list of generated ACPI table(s). |
[out] | TableCount | Number of generated ACPI table(s). |
EFI_SUCCESS | Table generated successfully. |
EFI_BAD_BUFFER_SIZE | The size returned by the Configuration Manager is less than the Object size for the requested object. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | Could not find information. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
EFI_UNSUPPORTED | Unsupported configuration. |
Definition at line 324 of file Dbg2Generator.c.
STATIC EFI_STATUS EFIAPI FreeDbg2TableEx | ( | IN CONST ACPI_TABLE_GENERATOR *CONST | This, |
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST | AcpiTableInfo, | ||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, | ||
IN OUT EFI_ACPI_DESCRIPTION_HEADER ***CONST | Table, | ||
IN CONST UINTN | TableCount | ||
) |
Free any resources allocated for constructing the tables.
[in] | This | Pointer to the ACPI table generator. |
[in] | AcpiTableInfo | Pointer to the ACPI Table Info. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in,out] | Table | Pointer to an array of pointers to ACPI Table(s). |
[in] | TableCount | Number of ACPI table(s). |
EFI_SUCCESS | The resources were freed successfully. |
EFI_INVALID_PARAMETER | The table pointer is NULL or invalid. |
Definition at line 251 of file Dbg2Generator.c.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjSerialDebugPortInfo | , | ||
CM_ARCH_COMMON_SERIAL_PORT_INFO | |||
) |
This macro expands to a function that retrieves the Serial debug port information from the Configuration Manager
STATIC EFI_STATUS SetupDebugUart | ( | IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO *CONST | SerialPortInfo | ) |
Initialize the DBG2 UART with the parameters obtained from the Configuration Manager.
[in] | SerialPortInfo | Pointer to the Serial Port Information. |
EFI_SUCCESS | Success. |
EFI_INVALID_PARAMETER | The parameters for serial port initialization are invalid. |
Definition at line 201 of file Dbg2Generator.c.
STATIC DBG2_TABLE AcpiDbg2 |
The DBG2 Table template definition.
Note: fields marked with "{Template}" will be set dynamically
Definition at line 156 of file Dbg2Generator.c.
STATIC CONST ACPI_TABLE_GENERATOR Dbg2Generator |
The interface for the DBG2 Table Generator.
Definition at line 525 of file Dbg2Generator.c.