Home | History | Annotate | Download | only in AcpiTables
      1 /** @file
      2 * SPCR Table
      3 *
      4 * Copyright (c) 2014 - 2016, ARM Limited. All rights reserved.
      5 * Copyright (c) 2016, Linaro Ltd. All rights reserved.
      6 *
      7 * This program and the accompanying materials are licensed and made available
      8 * under the terms and conditions of the BSD License which accompanies this
      9 * distribution.  The full text of the license may be found at
     10 * http://opensource.org/licenses/bsd-license.php
     11 *
     12 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     13 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     14 *
     15 **/
     16 
     17 #include "FvpPlatform.h"
     18 #include <Library/AcpiLib.h>
     19 #include <IndustryStandard/Acpi61.h>
     20 #include <IndustryStandard/SerialPortConsoleRedirectionTable.h>
     21 
     22 /**
     23  * References:
     24  * Serial Port Console Redirection Table Specification Version 1.03 - August 10, 2015
     25  **/
     26 
     27 
     28 ///
     29 /// SPCR Flow Control
     30 ///
     31 #define SPCR_FLOW_CONTROL_NONE           0
     32 
     33 
     34 STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
     35   ARM_ACPI_HEADER (EFI_ACPI_6_1_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
     36                      EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
     37                      EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION),
     38   // UINT8                                   InterfaceType;
     39   EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART,
     40   // UINT8                                   Reserved1[3];
     41   {
     42     EFI_ACPI_RESERVED_BYTE,
     43     EFI_ACPI_RESERVED_BYTE,
     44     EFI_ACPI_RESERVED_BYTE
     45   },
     46   // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  BaseAddress;
     47   ARM_GAS32 (0x1C090000),
     48   // UINT8                                   InterruptType;
     49   EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC,
     50   // UINT8                                   Irq;
     51   0,                                         // Not used on ARM
     52   // UINT32                                  GlobalSystemInterrupt;
     53   0x25,
     54   // UINT8                                   BaudRate;
     55   EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,
     56   // UINT8                                   Parity;
     57   EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,
     58   // UINT8                                   StopBits;
     59   EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1,
     60   // UINT8                                   FlowControl;
     61   SPCR_FLOW_CONTROL_NONE,
     62   // UINT8                                   TerminalType;
     63   EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_ANSI,
     64   // UINT8                                   Reserved2;
     65   EFI_ACPI_RESERVED_BYTE,
     66   // UINT16                                  PciDeviceId;
     67   0xFFFF,
     68   // UINT16                                  PciVendorId;
     69   0xFFFF,
     70   // UINT8                                   PciBusNumber;
     71   0x00,
     72   // UINT8                                   PciDeviceNumber;
     73   0x00,
     74   // UINT8                                   PciFunctionNumber;
     75   0x00,
     76   // UINT32                                  PciFlags;
     77   0x00000000,
     78   // UINT8                                   PciSegment;
     79   0x00,
     80   // UINT32                                  Reserved3;
     81   EFI_ACPI_RESERVED_DWORD
     82 };
     83 
     84 //
     85 // Reference the table being generated to prevent the optimizer from removing the
     86 // data structure from the executable
     87 //
     88 VOID* CONST ReferenceAcpiTable = &Spcr;
     89