Commit 17fa032671f7981628fe16b30399638842a4b1bb
Committed by
Tom Rini
1 parent
0675f992db
Exists in
smarc_8mq_lf_v2020.04
and in
22 other branches
serial, ns16550: bugfix: ns16550 fifo not enabled
commit: 65f83802b7a5b "serial: 16550: Add getfcr accessor" breaks u-boot commandline working with long commands sending to the board. Since the above patch, you have to setup the fcr register. For board/archs which enable OF_PLATDATA, the new field fcr in struct ns16550_platdata is not filled with a default value ... This leads in not setting up the uarts fifo, which ends in problems, when you send long commands to u-boots commandline. Detected this issue with automated tbot tests on am335x based shc board. The error does not popup, if you type commands. You need to copy&paste a long command to u-boots commandshell (or send a long command with tbot) Possible boards/plattforms with problems: ./arch/arm/cpu/arm926ejs/lpc32xx/devices.c ./arch/arm/mach-tegra/board.c ./board/overo/overo.c ./board/quipos/cairo/cairo.c ./board/logicpd/omap3som/omap3logic.c ./board/logicpd/zoom1/zoom1.c ./board/timll/devkit8000/devkit8000.c ./board/lg/sniper/sniper.c ./board/ti/beagle/beagle.c ./drivers/serial/serial_rockchip.c Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Tested-by: Adam Ford <aford173@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Showing 14 changed files with 46 additions and 24 deletions Side-by-side Diff
- arch/arm/cpu/arm926ejs/lpc32xx/devices.c
- arch/arm/mach-omap2/am33xx/board.c
- arch/arm/mach-tegra/board.c
- board/isee/igep00x0/igep00x0.c
- board/lg/sniper/sniper.c
- board/logicpd/omap3som/omap3logic.c
- board/logicpd/zoom1/zoom1.c
- board/overo/overo.c
- board/quipos/cairo/cairo.c
- board/ti/beagle/beagle.c
- board/timll/devkit8000/devkit8000.c
- drivers/serial/ns16550.c
- drivers/serial/serial_rockchip.c
- include/ns16550.h
arch/arm/cpu/arm926ejs/lpc32xx/devices.c
... | ... | @@ -45,10 +45,14 @@ |
45 | 45 | |
46 | 46 | #if !CONFIG_IS_ENABLED(OF_CONTROL) |
47 | 47 | static const struct ns16550_platdata lpc32xx_uart[] = { |
48 | - { .base = UART3_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
49 | - { .base = UART4_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
50 | - { .base = UART5_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
51 | - { .base = UART6_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
48 | + { .base = UART3_BASE, .reg_shift = 2, | |
49 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
50 | + { .base = UART4_BASE, .reg_shift = 2, | |
51 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
52 | + { .base = UART5_BASE, .reg_shift = 2, | |
53 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
54 | + { .base = UART6_BASE, .reg_shift = 2, | |
55 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
52 | 56 | }; |
53 | 57 | |
54 | 58 | #if defined(CONFIG_LPC32XX_HSUART) |
arch/arm/mach-omap2/am33xx/board.c
... | ... | @@ -40,14 +40,20 @@ |
40 | 40 | |
41 | 41 | #if !CONFIG_IS_ENABLED(OF_CONTROL) |
42 | 42 | static const struct ns16550_platdata am33xx_serial[] = { |
43 | - { .base = CONFIG_SYS_NS16550_COM1, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
43 | + { .base = CONFIG_SYS_NS16550_COM1, .reg_shift = 2, | |
44 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
44 | 45 | # ifdef CONFIG_SYS_NS16550_COM2 |
45 | - { .base = CONFIG_SYS_NS16550_COM2, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
46 | + { .base = CONFIG_SYS_NS16550_COM2, .reg_shift = 2, | |
47 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
46 | 48 | # ifdef CONFIG_SYS_NS16550_COM3 |
47 | - { .base = CONFIG_SYS_NS16550_COM3, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
48 | - { .base = CONFIG_SYS_NS16550_COM4, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
49 | - { .base = CONFIG_SYS_NS16550_COM5, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
50 | - { .base = CONFIG_SYS_NS16550_COM6, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, | |
49 | + { .base = CONFIG_SYS_NS16550_COM3, .reg_shift = 2, | |
50 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
51 | + { .base = CONFIG_SYS_NS16550_COM4, .reg_shift = 2, | |
52 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
53 | + { .base = CONFIG_SYS_NS16550_COM5, .reg_shift = 2, | |
54 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
55 | + { .base = CONFIG_SYS_NS16550_COM6, .reg_shift = 2, | |
56 | + .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, | |
51 | 57 | # endif |
52 | 58 | # endif |
53 | 59 | }; |
arch/arm/mach-tegra/board.c
board/isee/igep00x0/igep00x0.c
board/lg/sniper/sniper.c
board/logicpd/omap3som/omap3logic.c
board/logicpd/zoom1/zoom1.c
board/overo/overo.c
board/quipos/cairo/cairo.c
board/ti/beagle/beagle.c
board/timll/devkit8000/devkit8000.c
drivers/serial/ns16550.c
... | ... | @@ -20,9 +20,6 @@ |
20 | 20 | #define UART_LCRVAL UART_LCR_8N1 /* 8 data, 1 stop, no parity */ |
21 | 21 | #define UART_MCRVAL (UART_MCR_DTR | \ |
22 | 22 | UART_MCR_RTS) /* RTS/DTR */ |
23 | -#define UART_FCRVAL (UART_FCR_FIFO_EN | \ | |
24 | - UART_FCR_RXSR | \ | |
25 | - UART_FCR_TXSR) /* Clear & enable FIFOs */ | |
26 | 23 | |
27 | 24 | #ifndef CONFIG_DM_SERIAL |
28 | 25 | #ifdef CONFIG_SYS_NS16550_PORT_MAPPED |
... | ... | @@ -138,7 +135,7 @@ |
138 | 135 | #else |
139 | 136 | static u32 ns16550_getfcr(NS16550_t port) |
140 | 137 | { |
141 | - return UART_FCRVAL; | |
138 | + return UART_FCR_DEFVAL; | |
142 | 139 | } |
143 | 140 | #endif |
144 | 141 | |
... | ... | @@ -275,7 +272,7 @@ |
275 | 272 | CONFIG_BAUDRATE); |
276 | 273 | serial_dout(&com_port->ier, CONFIG_SYS_NS16550_IER); |
277 | 274 | serial_dout(&com_port->mcr, UART_MCRVAL); |
278 | - serial_dout(&com_port->fcr, UART_FCRVAL); | |
275 | + serial_dout(&com_port->fcr, UART_FCR_DEFVAL); | |
279 | 276 | |
280 | 277 | serial_dout(&com_port->lcr, UART_LCR_BKSE | UART_LCRVAL); |
281 | 278 | serial_dout(&com_port->dll, baud_divisor & 0xff); |
... | ... | @@ -440,7 +437,7 @@ |
440 | 437 | return -EINVAL; |
441 | 438 | } |
442 | 439 | |
443 | - plat->fcr = UART_FCRVAL; | |
440 | + plat->fcr = UART_FCR_DEFVAL; | |
444 | 441 | if (port_type == PORT_JZ4780) |
445 | 442 | plat->fcr |= UART_FCR_UME; |
446 | 443 |
drivers/serial/serial_rockchip.c
include/ns16550.h
... | ... | @@ -121,6 +121,11 @@ |
121 | 121 | /* Ingenic JZ47xx specific UART-enable bit. */ |
122 | 122 | #define UART_FCR_UME 0x10 |
123 | 123 | |
124 | +/* Clear & enable FIFOs */ | |
125 | +#define UART_FCR_DEFVAL (UART_FCR_FIFO_EN | \ | |
126 | + UART_FCR_RXSR | \ | |
127 | + UART_FCR_TXSR) | |
128 | + | |
124 | 129 | /* |
125 | 130 | * These are the definitions for the Modem Control Register |
126 | 131 | */ |