diff --git a/drivers/serial/Kconfig-16550 b/drivers/serial/Kconfig-16550 index 259240dfb7..b54b72990f 100644 --- a/drivers/serial/Kconfig-16550 +++ b/drivers/serial/Kconfig-16550 @@ -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 diff --git a/include/nuttx/serial/uart_16550.h b/include/nuttx/serial/uart_16550.h index 88295dc1d8..102db0407a 100644 --- a/include/nuttx/serial/uart_16550.h +++ b/include/nuttx/serial/uart_16550.h @@ -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;