omap: serial: fix non-empty uart fifo read abort
Subsystems (3)
PATCH v3 1/1 omap: serial: fix non-empty uart fifo read abort
OMAP3xxx and OMAP4430 UART IP blocks have a restriction wrt RX FIFO. Empty RX fifo read causes an abort.
OMAP3xxx:
UART IP revision >= 0x52 have this issue MVR register format is: Bits Field Name Description Type Reset 31:8 RESERVED RO 0x0 7:4 MAJOR Major revision number of the module. RO 0x-- 3:0 MINOR Minor revision number of the module. RO 0x--
OMAP4xxx:
All revisions have this issue Revision id check is not used as the format of MVR resigster has changed For omap4 MVR register reads as: 0x50410602 => Revision id = 0x0602 Format of MVR register on omap4 is: (Courtesy: Cousson, Benoit) Bits Field Name Description Type Reset 31:30 SCHEME Scheme revision number of module RO 0x1 29:28 RESERVED RO 0x1 27:16 FUNC Function revision number of module RO 0x041 15:11 RTL Rtl revision number of module RO 0x00 10:8 MAJOR Major revision number of the module. RO 0x6 7:6 CUSTOM Custom revision number of the module. RO 0x0 5:0 MINOR Minor revision number of the module. RO 0x02
Override the default 8250 read handler: mem_serial_in() by a custom handler: serial_in_8250()
which makes sure that RX fifo is not read when empty
tested on zoom3(3630) board
---
History of Patch:
V1:
http://patchwork.kernel.org/patch/61671/ http://patchwork.kernel.org/patch/61672/
V2: Incorporate approach suggested by Tony L
Introduce IP version check in mach-omap2/serial.c file
V3: Change #ifdef OMAP4 to cpu_is_omap44xx()
arch/arm/mach-omap2/serial.c +28 -0
@@ -33,6 +33,7 @@#include "pm.h" #include "prm-regbits-34xx.h" +#define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52#define UART_OMAP_WER 0x17/* Wake-up enable register */ #define DEFAULT_TIMEOUT (5 * HZ)
@@ -572,6 +573,23 @@ static struct omap_uart_state omap_uart[] = {#endif }; +/* +* Override the default 8250 read handler: mem_serial_in() +* Empty RX fifo read causes an abort on omap3630 and omap4 +* This function makes sure that an empty rx fifo is not read on these silicons +* (OMAP1/2/3430 are not affected) +*/ +static unsigned int serial_in_override (struct uart_port *up,int offset) +{ +if (UART_RX == offset) { +unsigned int lsr; + lsr =serial_read_reg (omap_uart[up->line].p,UART_LSR ); +if (!(lsr &UART_LSR_DR )) +return -EPERM ; + } +return serial_read_reg (omap_uart[up->line].p, offset); +} +void __init omap_serial_early_init (void ) {int i;
@@ -650,5 +668,15 @@ void __init omap_serial_init(void)device_init_wakeup (dev, true);DEV_CREATE_FILE (dev, &dev_attr_sleep_timeout); } + +/* omap44xx: Never read empty UART fifo +* omap3xxx: Never read empty UART fifo on UARTs +* with IP rev >=0x52 +*/ +if (cpu_is_omap44xx ()) + uart->p->serial_in = serial_in_override; +else if ((serial_read_reg (uart->p,UART_OMAP_MVER ) &0xFF ) + >=UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV ) + uart->p->serial_in = serial_in_override; } }
Signature · 1 line
1.6.6.rc0.66.ge160d
Tony Lindgren
maintainerPATCH v3 1/1 omap: serial: fix non-empty uart fifo read abort
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: for-next-vol2
Initial commit ID (Likely to change): 679089aa0dede39863a083a491b40928c5ec8379
PatchWorks
http://patchwork.kernel.org/patch/65022/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=679089aa0dede39863a083a491b40928c5ec8379
Quoted 6 lines · Tony Lindgren
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.Branch in linux-omap: for-next-vol2
Tony,
A query on this for-next-vol2 branch:
Is this branch going to be pushed in the current merge window, or is it for the -rc series?
Quoted 2 lines
PatchWorks
http://patchwork.kernel.org/patch/65022/
With current Linus' tree + this patch, I can boot up on 3630.
Playing with the omap3_defconfig now, to see how many boards we can boot up with a single image :)
- Anand
<snip>
Quoted 6 lines
With current Linus' tree + this patch, I can boot up on 3630.
Playing with the
omap3_defconfignow, to see how many boards we can boot up with a single image :)
I got a zoom2, zoom3, 3430SDP and 3630 SDP booting with a single image.
I had to disable Profiling and Sound support to get it to build with this config. Will post a patch after -rc1 if this is not resolved by then.
- Anand
Tony Lindgren
maintainerQuoted 11 lines · Gadiyar, Anand
<snip>
Quoted 6 lines
With current Linus' tree + this patch, I can boot up on 3630.
Playing with the
omap3_defconfignow, to see how many boards we can boot up with a single image :)I got a zoom2, zoom3, 3430SDP and 3630 SDP booting with a single image.
OK good to hear.
Quoted 3 lines
I had to disable Profiling and Sound support to get it to build with this config. Will post a patch after -rc1 if this is not resolved by then.
I've applied a patch for the profiling into omap-testing from Carsten Emde I found on LKML. See patch "tracing: Fix trace_marker output".
Regards,
Tony
Tony Lindgren
maintainerQuoted 5 lines · Gadiyar, Anand
Quoted 4 lines · Tony Lindgren
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Quoted 8 lines
Quoted 2 lines
Branch in linux-omap: for-next-vol2
Tony,
A query on this for-next-vol2 branch:
Is this branch going to be pushed in the current merge window, or is it for the -rc series?
What used to be for-next-vol2 is now the current for-next. We should be able to get that merged too this merge window.
Regards,
Tony
Quoted 16 lines
Quoted 4 lines
PatchWorks
http://patchwork.kernel.org/patch/65022/With current Linus' tree + this patch, I can boot up on 3630.
Playing with the
omap3_defconfignow, to see how many boards we can boot up with a single image :)- Anand
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html