diff options
Diffstat (limited to 'src/drivers/uart')
-rw-r--r-- | src/drivers/uart/Kconfig | 5 | ||||
-rw-r--r-- | src/drivers/uart/uart8250mem.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/drivers/uart/Kconfig b/src/drivers/uart/Kconfig index fef745e418..cbfd47954a 100644 --- a/src/drivers/uart/Kconfig +++ b/src/drivers/uart/Kconfig @@ -17,6 +17,11 @@ config DRIVERS_UART_8250MEM bool default n +config DRIVERS_UART_8250MEM_32 + bool + default n + depends on DRIVERS_UART_8250MEM + config HAVE_UART_SPECIAL bool default n diff --git a/src/drivers/uart/uart8250mem.c b/src/drivers/uart/uart8250mem.c index 2f341f2d6e..d276fd0410 100644 --- a/src/drivers/uart/uart8250mem.c +++ b/src/drivers/uart/uart8250mem.c @@ -34,6 +34,17 @@ #define SINGLE_CHAR_TIMEOUT (50 * 1000) #define FIFO_TIMEOUT (16 * SINGLE_CHAR_TIMEOUT) +#if IS_ENABLED(CONFIG_DRIVERS_UART_8250MEM_32) +static uint8_t uart8250_read(void *base, uint8_t reg) +{ + return read32(base + 4 * reg) & 0xff; +} + +static void uart8250_write(void *base, uint8_t reg, uint8_t data) +{ + write32(base + 4 * reg, data); +} +#else static uint8_t uart8250_read(void *base, uint8_t reg) { return read8(base + reg); @@ -43,6 +54,7 @@ static void uart8250_write(void *base, uint8_t reg, uint8_t data) { write8(base + reg, data); } +#endif static int uart8250_mem_can_tx_byte(void *base) { |