From aadc64e6a15a4a71339c393a0eb01587cfbd5eb7 Mon Sep 17 00:00:00 2001 From: Evan Lloyd Date: Wed, 15 Jun 2016 13:52:39 +0100 Subject: ArmPlatformPkg: Update PL011 Serial PCDs to Fixed PCDs The PCDs used in the PL011 UART Driver and Serial Port Library are inherently "fixed at build". This change updates the source to use Fixed PCDs for these values. This improves clarity and efficiency. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sami Mujawar Signed-off-by: Evan Lloyd Tested-by: Ryan Harkin Reviewed-by: Ryan Harkin --- ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c') diff --git a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c index ab00cae26d..d0f9381e9e 100644 --- a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c +++ b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c @@ -168,17 +168,17 @@ PL011UartInitializePort ( // // If PL011 Integer value has been defined then always ignore the BAUD rate - if (PcdGet32 (PL011UartInteger) != 0) { - MmioWrite32 (UartBase + UARTIBRD, PcdGet32 (PL011UartInteger)); - MmioWrite32 (UartBase + UARTFBRD, PcdGet32 (PL011UartFractional)); + if (FixedPcdGet32 (PL011UartInteger) != 0) { + MmioWrite32 (UartBase + UARTIBRD, FixedPcdGet32 (PL011UartInteger)); + MmioWrite32 (UartBase + UARTFBRD, FixedPcdGet32 (PL011UartFractional)); } else { // If BAUD rate is zero then replace it with the system default value if (*BaudRate == 0) { - *BaudRate = PcdGet32 (PcdSerialBaudRate); + *BaudRate = FixedPcdGet32 (PcdSerialBaudRate); ASSERT (*BaudRate != 0); } - Divisor = (PcdGet32 (PL011UartClkInHz) * 4) / *BaudRate; + Divisor = (FixedPcdGet32 (PL011UartClkInHz) * 4) / *BaudRate; MmioWrite32 (UartBase + UARTIBRD, Divisor >> FRACTION_PART_SIZE_IN_BITS); MmioWrite32 (UartBase + UARTFBRD, Divisor & FRACTION_PART_MASK); } -- cgit v1.2.3