]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
MdePkg: Replace BSD License with BSD+Patent License
[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 // Interrupt Type
95 //
96
97 ///
98 /// PC-AT-compatible dual-8259 IRQ interrupt
99 ///
100 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_8259 0x1
101 ///
102 /// I/O APIC interrupt (Global System Interrupt)
103 ///
104 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC 0x2
105 ///
106 /// I/O SAPIC interrupt (Global System Interrupt)
107 ///
108 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_SAPIC 0x4
109 ///
110 /// ARMH GIC interrupt (Global System Interrupt)
111 ///
112 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC 0x8
113
114 //
115 // Baud Rate
116 //
117 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600 3
118 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200 4
119 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600 6
120 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200 7
121
122 //
123 // Parity
124 //
125 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY 0
126
127 //
128 // Stop Bits
129 //
130 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1 1
131
132 //
133 // Flow Control
134 //
135
136 ///
137 /// DCD required for transmit
138 ///
139 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_DCD 0x1
140 ///
141 /// RTS/CTS hardware flow control
142 ///
143 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_RTS_CTS 0x2
144 ///
145 /// XON/XOFF software control
146 ///
147 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_XON_XOFF 0x4
148
149 //
150 // Terminal Type
151 //
152 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT100 0
153 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT100_PLUS 1
154 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8 2
155 #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_ANSI 3
156
157 #endif