diff options
author | Prasanna T <ptprasanna@gmail.com> | 2022-07-08 17:22:44 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-07-20 10:06:25 +0530 |
commit | 4e21ccacd1cccec697df0651a0bd212edef8be4f (patch) | |
tree | f4bea010e2aa5a8c3573915c864b28f5ba4d0e12 /lib/utils/serial | |
parent | 0374ccf3f13e11f98da8158d9a5fa2a8607fe50e (diff) | |
download | opensbi-4e21ccacd1cccec697df0651a0bd212edef8be4f.zip opensbi-4e21ccacd1cccec697df0651a0bd212edef8be4f.tar.gz opensbi-4e21ccacd1cccec697df0651a0bd212edef8be4f.tar.bz2 |
lib: utils/serial: Update Shakti UART based on latest implementation
The age old version of Shakti UART was upgraded long back, but we missed
updating the driver in OpenSBI. The old version of UART is not supported
anymore, hence removed the inline comment which is also outdated now.
Signed-off-by: Prasanna T <ptprasanna@gmail.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Diffstat (limited to 'lib/utils/serial')
-rw-r--r-- | lib/utils/serial/shakti-uart.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/utils/serial/shakti-uart.c b/lib/utils/serial/shakti-uart.c index 5f2fe75..3556935 100644 --- a/lib/utils/serial/shakti-uart.c +++ b/lib/utils/serial/shakti-uart.c @@ -19,21 +19,21 @@ #define REG_RX_THRES 0x20 #define UART_TX_FULL 0x2 +#define UART_RX_NOT_EMPTY 0x4 #define UART_RX_FULL 0x8 static volatile char *uart_base; static void shakti_uart_putc(char ch) { - while((readw(uart_base + REG_STATUS) & UART_TX_FULL)) + while ((readb(uart_base + REG_STATUS) & UART_TX_FULL)) ; writeb(ch, uart_base + REG_TX); } static int shakti_uart_getc(void) { - u16 status = readw(uart_base + REG_STATUS); - if (status & UART_RX_FULL) + if (readb(uart_base + REG_STATUS) & UART_RX_NOT_EMPTY) return readb(uart_base + REG_RX); return -1; } |