1 | /*
|
---|
2 | * Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
|
---|
3 | * Copyright (c) 2015, Nahanni Systems, Inc.
|
---|
4 | *
|
---|
5 | * SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "Platform.h"
|
---|
9 |
|
---|
10 | #define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('B','V','S','P','C','R',' ',' ')
|
---|
11 |
|
---|
12 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE SPCR = {
|
---|
13 | {
|
---|
14 | EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
|
---|
15 | sizeof (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE),
|
---|
16 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION,
|
---|
17 | 0, // to make sum of entire table == 0
|
---|
18 | {EFI_ACPI_OEM_ID}, // OEMID is a 6 bytes long field
|
---|
19 | EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
|
---|
20 | EFI_ACPI_OEM_REVISION, // OEM revision number
|
---|
21 | EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
|
---|
22 | EFI_ACPI_CREATOR_REVISION // ASL compiler revision number
|
---|
23 | },
|
---|
24 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550,
|
---|
25 | { 0 }, // Reserved
|
---|
26 | { // BaseAddress
|
---|
27 | 0x01, // AddressSpaceId
|
---|
28 | 0x08, // RegisterBitWidth
|
---|
29 | 0x00, // RegisterBitOffset
|
---|
30 | 0x00, // Reserved
|
---|
31 | 0x03F8 // Address (COM1)
|
---|
32 | },
|
---|
33 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_8259,
|
---|
34 | 4, // Irq
|
---|
35 | 0, // GlobalSystemInterrupt
|
---|
36 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,
|
---|
37 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,
|
---|
38 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1,
|
---|
39 | 0x03, // FlowControl: RTS/CTS | DCD
|
---|
40 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8,
|
---|
41 | 0, // Language
|
---|
42 | 0, // PciDeviceId
|
---|
43 | 0, // PciVendorId
|
---|
44 | 0, // PciBusNumber
|
---|
45 | 0, // PciDeviceNumber
|
---|
46 | 0, // PciFunctionNumber
|
---|
47 | 0, // PciFlags
|
---|
48 | 0, // PciSegment
|
---|
49 | 0 // Reserved
|
---|
50 | };
|
---|
51 |
|
---|
52 |
|
---|
53 | VOID *
|
---|
54 | ReferenceAcpiTable (
|
---|
55 | VOID
|
---|
56 | )
|
---|
57 | {
|
---|
58 | //
|
---|
59 | // Reference the table being generated to prevent the optimizer from removing the
|
---|
60 | // data structure from the exeutable
|
---|
61 | //
|
---|
62 | return (VOID*)&SPCR;
|
---|
63 | }
|
---|