serial/uart_16550: Allow uintptr_t as addr width

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2022-01-14 17:22:03 +08:00 committed by Xiang Xiao
parent 019fc0ad78
commit 2e35b6d611
2 changed files with 9 additions and 4 deletions

View File

@ -347,6 +347,8 @@ config 16550_ADDRWIDTH
int "Address width of 16550 registers"
default 8
---help---
The bit width of registers. Options are 8, 16, or 32. Default: 8
The bit width of registers. Options are 0, 8, 16, or 32.
Default: 8
Note: 0 means auto detect address size (uintptr_t)
endif # 16550_UART

View File

@ -68,8 +68,9 @@
# error "CONFIG_16550_ADDRWIDTH not defined"
#endif
#if CONFIG_16550_ADDRWIDTH != 8 && CONFIG_16550_ADDRWIDTH != 16 && \
CONFIG_16550_ADDRWIDTH != 32 && CONFIG_16550_ADDRWIDTH != 64
#if CONFIG_16550_ADDRWIDTH != 0 && CONFIG_16550_ADDRWIDTH != 8 && \
CONFIG_16550_ADDRWIDTH != 16 && CONFIG_16550_ADDRWIDTH != 32 && \
CONFIG_16550_ADDRWIDTH != 64
# error "CONFIG_16550_ADDRWIDTH not supported"
#endif
@ -309,7 +310,9 @@ typedef uint16_t uart_datawidth_t;
typedef uint32_t uart_datawidth_t;
#endif
#if CONFIG_16550_ADDRWIDTH == 8
#if CONFIG_16550_ADDRWIDTH == 0
typedef uintptr_t uart_addrwidth_t;
#elif CONFIG_16550_ADDRWIDTH == 8
typedef uint8_t uart_addrwidth_t;
#elif CONFIG_16550_ADDRWIDTH == 16
typedef uint16_t uart_addrwidth_t;