Skip to content
Permalink
Browse files

drivers: ns16550: add WORD only access support

In some hardware,e.g. ARC HS Development kit,the
peripheral space of ns16550 only allowes WORD
access,  byte acess will raise bus error.

This commit adds support for this case

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
  • Loading branch information...
vonhust authored and ioannisg committed May 29, 2019
1 parent 5a0acd5 commit 4fb8bf61c02a5c9534201e5aefa50abeecb7393d
Showing with 16 additions and 0 deletions.
  1. +9 −0 drivers/serial/Kconfig.ns16550
  2. +7 −0 drivers/serial/uart_ns16550.c
@@ -32,6 +32,15 @@ config UART_NS16750
help
This enables support for 64-bytes FIFO if UART controller is 16750.

config UART_NS16550_ACCESS_WORD_ONLY
bool "NS16550 only allows word access"
default n
depends on UART_NS16550
help
In some case, e.g. ARC HS Development kit, the peripheral space of ns
16550 (DesignWare UART) only allows word access, byte access will raise
exception.

# ---------- Port 0 ----------

menuconfig UART_NS16550_PORT_0
@@ -241,6 +241,13 @@ BUILD_ASSERT_MSG(IS_ENABLED(CONFIG_PCIE), "NS16550(s) in DT need CONFIG_PCIE");
#endif
#endif /* UART_NS16550_ACCESS_IOPORT */

#ifdef CONFIG_UART_NS16550_ACCESS_WORD_ONLY
#undef INBYTE
#define INBYTE(x) INWORD(x)
#undef OUTBYTE
#define OUTBYTE(x, d) OUTWORD(x, d)
#endif


struct uart_ns16550_device_config {
u32_t sys_clk_freq;

0 comments on commit 4fb8bf6

Please sign in to comment.
You can’t perform that action at this time.