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>
This commit is contained in:
parent
5a0acd5105
commit
4fb8bf61c0
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue