diff options
author | Evan Lloyd <evan.lloyd@arm.com> | 2016-06-27 12:58:20 +0100 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2016-06-27 17:59:12 +0100 |
commit | ce9c1b7dbb2f5d506240626c77b685adbdeeda8e (patch) | |
tree | 67bf301042d9151b42606e2540ba40ee78b2a42e /Platforms | |
parent | da8028953453e9b8ef5f209b8297af6c04a28e1b (diff) |
Platforms/ARM/Juno: Use PCDs for SPCR info
The original SPCR 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 where
sharing ports (e.g. between UEFI trace and host debug) causes fails.
Because the SPCR baud rate selection does not map directly to the PCD
used, a compile time error has been added for baud rates not matching
the SPCR specification. This is beneficial as it is quite difficult
to diagnose an invalid baud rate otherwise.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'Platforms')
-rw-r--r-- | Platforms/ARM/Juno/AcpiTables/AcpiTables.inf | 8 | ||||
-rw-r--r-- | Platforms/ARM/Juno/AcpiTables/Spcr.aslc | 14 | ||||
-rw-r--r-- | Platforms/ARM/Juno/ArmJuno.dsc | 1 |
3 files changed, 21 insertions, 2 deletions
diff --git a/Platforms/ARM/Juno/AcpiTables/AcpiTables.inf b/Platforms/ARM/Juno/AcpiTables/AcpiTables.inf index 3caf4af..d62068d 100644 --- a/Platforms/ARM/Juno/AcpiTables/AcpiTables.inf +++ b/Platforms/ARM/Juno/AcpiTables/AcpiTables.inf @@ -51,3 +51,11 @@ gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
+
+ #
+ # PL011 UART Settings for Serial Port Console Redirection
+ #
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
+ gArmPlatformTokenSpaceGuid.PL011UartClkInHz
+ gArmPlatformTokenSpaceGuid.PL011UartInterrupt
diff --git a/Platforms/ARM/Juno/AcpiTables/Spcr.aslc b/Platforms/ARM/Juno/AcpiTables/Spcr.aslc index 6fea989..8371669 100644 --- a/Platforms/ARM/Juno/AcpiTables/Spcr.aslc +++ b/Platforms/ARM/Juno/AcpiTables/Spcr.aslc @@ -45,15 +45,25 @@ STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = { EFI_ACPI_RESERVED_BYTE
},
// EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE BaseAddress;
- ARM_GAS32 (0x7FF80000),
+ ARM_GAS32 (FixedPcdGet64 (PcdSerialRegisterBase)),
// UINT8 InterruptType;
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC,
// UINT8 Irq;
0, // Not used on ARM
// UINT32 GlobalSystemInterrupt;
- 0x73,
+ FixedPcdGet32 (PL011UartInterrupt),
// UINT8 BaudRate;
+#if (FixedPcdGet64 (PcdUartDefaultBaudRate) == 9600)
+ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600,
+#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) == 19200)
+ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200,
+#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) == 57600)
+ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600,
+#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) == 115200)
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,
+#else
+#error Unsupported SPCR Baud Rate
+#endif
// UINT8 Parity;
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,
// UINT8 StopBits;
diff --git a/Platforms/ARM/Juno/ArmJuno.dsc b/Platforms/ARM/Juno/ArmJuno.dsc index 2caa741..3626dfb 100644 --- a/Platforms/ARM/Juno/ArmJuno.dsc +++ b/Platforms/ARM/Juno/ArmJuno.dsc @@ -124,6 +124,7 @@ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth|0
gArmPlatformTokenSpaceGuid.PL011UartInteger|4
gArmPlatformTokenSpaceGuid.PL011UartFractional|0
+ gArmPlatformTokenSpaceGuid.PL011UartInterrupt|115
## PL031 RealTimeClock
gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C170000
|