]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
eb5ae2839007c43ed50e666299012430214e603d
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / SerialPortConsoleRedirectionTable.h
1 /** @file
2 ACPI Serial Port Console Redirection Table as defined by Microsoft in
3 http://www.microsoft.com/whdc/system/platform/server/spcr.mspx
4
5 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
7 Copyright (c) 2014 - 2016, ARM Limited. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9 **/
10
11 #ifndef _SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_H_
12 #define _SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_H_
13
14 #include <IndustryStandard/Acpi.h>
15
16 //
17 // Ensure proper structure formats
18 //
19 #pragma pack(1)
20
21 ///
22 /// SPCR Revision (defined in spec)
23 ///
24 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION 0x02
25
26 ///
27 /// Serial Port Console Redirection Table Format
28 ///
29 typedef struct {
30 EFI_ACPI_DESCRIPTION_HEADER Header;
31 UINT8 InterfaceType;
32 UINT8 Reserved1[3];
33 EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE BaseAddress;
34 UINT8 InterruptType;
35 UINT8 Irq;
36 UINT32 GlobalSystemInterrupt;
37 UINT8 BaudRate;
38 UINT8 Parity;
39 UINT8 StopBits;
40 UINT8 FlowControl;
41 UINT8 TerminalType;
42 UINT8 Reserved2;
43 UINT16 PciDeviceId;
44 UINT16 PciVendorId;
45 UINT8 PciBusNumber;
46 UINT8 PciDeviceNumber;
47 UINT8 PciFunctionNumber;
48 UINT32 PciFlags;
49 UINT8 PciSegment;
50 UINT32 Reserved3;
51 } EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE;
52
53 #pragma pack()
54
55 //
56 // SPCR Definitions
57 //
58
59 //
60 // Interface Type
61 //
62
63 ///
64 /// Full 16550 interface
65 ///
66 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550 0
67 ///
68 /// Full 16450 interface
69 ///
70 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16450 1
71
72 //
73 // The Serial Port Subtypes for ARM are documented in Table 3 of the DBG2 Specification
74 //
75
76 ///
77 /// ARM PL011 UART
78 ///
79 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART 0x03
80
81 ///
82 /// NVIDIA 16550 UART
83 ///
84 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_NVIDIA_16550_UART 0x05
85
86 ///
87 /// ARM SBSA Generic UART (2.x) supporting 32-bit only accesses [deprecated]
88 ///
89 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_SBSA_GENERIC_UART_2X 0x0d
90
91 ///
92 /// ARM SBSA Generic UART
93 ///
94 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_SBSA_GENERIC_UART 0x0e
95
96 ///
97 /// ARM DCC
98 ///
99 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_DCC 0x0f
100
101 ///
102 /// BCM2835 UART
103 ///
104 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART 0x10
105
106 ///
107 /// 16550-compatible with parameters defined in Generic Address Structure
108 ///
109 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550_WITH_GAS 0x12
110
111 //
112 // Interrupt Type
113 //
114
115 ///
116 /// PC-AT-compatible dual-8259 IRQ interrupt
117 ///
118 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_8259 0x1
119 ///
120 /// I/O APIC interrupt (Global System Interrupt)
121 ///
122 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC 0x2
123 ///
124 /// I/O SAPIC interrupt (Global System Interrupt)
125 ///
126 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_SAPIC 0x4
127 ///
128 /// ARMH GIC interrupt (Global System Interrupt)
129 ///
130 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC 0x8
131
132 //
133 // Baud Rate
134 //
135 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600 3
136 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200 4
137 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600 6
138 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200 7
139
140 //
141 // Parity
142 //
143 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY 0
144
145 //
146 // Stop Bits
147 //
148 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1 1
149
150 //
151 // Flow Control
152 //
153
154 ///
155 /// DCD required for transmit
156 ///
157 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_DCD 0x1
158 ///
159 /// RTS/CTS hardware flow control
160 ///
161 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_RTS_CTS 0x2
162 ///
163 /// XON/XOFF software control
164 ///
165 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_XON_XOFF 0x4
166
167 //
168 // Terminal Type
169 //
170 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT100 0
171 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT100_PLUS 1
172 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8 2
173 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_ANSI 3
174
175 #endif