]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c
ArmPlatformPkg: detect correct pl011 fifo depth
[mirror_edk2.git] / ArmPlatformPkg / Drivers / PL011Uart / PL011Uart.c
index 7e74a05df7fcdea37621da6a56f8a6b7caa8ba55..8b256de945d2115bf98de16e890bf944afc470a6 100644 (file)
@@ -50,12 +50,15 @@ PL011UartInitializePort (
 \r
   LineControl = 0;\r
 \r
-  // The PL011 supports a buffer of either 1 or 32 chars. Therefore we can accept\r
+  // The PL011 supports a buffer of 1, 16 or 32 chars. Therefore we can accept\r
   // 1 char buffer as the minimum fifo size. Because everything can be rounded down,\r
   // there is no maximum fifo size.\r
   if ((*ReceiveFifoDepth == 0) || (*ReceiveFifoDepth >= 32)) {\r
     LineControl |= PL011_UARTLCR_H_FEN;\r
-    *ReceiveFifoDepth = 32;\r
+    if (PL011_UARTPID2_VER (MmioRead32 (UartBase + UARTPID2)) > PL011_VER_R1P4)\r
+      *ReceiveFifoDepth = 32;\r
+    else\r
+      *ReceiveFifoDepth = 16;\r
   } else {\r
     ASSERT (*ReceiveFifoDepth < 32);\r
     // Nothing else to do. 1 byte fifo is default.\r