Subrata Banik | 8b9f289 | 2018-01-25 10:50:39 +0530 | [diff] [blame] | 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 |
Peter Lemenkov | 7bbe3bb | 2018-12-07 11:23:21 +0100 | [diff] [blame] | 4 | |
Subrata Banik | 8b9f289 | 2018-01-25 10:50:39 +0530 | [diff] [blame] | 5 | Copyright (c) 2007 - 2015, 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> |
Peter Lemenkov | 7bbe3bb | 2018-12-07 11:23:21 +0100 | [diff] [blame] | 8 | This program and the accompanying materials |
| 9 | are licensed and made available under the terms and conditions of the BSD License |
| 10 | which accompanies this distribution. The full text of the license may be found at |
| 11 | http://opensource.org/licenses/bsd-license.php |
Subrata Banik | 8b9f289 | 2018-01-25 10:50:39 +0530 | [diff] [blame] | 12 | |
Peter Lemenkov | 7bbe3bb | 2018-12-07 11:23:21 +0100 | [diff] [blame] | 13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, |
| 14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. |
Subrata Banik | 8b9f289 | 2018-01-25 10:50:39 +0530 | [diff] [blame] | 15 | **/ |
| 16 | |
| 17 | #ifndef _SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_H_ |
| 18 | #define _SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_H_ |
| 19 | |
| 20 | |
| 21 | #include <IndustryStandard/Acpi.h> |
| 22 | |
| 23 | // |
| 24 | // Ensure proper structure formats |
| 25 | // |
| 26 | #pragma pack(1) |
| 27 | |
| 28 | /// |
| 29 | /// SPCR Revision (defined in spec) |
| 30 | /// |
| 31 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION 0x02 |
| 32 | |
| 33 | /// |
| 34 | /// Serial Port Console Redirection Table Format |
| 35 | /// |
| 36 | typedef struct { |
| 37 | EFI_ACPI_DESCRIPTION_HEADER Header; |
| 38 | UINT8 InterfaceType; |
| 39 | UINT8 Reserved1[3]; |
| 40 | EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE BaseAddress; |
| 41 | UINT8 InterruptType; |
| 42 | UINT8 Irq; |
| 43 | UINT32 GlobalSystemInterrupt; |
| 44 | UINT8 BaudRate; |
| 45 | UINT8 Parity; |
| 46 | UINT8 StopBits; |
| 47 | UINT8 FlowControl; |
| 48 | UINT8 TerminalType; |
| 49 | UINT8 Reserved2; |
| 50 | UINT16 PciDeviceId; |
| 51 | UINT16 PciVendorId; |
| 52 | UINT8 PciBusNumber; |
| 53 | UINT8 PciDeviceNumber; |
| 54 | UINT8 PciFunctionNumber; |
| 55 | UINT32 PciFlags; |
| 56 | UINT8 PciSegment; |
| 57 | UINT32 Reserved3; |
| 58 | } EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE; |
| 59 | |
| 60 | #pragma pack() |
| 61 | |
| 62 | // |
| 63 | // SPCR Definitions |
| 64 | // |
| 65 | |
| 66 | // |
| 67 | // Interface Type |
| 68 | // |
| 69 | |
| 70 | /// |
| 71 | /// Full 16550 interface |
| 72 | /// |
| 73 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550 0 |
| 74 | /// |
| 75 | /// Full 16450 interface |
| 76 | /// |
| 77 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16450 1 |
| 78 | |
| 79 | |
| 80 | // |
| 81 | // The Serial Port Subtypes for ARM are documented in Table 3 of the DBG2 Specification |
| 82 | // |
| 83 | |
| 84 | /// |
| 85 | /// ARM PL011 UART |
| 86 | /// |
| 87 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART 0x03 |
| 88 | |
| 89 | /// |
| 90 | /// ARM SBSA Generic UART (2.x) supporting 32-bit only accesses [deprecated] |
| 91 | /// |
| 92 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_SBSA_GENERIC_UART_2X 0x0d |
| 93 | |
| 94 | /// |
| 95 | /// ARM SBSA Generic UART |
| 96 | /// |
| 97 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_SBSA_GENERIC_UART 0x0e |
| 98 | |
| 99 | // |
| 100 | // Interrupt Type |
| 101 | // |
| 102 | |
| 103 | /// |
| 104 | /// PC-AT-compatible dual-8259 IRQ interrupt |
| 105 | /// |
| 106 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_8259 0x1 |
| 107 | /// |
| 108 | /// I/O APIC interrupt (Global System Interrupt) |
| 109 | /// |
| 110 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC 0x2 |
| 111 | /// |
| 112 | /// I/O SAPIC interrupt (Global System Interrupt) |
| 113 | /// |
| 114 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_SAPIC 0x4 |
| 115 | /// |
| 116 | /// ARMH GIC interrupt (Global System Interrupt) |
| 117 | /// |
| 118 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC 0x8 |
| 119 | |
| 120 | // |
| 121 | // Baud Rate |
| 122 | // |
| 123 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600 3 |
| 124 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200 4 |
| 125 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600 6 |
| 126 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200 7 |
| 127 | |
| 128 | // |
| 129 | // Parity |
| 130 | // |
| 131 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY 0 |
| 132 | |
| 133 | // |
| 134 | // Stop Bits |
| 135 | // |
| 136 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1 1 |
| 137 | |
| 138 | // |
| 139 | // Flow Control |
| 140 | // |
| 141 | |
| 142 | /// |
| 143 | /// DCD required for transmit |
| 144 | /// |
| 145 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_DCD 0x1 |
| 146 | /// |
| 147 | /// RTS/CTS hardware flow control |
| 148 | /// |
| 149 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_RTS_CTS 0x2 |
| 150 | /// |
| 151 | /// XON/XOFF software control |
| 152 | /// |
| 153 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_FLOW_CONTROL_XON_XOFF 0x4 |
| 154 | |
| 155 | // |
| 156 | // Terminal Type |
| 157 | // |
| 158 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT100 0 |
| 159 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT100_PLUS 1 |
| 160 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8 2 |
| 161 | #define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_ANSI 3 |
| 162 | |
| 163 | #endif |