From ebef1b74218b53f72859b08f1d6710407789a14b Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Thu, 2 Aug 2012 14:22:51 +0000 Subject: ArmPlatformPkg/PL011Uart: PL011UartWrite() stop to transmit if the buffer is full Before we were waiting the buffer to be empty before to continue to send data. Signed-off-by: Olivier Martin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13587 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c index d728121b29..1f33bd1ef0 100644 --- a/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c +++ b/ArmPlatformPkg/Drivers/PL011Uart/PL011Uart.c @@ -304,10 +304,12 @@ PL011UartWrite ( IN UINTN NumberOfBytes ) { - UINTN Count; + UINT8* CONST Final = &Buffer[NumberOfBytes]; - for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) { - while ((MmioRead32 (UartBase + UARTFR) & UART_TX_EMPTY_FLAG_MASK) == 0); + while (Buffer < Final) { + // Wait until UART able to accept another char + while ((MmioRead32 (UartBase + UARTFR) & UART_TX_FULL_FLAG_MASK)); + MmioWrite8 (UartBase + UARTDR, *Buffer); } -- cgit v1.2.3