4 Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
8 - Microsoft Serial Port Console Redirection Table
9 Specification - Version 1.03 - August 10, 2015.
12 #include <IndustryStandard/Acpi.h>
13 #include <IndustryStandard/SerialPortConsoleRedirectionTable.h>
14 #include <Library/UefiLib.h>
15 #include "AcpiParser.h"
16 #include "AcpiTableParser.h"
19 STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo
;
22 This function validates the Interrupt Type.
24 @param [in] Ptr Pointer to the start of the field data.
25 @param [in] Context Pointer to context specific information e.g. this
26 could be a pointer to the ACPI table header.
31 ValidateInterruptType (
36 #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
42 EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC
)
44 IncrementErrorCount ();
46 L
"\nERROR: InterruptType = %d. This must be 8 on ARM Platforms",
55 This function validates the Irq.
57 @param [in] Ptr Pointer to the start of the field data.
58 @param [in] Context Pointer to context specific information e.g. this
59 could be a pointer to the ACPI table header.
69 #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
75 IncrementErrorCount ();
77 L
"\nERROR: Irq = %d. This must be zero on ARM Platforms\n",
86 An ACPI_PARSER array describing the ACPI SPCR Table.
88 STATIC CONST ACPI_PARSER SpcrParser
[] = {
89 PARSE_ACPI_HEADER (&AcpiHdrInfo
),
90 { L
"Interface Type", 1, 36, L
"%d", NULL
, NULL
, NULL
, NULL
},
91 { L
"Reserved", 3, 37, L
"%x %x %x", Dump3Chars
, NULL
, NULL
, NULL
},
92 { L
"Base Address", 12, 40, NULL
, DumpGas
, NULL
, NULL
, NULL
},
93 { L
"Interrupt Type", 1, 52, L
"%d", NULL
, NULL
, ValidateInterruptType
, NULL
},
94 { L
"IRQ", 1, 53, L
"%d", NULL
, NULL
, ValidateIrq
, NULL
},
95 { L
"Global System Interrupt", 4, 54, L
"0x%x", NULL
, NULL
, NULL
, NULL
},
96 { L
"Baud Rate", 1, 58, L
"%d", NULL
, NULL
, NULL
, NULL
},
97 { L
"Parity", 1, 59, L
"%d", NULL
, NULL
, NULL
, NULL
},
98 { L
"Stop Bits", 1, 60, L
"%d", NULL
, NULL
, NULL
, NULL
},
99 { L
"Flow Control", 1, 61, L
"0x%x", NULL
, NULL
, NULL
, NULL
},
100 { L
"Terminal Type", 1, 62, L
"%d", NULL
, NULL
, NULL
, NULL
},
101 { L
"Reserved", 1, 63, L
"%x", NULL
, NULL
, NULL
, NULL
},
103 { L
"PCI Device ID", 2, 64, L
"0x%x", NULL
, NULL
, NULL
, NULL
},
104 { L
"PCI Vendor ID", 2, 66, L
"0x%x", NULL
, NULL
, NULL
, NULL
},
105 { L
"PCI Bus Number", 1, 68, L
"0x%x", NULL
, NULL
, NULL
, NULL
},
106 { L
"PCI Device Number", 1, 69, L
"0x%x", NULL
, NULL
, NULL
, NULL
},
107 { L
"PCI Function Number", 1, 70, L
"0x%x", NULL
, NULL
, NULL
, NULL
},
108 { L
"PCI Flags", 4, 71, L
"0x%x", NULL
, NULL
, NULL
, NULL
},
109 { L
"PCI Segment", 1, 75, L
"0x%x", NULL
, NULL
, NULL
, NULL
},
110 { L
"Reserved", 4, 76, L
"%x", NULL
, NULL
, NULL
, NULL
}
114 This function parses the ACPI SPCR table.
115 When trace is enabled this function parses the SPCR table and
116 traces the ACPI table fields.
118 This function also performs validations of the ACPI table fields.
120 @param [in] Trace If TRUE, trace the ACPI fields.
121 @param [in] Ptr Pointer to the start of the buffer.
122 @param [in] AcpiTableLength Length of the ACPI table.
123 @param [in] AcpiTableRevision Revision of the ACPI table.
130 IN UINT32 AcpiTableLength
,
131 IN UINT8 AcpiTableRevision
145 PARSER_PARAMS (SpcrParser
)