All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm:omap:serial:cleanup: use module rev instead of cpu_is_xxxx
@ 2011-11-07 14:57 Vaibhav Hiremath
  2011-11-07 15:00 ` Hiremath, Vaibhav
  2011-11-07 19:44 ` Kevin Hilman
  0 siblings, 2 replies; 4+ messages in thread
From: Vaibhav Hiremath @ 2011-11-07 14:57 UTC (permalink / raw)
  To: linux-omap; +Cc: tony, Vaibhav Hiremath

For OMAP3 uarts (module rev >= 0x52) and all successor devices
(omap4, TI81xx, AM33xx, etc...) empty fifo read errata is applicable,
so we can get rid of cpu_is_xxxx check and simply check for module rev here.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
NOTE: This patch has been tested on OMAP3EVM, and I expect to work on all OMAP3
family of devices (including TI816x, TI814x, AM335x, etc...).
but I am quite not sure about OMAP2 device, can anybody comment/test?

 arch/arm/mach-omap2/serial.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 9992dbf..ac274dc 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -740,16 +740,16 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
 	p->private_data = uart;
 
 	/*
-	 * omap44xx, ti816x: Never read empty UART fifo
+	 * all >omap3 family of devices: Never read empty UART fifo
 	 * omap3xxx: Never read empty UART fifo on UARTs
 	 * with IP rev >=0x52
 	 */
 	uart->regshift = p->regshift;
 	uart->membase = p->membase;
-	if (cpu_is_omap44xx() || cpu_is_ti816x())
-		uart->errata |= UART_ERRATA_FIFO_FULL_ABORT;
-	else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF)
-			>= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
+	if (cpu_is_omap34xx() && (serial_read_reg(uart, UART_OMAP_MVER) & 0xFF)
+			< UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
+		uart->errata &= ~UART_ERRATA_FIFO_FULL_ABORT;
+	else
 		uart->errata |= UART_ERRATA_FIFO_FULL_ABORT;
 
 	if (uart->errata & UART_ERRATA_FIFO_FULL_ABORT) {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] arm:omap:serial:cleanup: use module rev instead of cpu_is_xxxx
  2011-11-07 14:57 [PATCH] arm:omap:serial:cleanup: use module rev instead of cpu_is_xxxx Vaibhav Hiremath
@ 2011-11-07 15:00 ` Hiremath, Vaibhav
  2011-11-07 19:44 ` Kevin Hilman
  1 sibling, 0 replies; 4+ messages in thread
From: Hiremath, Vaibhav @ 2011-11-07 15:00 UTC (permalink / raw)
  To: Hiremath, Vaibhav, linux-omap@vger.kernel.org; +Cc: tony@atomide.com


> -----Original Message-----
> From: Hiremath, Vaibhav
> Sent: Monday, November 07, 2011 8:28 PM
> To: linux-omap@vger.kernel.org
> Cc: tony@atomide.com; Hiremath, Vaibhav
> Subject: [PATCH] arm:omap:serial:cleanup: use module rev instead of
> cpu_is_xxxx
> 
> For OMAP3 uarts (module rev >= 0x52) and all successor devices
> (omap4, TI81xx, AM33xx, etc...) empty fifo read errata is applicable,
> so we can get rid of cpu_is_xxxx check and simply check for module rev
> here.
> 
Ideally, isn't module errata information should come
from HWMOD data? I think it should...does it make sense?

Thanks,
Vaibhav

> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> ---
> NOTE: This patch has been tested on OMAP3EVM, and I expect to work on all
> OMAP3
> family of devices (including TI816x, TI814x, AM335x, etc...).
> but I am quite not sure about OMAP2 device, can anybody comment/test?
> 
>  arch/arm/mach-omap2/serial.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> index 9992dbf..ac274dc 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -740,16 +740,16 @@ void __init omap_serial_init_port(struct
> omap_board_data *bdata)
>  	p->private_data = uart;
> 
>  	/*
> -	 * omap44xx, ti816x: Never read empty UART fifo
> +	 * all >omap3 family of devices: Never read empty UART fifo
>  	 * omap3xxx: Never read empty UART fifo on UARTs
>  	 * with IP rev >=0x52
>  	 */
>  	uart->regshift = p->regshift;
>  	uart->membase = p->membase;
> -	if (cpu_is_omap44xx() || cpu_is_ti816x())
> -		uart->errata |= UART_ERRATA_FIFO_FULL_ABORT;
> -	else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF)
> -			>= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
> +	if (cpu_is_omap34xx() && (serial_read_reg(uart, UART_OMAP_MVER) &
> 0xFF)
> +			< UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
> +		uart->errata &= ~UART_ERRATA_FIFO_FULL_ABORT;
> +	else
>  		uart->errata |= UART_ERRATA_FIFO_FULL_ABORT;
> 
>  	if (uart->errata & UART_ERRATA_FIFO_FULL_ABORT) {
> --
> 1.7.0.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm:omap:serial:cleanup: use module rev instead of cpu_is_xxxx
  2011-11-07 14:57 [PATCH] arm:omap:serial:cleanup: use module rev instead of cpu_is_xxxx Vaibhav Hiremath
  2011-11-07 15:00 ` Hiremath, Vaibhav
@ 2011-11-07 19:44 ` Kevin Hilman
  2011-11-16 14:53   ` Hiremath, Vaibhav
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Hilman @ 2011-11-07 19:44 UTC (permalink / raw)
  To: Vaibhav Hiremath; +Cc: linux-omap, tony

Vaibhav Hiremath <hvaibhav@ti.com> writes:

> For OMAP3 uarts (module rev >= 0x52) and all successor devices
> (omap4, TI81xx, AM33xx, etc...) empty fifo read errata is applicable,
> so we can get rid of cpu_is_xxxx check and simply check for module rev here.
>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> ---
> NOTE: This patch has been tested on OMAP3EVM, and I expect to work on all OMAP3
> family of devices (including TI816x, TI814x, AM335x, etc...).
> but I am quite not sure about OMAP2 device, can anybody comment/test?

Leaving OMAP2 as it is should be fine.

There is a major UART cleanup in progress from Govindraj.  I suggest you
rework this patch on top of his series from 10/18:

       [PATCH v7 00/21] OMAP2+: UART: Runtime adaptation + cleanup

although it still has a few changes to go through before being ready to
merge.

Kevin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] arm:omap:serial:cleanup: use module rev instead of cpu_is_xxxx
  2011-11-07 19:44 ` Kevin Hilman
@ 2011-11-16 14:53   ` Hiremath, Vaibhav
  0 siblings, 0 replies; 4+ messages in thread
From: Hiremath, Vaibhav @ 2011-11-16 14:53 UTC (permalink / raw)
  To: Hilman, Kevin; +Cc: linux-omap@vger.kernel.org, tony@atomide.com


> -----Original Message-----
> From: Hilman, Kevin
> Sent: Tuesday, November 08, 2011 1:15 AM
> To: Hiremath, Vaibhav
> Cc: linux-omap@vger.kernel.org; tony@atomide.com
> Subject: Re: [PATCH] arm:omap:serial:cleanup: use module rev instead of
> cpu_is_xxxx
> 
> Vaibhav Hiremath <hvaibhav@ti.com> writes:
> 
> > For OMAP3 uarts (module rev >= 0x52) and all successor devices
> > (omap4, TI81xx, AM33xx, etc...) empty fifo read errata is applicable,
> > so we can get rid of cpu_is_xxxx check and simply check for module rev
> here.
> >
> > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> > ---
> > NOTE: This patch has been tested on OMAP3EVM, and I expect to work on
> all OMAP3
> > family of devices (including TI816x, TI814x, AM335x, etc...).
> > but I am quite not sure about OMAP2 device, can anybody comment/test?
> 
> Leaving OMAP2 as it is should be fine.
> 
> There is a major UART cleanup in progress from Govindraj.  I suggest you
> rework this patch on top of his series from 10/18:
> 
>        [PATCH v7 00/21] OMAP2+: UART: Runtime adaptation + cleanup
> 
> although it still has a few changes to go through before being ready to
> merge.
> 
Kevin,

Sorry, I missed to update on this.

We do not need this patch anymore. With latest cleanup series from Govindraj, it is already taken care. Please read below commit description -

-------------From Govindraj's commit (405b5009)------------
Serial_in and serial_out override for 8250 serial driver is also
removed. Empty fifo read fix is already taken care with omap-serial
driver with data ready bit check from LSR reg before reading RX fifo.
Also waiting for THRE(transmit hold reg empty) is done with wait_for_xmitr
in omap-serial driver.

Thanks,
Vaibhav

> Kevin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-16 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 14:57 [PATCH] arm:omap:serial:cleanup: use module rev instead of cpu_is_xxxx Vaibhav Hiremath
2011-11-07 15:00 ` Hiremath, Vaibhav
2011-11-07 19:44 ` Kevin Hilman
2011-11-16 14:53   ` Hiremath, Vaibhav

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.