blob: 1a2ce05860c7d9f1659342dd2586cb356ce4832c [file] [log] [blame]
Subrata Banik20fe24b2021-12-09 02:46:38 +05301/** @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///
30typedef 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/// NVIDIA 16550 UART
85///
86#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_NVIDIA_16550_UART 0x05
87
88///
89/// ARM SBSA Generic UART (2.x) supporting 32-bit only accesses [deprecated]
90///
91#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_SBSA_GENERIC_UART_2X 0x0d
92
93///
94/// ARM SBSA Generic UART
95///
96#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_SBSA_GENERIC_UART 0x0e
97
98///
99/// ARM DCC
100///
101#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_DCC 0x0f
102
103///
104/// BCM2835 UART
105///
106#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART 0x10
107
108///
109/// 16550-compatible with parameters defined in Generic Address Structure
110///
111#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550_WITH_GAS 0x12
112
113//
114// Interrupt Type
115//
116
117///
118/// PC-AT-compatible dual-8259 IRQ interrupt
119///
120#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_8259 0x1
121///
122/// I/O APIC interrupt (Global System Interrupt)
123///
124#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC 0x2
125///
126/// I/O SAPIC interrupt (Global System Interrupt)
127///
128#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_SAPIC 0x4
129///
130/// ARMH GIC interrupt (Global System Interrupt)
131///
132#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC 0x8
133
134//
135// Baud Rate
136//
137#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600 3
138#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200 4
139#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600 6
140#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200 7
141
142//
143// Parity
144//
145#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY 0
146
147//
148// Stop Bits
149//
150#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1 1
151
152//
153// Flow Control
154//
155
156///
157/// DCD required for transmit
158///
159#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_DCD 0x1
160///
161/// RTS/CTS hardware flow control
162///
163#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_RTS_CTS 0x2
164///
165/// XON/XOFF software control
166///
167#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_XON_XOFF 0x4
168
169//
170// Terminal Type
171//
172#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT100 0
173#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT100_PLUS 1
174#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8 2
175#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_ANSI 3
176
177#endif