summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2013-06-19 18:06:12 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2013-06-19 18:06:12 +0000
commitec6b73d7a6c417cf139b25620787d5ac37c55390 (patch)
tree75c3bf06d8343bcc25bec7f3bcf1fc335f1ddc55 /ArmPlatformPkg
parentc57482d11c8fdf6f70588b25c6e952c006a20c5c (diff)
downloadedk2-platforms-ec6b73d7a6c417cf139b25620787d5ac37c55390.tar.xz
ArmPlatformPkg/PL011Uart: Ignore BAUD rate if Integral non-zero
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14432 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c12
1 files changed, 5 insertions, 7 deletions
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);