]> git.proxmox.com Git - mirror_edk2.git/blob - DynamicTablesPkg/Include/Library/SsdtSerialPortFixupLib.h
DynamicTablesPkg: SSDT Serial Port Fixup library
[mirror_edk2.git] / DynamicTablesPkg / Include / Library / SsdtSerialPortFixupLib.h
1 /** @file
2 Ssdt Serial Port Fixup Library
3
4 Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7 **/
8
9 #ifndef SSDT_SERIAL_PORT_LIB_H_
10 #define SSDT_SERIAL_PORT_LIB_H_
11
12 /** Build a SSDT table describing the input serial port.
13
14 The table created by this function must be freed by FreeSsdtSerialTable.
15
16 @param [in] AcpiTableInfo Pointer to the ACPI table information.
17 @param [in] SerialPortInfo Serial port to describe in the SSDT table.
18 @param [in] Name The Name to give to the Device.
19 Must be a NULL-terminated ASL NameString
20 e.g.: "DEV0", "DV15.DEV0", etc.
21 @param [in] Uid UID for the Serial Port.
22 @param [out] Table If success, pointer to the created SSDT table.
23
24 @retval EFI_SUCCESS Table generated successfully.
25 @retval EFI_INVALID_PARAMETER A parameter is invalid.
26 @retval EFI_NOT_FOUND Could not find information.
27 @retval EFI_OUT_OF_RESOURCES Could not allocate memory.
28 **/
29 EFI_STATUS
30 EFIAPI
31 BuildSsdtSerialPortTable (
32 IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * AcpiTableInfo,
33 IN CONST CM_ARM_SERIAL_PORT_INFO * SerialPortInfo,
34 IN CONST CHAR8 * Name,
35 IN CONST UINT64 Uid,
36 OUT EFI_ACPI_DESCRIPTION_HEADER ** Table
37 );
38
39 /** Free an SSDT table previously created by
40 the BuildSsdtSerialTable function.
41
42 @param [in] Table Pointer to a SSDT table allocated by
43 the BuildSsdtSerialTable function.
44
45 @retval EFI_SUCCESS Success.
46 **/
47 EFI_STATUS
48 EFIAPI
49 FreeSsdtSerialPortTable (
50 IN EFI_ACPI_DESCRIPTION_HEADER * Table
51 );
52
53 /** Validate the Serial Port Information.
54
55 @param [in] SerialPortInfoTable Table of CM_ARM_SERIAL_PORT_INFO.
56 @param [in] SerialPortCount Count of SerialPort in the table.
57
58 @retval EFI_SUCCESS Success.
59 @retval EFI_INVALID_PARAMETER Invalid parameter.
60 **/
61 EFI_STATUS
62 EFIAPI
63 ValidateSerialPortInfo (
64 IN CONST CM_ARM_SERIAL_PORT_INFO * SerialPortInfoTable,
65 IN UINT32 SerialPortCount
66 );
67
68 #endif // SSDT_SERIAL_PORT_LIB_H_