Files
Sunny Wang ea709f165d Platform/RaspberryPi: Dynamically build UARTs info in ACPI
Changes:
  1. Add code to ConfigDxe driver and AcpiTables module to dynamically
     build either Mini UART or PL011 UART info in ACPI. This also fixes
     the issue discussed in https://github.com/pftf/RPi4/issues/118.
  2. Cleanup by moving duplicate Debug Port 2 table related defines and
     structures to a newly created header file (RpiDebugPort2Table.h).

Testing Done:
  - Booted to UEFI shell and use acpiview command to check the result of
    the different UART settings in config.txt (enabling either Mini UART
    or PL011) and SPCR, DBG2 tables and device BTH0 are dynamically
    changed as expected.

Signed-off-by: Sunny Wang <sunny.wang@arm.com>
Reviewed-by: Pete Batard <pete@akeo.ie>
Tested-by: Pete Batard <pete@akeo.ie>
2021-06-12 22:02:25 +02:00

34 lines
1.1 KiB
C

/** @file
Copyright (c) 2021, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __RPI_DEBUG_PORT_2_H__
#define __RPI_DEBUG_PORT_2_H__
#include <IndustryStandard/DebugPort2Table.h>
#define RPI_DBG2_NUM_DEBUG_PORTS 1
#define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1
#define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 15
#pragma pack(1)
typedef struct {
EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device;
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister;
UINT32 AddressSize;
UINT8 NameSpaceString[RPI_DBG2_NAMESPACESTRING_FIELD_SIZE];
} DBG2_DEBUG_DEVICE_INFORMATION;
typedef struct {
EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description;
DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[RPI_DBG2_NUM_DEBUG_PORTS];
} DBG2_TABLE;
#pragma pack()
#endif //__RPI_DEBUG_PORT_2_H__