• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/** @file
2*  Serial Port Console Redirection Table (SPCR)
3*
4*  Copyright (c) 2012 - 2015, Linaro Limited. All rights reserved.
5*
6*  This program and the accompanying materials
7*  are licensed and made available under the terms and conditions of the BSD License
8*  which accompanies this distribution.  The full text of the license may be found at
9*  http://opensource.org/licenses/bsd-license.php
10*
11*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13*
14*  Based on the files under ArmPlatformPkg/ArmJunoPkg/AcpiTables/
15*
16**/
17
18#include <Library/AcpiLib.h>
19#include <Library/PcdLib.h>
20#include <IndustryStandard/Acpi.h>
21#include <IndustryStandard/SerialPortConsoleRedirectionTable.h>
22#include "Pv660Platform.h"
23
24EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
25  //Header;
26  ARM_ACPI_HEADER(
27    EFI_ACPI_5_1_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
28    EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
29    EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION
30  ),
31  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550, //InterfaceType;
32  {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, //Reserved1[3];
33  //BaseAddress;
34  {
35    EFI_ACPI_6_0_SYSTEM_MEMORY,
36    32,
37    0,
38    EFI_ACPI_6_0_BYTE,
39    FixedPcdGet64(PcdSerialRegisterBase)
40  },
41  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC, //InterruptType;
42  0, //Irq;
43  349, //GlobalSystemInterrupt;
44  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,   //BaudRate;
45  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,   //Parity;
46  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1,        //StopBits;
47  0, //FlowControl;
48  EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_ANSI, //TerminalType;
49  EFI_ACPI_RESERVED_BYTE, //Language;
50  0xFFFF, //PciDeviceId;
51  0xFFFF, //PciVendorId;
52  0,      //PciBusNumber;
53  0,      //PciDeviceNumber;
54  0,      //PciFunctionNumber;
55  0,      //PciFlags;
56  0,      //PciSegment;
57  EFI_ACPI_RESERVED_DWORD  //Reserved2;
58};
59
60//
61// Reference the table being generated to prevent the optimizer from removing the
62// data structure from the executable
63//
64VOID* CONST ReferenceAcpiTable = &Spcr;
65