hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/** @file
*  Serial Port Console Redirection Table (SPCR).
*
*  Copyright (c) 2020 Linaro Ltd. All rights reserved.
*
*  SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/
 
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/SbsaQemuAcpi.h>
#include <IndustryStandard/SerialPortConsoleRedirectionTable.h>
 
#pragma pack(push, 1)
 
STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
  SBSAQEMU_ACPI_HEADER (
    EFI_ACPI_6_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
    EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
    2), /* New MS definition for PL011 support */
  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART,
  { EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE },
  {
    EFI_ACPI_6_0_SYSTEM_MEMORY,
    32,
    0,
    EFI_ACPI_6_0_DWORD,
    FixedPcdGet32 (PcdSerialRegisterBase)
  },
  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC,
  0,                      /* Irq */
  33,                     /* GlobalSystemInterrupt */
  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,
  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,
  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1,
  0,                      /* Flow Control */
  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_ANSI,
  EFI_ACPI_RESERVED_BYTE, /* Language */
  0xFFFF,                 /* PciDeviceId */
  0xFFFF,                 /* PciVendorId */
  0x00,                   /* PciBusNumber */
  0x00,                   /* PciDeviceNumber */
  0x00,                   /* PciFunctionNumber */
  0,                      /* PciFlags */
  0,                      /* PciSegment */
  EFI_ACPI_RESERVED_DWORD
};
 
#pragma pack(pop)
 
// Reference the table being generated to prevent the optimizer from removing
// the data structure from the executable
VOID* CONST ReferenceAcpiTable = &Spcr;