diff options
author | Olivier Martin <olivier.martin@arm.com> | 2013-06-19 18:06:12 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-06-19 18:06:12 +0000 |
commit | ec6b73d7a6c417cf139b25620787d5ac37c55390 (patch) | |
tree | 75c3bf06d8343bcc25bec7f3bcf1fc335f1ddc55 /ArmPlatformPkg/Drivers | |
parent | c57482d11c8fdf6f70588b25c6e952c006a20c5c (diff) | |
download | edk2-ec6b73d7a6c417cf139b25620787d5ac37c55390.zip edk2-ec6b73d7a6c417cf139b25620787d5ac37c55390.tar.gz edk2-ec6b73d7a6c417cf139b25620787d5ac37c55390.tar.bz2 |
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/Drivers')
-rw-r--r-- | ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c index 2b67415..9361205 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);
|