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