summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/ArmJunoPkg
diff options
context:
space:
mode:
authorEvan Lloyd <evan.lloyd@arm.com>2016-06-20 19:43:04 +0100
committerLeif Lindholm <leif.lindholm@linaro.org>2016-07-07 17:55:34 +0100
commit0312b14df6bb9b7ac9c3a4fda663408245d44294 (patch)
tree5463d1c8a0ea914a4d103023bd2310e6c7b8681a /ArmPlatformPkg/ArmJunoPkg
parent80f7a8f5f9d21f8315d39be0f5651ce7160594fc (diff)
downloadedk2-platforms-0312b14df6bb9b7ac9c3a4fda663408245d44294.tar.xz
ArmPlatformPkg: Set Juno debug serial port defaults
Juno has several serial ports, one of which may be used for a remote debug interface (e.g. gdb, WinDbg). The debug serial port needs to be distinct from that used for UEFI trace to prevent corruption of debugger protocol messaging. The UEFI spec requires that serial devices be initialised to default settings. (11.8 Serial I/O Protocol - "The default attributes for all UART-style serial device interfaces are: 115,200 baud, ..." and 17.3.3 EFI Debugport Variable - "These defaults must be used in the absence of a DEBUGPORT variable...") This change adds initialization of the serial device reported in the ACPI DBG2 table. The initialisation is done early in the boot to allow the possibility of remote debug of UEFI itself. NOTE: This is functionally dependent on the DBG2 table being updated in OpenPlatformPkg, but is required as a precursor to that change. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg/ArmJunoPkg')
-rw-r--r--ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJuno.c36
-rw-r--r--ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoLib.inf15
2 files changed, 48 insertions, 3 deletions
diff --git a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJuno.c b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJuno.c
index ffff562824..4a57ec5517 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJuno.c
+++ b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJuno.c
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2013-2014, ARM Limited. All rights reserved.
+* Copyright (c) 2013-2016, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
@@ -12,6 +12,8 @@
*
**/
+#include <Drivers/PL011Uart.h>
+
#include <Library/IoLib.h>
#include <Library/ArmPlatformLib.h>
#include <Library/DebugLib.h>
@@ -112,7 +114,37 @@ ArmPlatformInitialize (
IN UINTN MpId
)
{
- return RETURN_SUCCESS;
+ RETURN_STATUS Status;
+ UINT64 BaudRate;
+ UINT32 ReceiveFifoDepth;
+ EFI_PARITY_TYPE Parity;
+ UINT8 DataBits;
+ EFI_STOP_BITS_TYPE StopBits;
+
+ Status = RETURN_SUCCESS;
+
+ //
+ // Initialize the Serial Debug UART
+ //
+ if (FixedPcdGet64 (PcdSerialDbgRegisterBase)) {
+ ReceiveFifoDepth = 0; // Use the default value for FIFO depth
+ Parity = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity);
+ DataBits = FixedPcdGet8 (PcdUartDefaultDataBits);
+ StopBits = (EFI_STOP_BITS_TYPE)FixedPcdGet8 (PcdUartDefaultStopBits);
+
+ BaudRate = (UINTN)FixedPcdGet64 (PcdSerialDbgUartBaudRate);
+ Status = PL011UartInitializePort (
+ (UINTN)FixedPcdGet64 (PcdSerialDbgRegisterBase),
+ FixedPcdGet32 (PcdSerialDbgUartClkInHz),
+ &BaudRate,
+ &ReceiveFifoDepth,
+ &Parity,
+ &DataBits,
+ &StopBits
+ );
+ }
+
+ return Status;
}
/**
diff --git a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoLib.inf b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
index 8c8b141c35..77d18f855a 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
+++ b/ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2013-2015, ARM Limited. All rights reserved.
+# Copyright (c) 2013-2016, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -57,6 +57,19 @@
gArmJunoTokenSpaceGuid.PcdPciConfigurationSpaceBaseAddress
gArmJunoTokenSpaceGuid.PcdPciConfigurationSpaceSize
+
+ #
+ # PL011 Serial Debug UART
+ #
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz
+
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
+
[Pcd]
gArmTokenSpaceGuid.PcdPciMmio32Base
gArmTokenSpaceGuid.PcdPciMmio32Size