TianoCore EDK2 master
|
#include <Base.h>
Go to the source code of this file.
Data Structures | |
struct | FDT_SERIAL_PORTS |
Functions | |
RETURN_STATUS EFIAPI | FdtSerialGetPorts (IN CONST VOID *DeviceTree, IN CONST CHAR8 *Compatible, OUT FDT_SERIAL_PORTS *Ports) |
RETURN_STATUS EFIAPI | FdtSerialGetConsolePort (IN CONST VOID *DeviceTree, OUT UINT64 *BaseAddress) |
Determine the base addresses of serial ports from the Device Tree.
Copyright (C) Red Hat
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FdtSerialPortAddressLib.h.
RETURN_STATUS EFIAPI FdtSerialGetConsolePort | ( | IN CONST VOID * | DeviceTree, |
OUT UINT64 * | BaseAddress | ||
) |
Fetch the base address of the serial port identified in the "stdout-path" property of the "/chosen" node in DeviceTree.
[in] | DeviceTree | The flat device tree (FDT) to scan. |
[out] | BaseAddress | On success, the base address of the preferred serial port (to be used as console). On error, BaseAddress is not modified. |
RETURN_INVALID_PARAMETER | DeviceTree does not point to a valid FDT header. |
RETURN_NOT_FOUND | No enabled console port has been found. |
RETURN_PROTOCOL_ERROR | The first (or only) node path in the "stdout-path" property is an empty string. |
RETURN_PROTOCOL_ERROR | The console port has been found in the FDT, but its base address is not correctly represented. |
RETURN_SUCCESS | BaseAddress has been populated. |
Definition at line 168 of file FdtSerialPortAddressLib.c.
RETURN_STATUS EFIAPI FdtSerialGetPorts | ( | IN CONST VOID * | DeviceTree, |
IN CONST CHAR8 * | Compatible, | ||
OUT FDT_SERIAL_PORTS * | Ports | ||
) |
Collect the first ARRAY_SIZE (Ports->BaseAddress) serial ports into Ports from DeviceTree.
[in] | DeviceTree | The flat device tree (FDT) to scan. |
[in] | Compatible | Look for Compatible in the "compatible" property of the scanned nodes. |
[out] | Ports | On successful return, Ports->NumberOfPorts contains the number of serial ports found; it is (a) positive and (b) at most ARRAY_SIZE (Ports->BaseAddress). If the FDT had more serial ports, those are not reported. On error, the contents of Ports are indeterminate. |
RETURN_INVALID_PARAMETER | DeviceTree does not point to a valid FDT header. |
RETURN_NOT_FOUND | No compatible and enabled serial port has been found. |
RETURN_SUCCESS | At least one compatible and enabled serial port has been found; Ports has been filled in. |
Definition at line 94 of file FdtSerialPortAddressLib.c.