Revision: 14432
          http://sourceforge.net/p/edk2/code/14432
Author:   oliviermartin
Date:     2013-06-19 18:06:12 +0000 (Wed, 19 Jun 2013)
Log Message:
-----------
ArmPlatformPkg/PL011Uart: Ignore BAUD rate if Integral non-zero

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c

Modified: trunk/edk2/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c
===================================================================
--- trunk/edk2/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c     2013-06-19 
18:03:12 UTC (rev 14431)
+++ trunk/edk2/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c     2013-06-19 
18:06:12 UTC (rev 14432)
@@ -130,19 +130,17 @@
   // 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);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to