From: Olivier Martin Date: Wed, 19 Jun 2013 18:06:12 +0000 (+0000) Subject: ArmPlatformPkg/PL011Uart: Ignore BAUD rate if Integral non-zero X-Git-Tag: edk2-stable201903~12474 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=ec6b73d7a6c417cf139b25620787d5ac37c55390 ArmPlatformPkg/PL011Uart: Ignore BAUD rate if Integral non-zero Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14432 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c index 2b6741528b..9361205b19 100644 --- a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c +++ b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c @@ -130,19 +130,17 @@ PL011UartInitializePort ( // Baud Rate // - // If BaudRate is zero then use default baud rate - if (*BaudRate == 0) { - if (PcdGet32 (PL011UartInteger) != 0) { + // If PL011 Integral value has been defined then always ignore the BAUD rate + if (PcdGet32 (PL011UartInteger) != 0) { MmioWrite32 (UartBase + UARTIBRD, PcdGet32 (PL011UartInteger)); MmioWrite32 (UartBase + UARTFBRD, PcdGet32 (PL011UartFractional)); - } else { + } else { + // If BAUD rate is zero then replace it with the system default value + if (*BaudRate == 0) { *BaudRate = PcdGet32 (PcdSerialBaudRate); ASSERT (*BaudRate != 0); } - } - // If BaudRate != 0 then we must calculate the divisor from the value - if (*BaudRate != 0) { Divisor = (PcdGet32 (PL011UartClkInHz) * 4) / *BaudRate; MmioWrite32 (UartBase + UARTIBRD, Divisor >> 6); MmioWrite32 (UartBase + UARTFBRD, Divisor & 0x3F);