summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c')
-rw-r--r--ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
index 801990d955..f1015b1fce 100644
--- a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
+++ b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
@@ -78,10 +78,14 @@ PL011UartInitializePort (
UINT32 Integer;
UINT32 Fractional;
UINT32 HardwareFifoDepth;
+ UINT32 UartPid2;
+
+ HardwareFifoDepth = FixedPcdGet16 (PcdUartDefaultReceiveFifoDepth);
+ if (HardwareFifoDepth == 0) {
+ UartPid2 = MmioRead32 (UartBase + UARTPID2);
+ HardwareFifoDepth = (PL011_UARTPID2_VER (UartPid2) > PL011_VER_R1P4) ? 32 : 16;
+ }
- HardwareFifoDepth = (PL011_UARTPID2_VER (MmioRead32 (UartBase + UARTPID2)) \
- > PL011_VER_R1P4) \
- ? 32 : 16 ;
// The PL011 supports a buffer of 1, 16 or 32 chars. Therefore we can accept
// 1 char buffer as the minimum FIFO size. Because everything can be rounded
// down, there is no maximum FIFO size.