9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f9bd437d6152e34ab5f1f0d661cbe0e722d19b93
parent 9e6e8186f0731876c879eb750ff3a6d1ae50a74b
Author: Dimitris Papastamos <dimitris.papastamos@arm.com>
Date:   Tue, 27 Nov 2018 16:27:47 +0000

[pl011] Remove retry counts

Change-Id: If66d80b861289148ac19a582f8118856c7036d93
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>

Diffstat:
Mdrivers/pl011.c | 25++++++-------------------
1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/pl011.c b/drivers/pl011.c @@ -2,8 +2,6 @@ #include <rcode.h> #include <romfw.h> -#define NRETRY 10000 - #define CR 0x30 #define FBRD 0x28 #define IBRD 0x24 @@ -39,12 +37,9 @@ static void flush(void) { char *base = bss->uartbase; - int nretry = NRETRY; - while (nretry-- > 0) - if (!((inm32(base + CR) & CR_EN) && - (inm32(base + FR) & FR_TXFE))) - break; + while ((inm32(base + CR) & CR_EN) && (inm32(base + FR) & FR_TXFE)) + ; } static void @@ -72,13 +67,9 @@ int uartgetc(void) { char *base = bss->uartbase; - int nretry = NRETRY; - while (nretry-- > 0) - if (!(inm32(base + FR) & FR_RXFE)) - break; - if (nretry == 0) - return -1; + while ((inm32(base + FR) & FR_RXFE)) + ; return inm8(base + DR); } @@ -86,13 +77,9 @@ int uartputc(int c) { char *base = bss->uartbase; - int nretry = NRETRY; - while (nretry-- > 0) - if (!(inm32(base + FR) & FR_TXFF)) - break; - if (nretry == 0) - return -1; + while ((inm32(base + FR) & FR_TXFF)) + ; outm8(c, base + DR); return c; }