diff mbox

[Linaro-uefi,2/2] Platforms/ARM/Juno: Use PCDs for Acpi DBG2

Message ID 20160715173259.23492-3-evan.lloyd@arm.com
State New
Headers show

Commit Message

Evan Lloyd July 15, 2016, 5:32 p.m. UTC
From: Evan Lloyd <evan.lloyd@arm.com>

The DBG2 table is used to publish the presence of debug ports available
on a system.  The original DBG2 used explicit constants for hardware
details.  That made it difficult to readilly adjust the use of serial
ports.  This change modifies the explicit constants to use PCDs, so the
serial port usage can be adjusted at build.  This can help avoid
problems when sharing ports (e.g. between UEFI trace and remote debug)
causes fails.

NOTE: Because this change does not modify the UART in use, the existing
      problems with serial debug are still present.  Changing to UART1
      is possible, but requires an update to the ARM Trusted Firmware to
      allow non-secure use of that UART.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
---
 Platforms/ARM/Juno/ArmJuno.dsc               | 6 +++++-
 Platforms/ARM/Juno/AcpiTables/AcpiTables.inf | 2 ++
 Platforms/ARM/Juno/AcpiTables/Dbg2.aslc      | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/Platforms/ARM/Juno/ArmJuno.dsc b/Platforms/ARM/Juno/ArmJuno.dsc
index 4f41fb159f193b3593048ce118fd0e8e97843809..9d141725342c36076323d0471127c7b15125794b 100644
--- a/Platforms/ARM/Juno/ArmJuno.dsc
+++ b/Platforms/ARM/Juno/ArmJuno.dsc
@@ -121,11 +121,15 @@  [PcdsFixedAtBuild.common]
 
   ## PL011 - Serial Terminal
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x7FF80000
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth|0
   gArmPlatformTokenSpaceGuid.PL011UartClkInHz|7372800
   gArmPlatformTokenSpaceGuid.PL011UartInterrupt|115
 
+  ## PL011 - Serial Debug UART
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x7FF80000
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|7372800
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate|115200
+
   ## PL031 RealTimeClock
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C170000
 
diff --git a/Platforms/ARM/Juno/AcpiTables/AcpiTables.inf b/Platforms/ARM/Juno/AcpiTables/AcpiTables.inf
index 2b063fbfb22781d7dc749b25a3ee5c7ca84d56e6..e099c02f39dad4bb19692c87a12d8d3d6f1da4b6 100644
--- a/Platforms/ARM/Juno/AcpiTables/AcpiTables.inf
+++ b/Platforms/ARM/Juno/AcpiTables/AcpiTables.inf
@@ -59,3 +59,5 @@  [FixedPcd]
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
   gArmPlatformTokenSpaceGuid.PL011UartClkInHz
   gArmPlatformTokenSpaceGuid.PL011UartInterrupt
+
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
diff --git a/Platforms/ARM/Juno/AcpiTables/Dbg2.aslc b/Platforms/ARM/Juno/AcpiTables/Dbg2.aslc
index 5621a98b91fdcaf425d86e27c418dda8ed3df4d5..be30cd0a655adae315448a5fe186fcb6ebab22f2 100644
--- a/Platforms/ARM/Juno/AcpiTables/Dbg2.aslc
+++ b/Platforms/ARM/Juno/AcpiTables/Dbg2.aslc
@@ -77,7 +77,7 @@  STATIC DBG2_TABLE Dbg2 = {
      */
     DBG2_DEBUG_PORT_DDI (DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,
                           EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART,
-                          0x7FF80000,
+                          FixedPcdGet64 (PcdSerialDbgRegisterBase),
                           PL011_UART_LENGTH,
                           NAME_STR_UART1),
   }