driver/serial: ns16550: set NS16550 as default variant
This add UART_NS16550_VARIANT_16550 configuration inside the choice of UART_NS16550_VARIANT_NS16750 and UART_NS16550_VARIANT_NS16950. The configuration is enabled by default to make NS16550 device to get correct FIFO size configuration (16 bytes). fixes #45783 Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
This commit is contained in:
parent
4049ccf621
commit
5a1c084447
3 changed files with 16 additions and 10 deletions
|
@ -13,7 +13,7 @@ CONFIG_SYSCON=y
|
||||||
# Serial Drivers
|
# Serial Drivers
|
||||||
CONFIG_SERIAL=y
|
CONFIG_SERIAL=y
|
||||||
CONFIG_UART_NS16550=y
|
CONFIG_UART_NS16550=y
|
||||||
CONFIG_UART_NS16950=y
|
CONFIG_UART_NS16550_VARIANT_NS16950=y
|
||||||
#CONFIG_UART_INTERRUPT_DRIVEN=y
|
#CONFIG_UART_INTERRUPT_DRIVEN=y
|
||||||
#CONFIG_UART_NS16550_ACCESS_WORD_ONLY=y
|
#CONFIG_UART_NS16550_ACCESS_WORD_ONLY=y
|
||||||
#CONFIG_UART_ALTERA_JTAG=y
|
#CONFIG_UART_ALTERA_JTAG=y
|
||||||
|
|
|
@ -29,18 +29,23 @@ config UART_NS16550_DRV_CMD
|
||||||
Says n if not sure.
|
Says n if not sure.
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "UART type"
|
prompt "UART variant"
|
||||||
default UART_NS16750
|
default UART_NS16550_VARIANT_NS16550
|
||||||
help
|
help
|
||||||
Select UART device type
|
Select UART device variant
|
||||||
|
|
||||||
config UART_NS16750
|
config UART_NS16550_VARIANT_NS16550
|
||||||
|
bool "UART 16550 (16-bytes FIFO)"
|
||||||
|
help
|
||||||
|
This enables support for 16-bytes FIFO if UART controller is 16550.
|
||||||
|
|
||||||
|
config UART_NS16550_VARIANT_NS16750
|
||||||
bool "UART 16750 (64-bytes FIFO and auto flow control)"
|
bool "UART 16750 (64-bytes FIFO and auto flow control)"
|
||||||
help
|
help
|
||||||
This enables support for 64-bytes FIFO and automatic hardware
|
This enables support for 64-bytes FIFO and automatic hardware
|
||||||
flow control if UART controller is 16750.
|
flow control if UART controller is 16750.
|
||||||
|
|
||||||
config UART_NS16950
|
config UART_NS16550_VARIANT_NS16950
|
||||||
bool "UART 16950 (128-bytes FIFO and auto flow control)"
|
bool "UART 16950 (128-bytes FIFO and auto flow control)"
|
||||||
help
|
help
|
||||||
This enables support for 128-bytes FIFO and automatic hardware flow control.
|
This enables support for 128-bytes FIFO and automatic hardware flow control.
|
||||||
|
|
|
@ -448,7 +448,8 @@ static int uart_ns16550_configure(const struct device *dev,
|
||||||
uart_cfg.data_bits | uart_cfg.stop_bits | uart_cfg.parity);
|
uart_cfg.data_bits | uart_cfg.stop_bits | uart_cfg.parity);
|
||||||
|
|
||||||
mdc = MCR_OUT2 | MCR_RTS | MCR_DTR;
|
mdc = MCR_OUT2 | MCR_RTS | MCR_DTR;
|
||||||
#if defined(CONFIG_UART_NS16750) || defined(CONFIG_UART_NS16950)
|
#if defined(CONFIG_UART_NS16550_VARIANT_NS16750) || \
|
||||||
|
defined(CONFIG_UART_NS16550_VARIANT_NS16950)
|
||||||
if (cfg->flow_ctrl == UART_CFG_FLOW_CTRL_RTS_CTS) {
|
if (cfg->flow_ctrl == UART_CFG_FLOW_CTRL_RTS_CTS) {
|
||||||
mdc |= MCR_AFCE;
|
mdc |= MCR_AFCE;
|
||||||
}
|
}
|
||||||
|
@ -463,15 +464,15 @@ static int uart_ns16550_configure(const struct device *dev,
|
||||||
*/
|
*/
|
||||||
OUTBYTE(FCR(dev),
|
OUTBYTE(FCR(dev),
|
||||||
FCR_FIFO | FCR_MODE0 | FCR_FIFO_8 | FCR_RCVRCLR | FCR_XMITCLR
|
FCR_FIFO | FCR_MODE0 | FCR_FIFO_8 | FCR_RCVRCLR | FCR_XMITCLR
|
||||||
#ifdef CONFIG_UART_NS16750
|
#ifdef CONFIG_UART_NS16550_VARIANT_NS16750
|
||||||
| FCR_FIFO_64
|
| FCR_FIFO_64
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
if ((INBYTE(IIR(dev)) & IIR_FE) == IIR_FE) {
|
if ((INBYTE(IIR(dev)) & IIR_FE) == IIR_FE) {
|
||||||
#ifdef CONFIG_UART_NS16750
|
#ifdef CONFIG_UART_NS16550_VARIANT_NS16750
|
||||||
dev_data->fifo_size = 64;
|
dev_data->fifo_size = 64;
|
||||||
#elif defined(CONFIG_UART_NS16950)
|
#elif defined(CONFIG_UART_NS16550_VARIANT_NS16950)
|
||||||
dev_data->fifo_size = 128;
|
dev_data->fifo_size = 128;
|
||||||
#else
|
#else
|
||||||
dev_data->fifo_size = 16;
|
dev_data->fifo_size = 16;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue