TianoCore EDK2 master
|
#include <IndustryStandard/DebugPort2Table.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include "CmObjectDescUtility.h"
#include "FdtHwInfoParser.h"
#include "Serial/SerialPortParser.h"
Go to the source code of this file.
Functions | |
STATIC EFI_STATUS EFIAPI | SerialPortNodeParser (IN CONST VOID *Fdt, IN INT32 SerialPortNode, IN CM_ARCH_COMMON_SERIAL_PORT_INFO *SerialPortInfo) |
STATIC EFI_STATUS EFIAPI | GetSerialConsoleNode (IN CONST VOID *Fdt, OUT INT32 *SerialConsoleNode) |
STATIC EFI_STATUS EFIAPI | SerialPortInfoDispatch (IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN CM_ARCH_COMMON_SERIAL_PORT_INFO *GenericSerialInfo, IN INT32 NodeCount, IN EARCH_COMMON_OBJECT_ID SerialObjectId) |
STATIC EFI_STATUS EFIAPI | SerialPortInfoParser (IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN INT32 FdtBranch, IN EARCH_COMMON_OBJECT_ID SerialObjectId) |
EFI_STATUS EFIAPI | SerialPortDispatcher (IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN INT32 FdtBranch) |
Serial Port Parser.
Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SerialPortParser.c.
STATIC EFI_STATUS EFIAPI GetSerialConsoleNode | ( | IN CONST VOID * | Fdt, |
OUT INT32 * | SerialConsoleNode | ||
) |
Find the console serial-port node in the DT.
This function fetches the node referenced in the "stdout-path" property of the "chosen" node.
[in] | Fdt | Pointer to a Flattened Device Tree (Fdt). |
[out] | SerialConsoleNode | If success, contains the node offset of the console serial-port node. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | An error occurred. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Not found. |
Definition at line 265 of file SerialPortParser.c.
EFI_STATUS EFIAPI SerialPortDispatcher | ( | IN CONST FDT_HW_INFO_PARSER_HANDLE | FdtParserHandle, |
IN INT32 | FdtBranch | ||
) |
SerialPort dispatcher.
This disptacher populates the CM_ARCH_COMMON_SERIAL_PORT_INFO structure for the following CM_OBJ_ID:
A parser parses a Device Tree to populate a specific CmObj type. None, one or many CmObj can be created by the parser. The created CmObj are then handed to the parser's caller through the HW_INFO_ADD_OBJECT interface. This can also be a dispatcher. I.e. a function that not parsing a Device Tree but calling other parsers.
[in] | FdtParserHandle | A handle to the parser instance. |
[in] | FdtBranch | When searching for DT node name, restrict the search to this Device Tree branch. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | An error occurred. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Not found. |
EFI_UNSUPPORTED | Unsupported. |
Definition at line 478 of file SerialPortParser.c.
STATIC EFI_STATUS EFIAPI SerialPortInfoDispatch | ( | IN CONST FDT_HW_INFO_PARSER_HANDLE | FdtParserHandle, |
IN CM_ARCH_COMMON_SERIAL_PORT_INFO * | GenericSerialInfo, | ||
IN INT32 | NodeCount, | ||
IN EARCH_COMMON_OBJECT_ID | SerialObjectId | ||
) |
CM_ARCH_COMMON_SERIAL_PORT_INFO dispatcher function (for a generic serial-port).
[in] | FdtParserHandle | A handle to the parser instance. |
[in] | GenericSerialInfo | Pointer to a serial port info list. |
[in] | NodeCount | Count of serial ports to dispatch. |
[in] | SerialObjectId | Serial port object ID. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | An error occurred. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Not found. |
EFI_UNSUPPORTED | Unsupported. |
Definition at line 334 of file SerialPortParser.c.
STATIC EFI_STATUS EFIAPI SerialPortInfoParser | ( | IN CONST FDT_HW_INFO_PARSER_HANDLE | FdtParserHandle, |
IN INT32 | FdtBranch, | ||
IN EARCH_COMMON_OBJECT_ID | SerialObjectId | ||
) |
CM_ARCH_COMMON_SERIAL_PORT_INFO parser function (for debug/console serial-port).
This parser expects FdtBranch to be the debug serial-port node. At most one CmObj is created. The following structure is populated: typedef struct EArchCommonSerialPortInfo { UINT64 BaseAddress; // {Populated} UINT32 Interrupt; // {Populated} UINT64 BaudRate; // {default} UINT32 Clock; // {Populated} UINT16 PortSubtype; // {Populated} UINT64 BaseAddressLength // {Populated} } CM_ARCH_COMMON_SERIAL_PORT_INFO;
A parser parses a Device Tree to populate a specific CmObj type. None, one or many CmObj can be created by the parser. The created CmObj are then handed to the parser's caller through the HW_INFO_ADD_OBJECT interface. This can also be a dispatcher. I.e. a function that not parsing a Device Tree but calling other parsers.
[in] | FdtParserHandle | A handle to the parser instance. |
[in] | FdtBranch | When searching for DT node name, restrict the search to this Device Tree branch. |
[in] | SerialObjectId | ArchCommon Namespace Object ID for the serial port. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | An error occurred. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Not found. |
EFI_UNSUPPORTED | Unsupported. |
Definition at line 413 of file SerialPortParser.c.
STATIC EFI_STATUS EFIAPI SerialPortNodeParser | ( | IN CONST VOID * | Fdt, |
IN INT32 | SerialPortNode, | ||
IN CM_ARCH_COMMON_SERIAL_PORT_INFO * | SerialPortInfo | ||
) |
Parse a serial port node.
[in] | Fdt | Pointer to a Flattened Device Tree (Fdt). |
[in] | SerialPortNode | Offset of a serial-port node. |
[in] | SerialPortInfo | The CM_ARCH_COMMON_SERIAL_PORT_INFO to populate. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | An error occurred. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_UNSUPPORTED | Unsupported. |
Definition at line 86 of file SerialPortParser.c.
CONST COMPATIBILITY_INFO Serial16550CompatibleInfo |
COMPATIBILITY_INFO structure for the Serial16550Compatible.
Definition at line 49 of file SerialPortParser.c.
STATIC CONST COMPATIBILITY_STR Serial16550CompatibleStr[] |
16550 UART compatible strings.
Any string of this list must be part of SerialCompatible.
Definition at line 43 of file SerialPortParser.c.
CONST COMPATIBILITY_INFO SerialCompatibleInfo |
COMPATIBILITY_INFO structure for the SerialCompatible.
Definition at line 34 of file SerialPortParser.c.
STATIC CONST COMPATIBILITY_STR SerialCompatibleStr[] |
List of "compatible" property values for serial port nodes.
Any other "compatible" value is not supported by this module.
Definition at line 26 of file SerialPortParser.c.
CONST COMPATIBILITY_INFO SerialSbsaCompatibleInfo |
COMPATIBILITY_INFO structure for the SerialSbsaCompatible.
Definition at line 67 of file SerialPortParser.c.
STATIC CONST COMPATIBILITY_STR SerialSbsaCompatibleStr[] |
SBSA UART compatible strings.
Include PL011 as SBSA uart is a subset of PL011.
Any string of this list must be part of SerialCompatible.
Definition at line 60 of file SerialPortParser.c.