* [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer @ 2012-01-24 13:37 Govindraj.R 2012-01-25 19:14 ` Paul Walmsley 2012-01-25 19:18 ` Paul Walmsley 0 siblings, 2 replies; 7+ messages in thread From: Govindraj.R @ 2012-01-24 13:37 UTC (permalink / raw) To: linux-omap Cc: linux-serial, Govindraj.R, Kevin Hilman, Paul Walmsley, Partha Basak From: "Govindraj.R" <govindraj.raja@ti.com> On omap3630 onwards uart wer reg has bit 7 for tx wakeup enable. Without this bit set some uart sluggishness might be seen while printing data on console, response is better when enabling this bit. Tested with Beagle XM (OMAP3630) Cc: Kevin Hilman <khilman@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Govindraj.R <govindraj.raja@ti.com> --- But on omap3430 the bit is not available. arch/arm/plat-omap/include/plat/omap-serial.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h index 9ff4444..0c22d8d 100644 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ b/arch/arm/plat-omap/include/plat/omap-serial.h @@ -39,7 +39,7 @@ /* WER = 0x7F * Enable module level wakeup in WER reg */ -#define OMAP_UART_WER_MOD_WKUP 0X7F +#define OMAP_UART_WER_MOD_WKUP 0xFF /* Enable XON/XOFF flow control on output */ #define OMAP_UART_SW_TX 0x04 -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer 2012-01-24 13:37 [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer Govindraj.R @ 2012-01-25 19:14 ` Paul Walmsley 2012-01-25 19:18 ` Paul Walmsley 1 sibling, 0 replies; 7+ messages in thread From: Paul Walmsley @ 2012-01-25 19:14 UTC (permalink / raw) To: Govindraj.R Cc: linux-omap, linux-serial, Kevin Hilman, Partha Basak, linux-arm-kernel cc'ing linux-arm-kernel also Hi some comments On Tue, 24 Jan 2012, Govindraj.R wrote: > From: "Govindraj.R" <govindraj.raja@ti.com> > > On omap3630 onwards uart wer reg has bit 7 > for tx wakeup enable. > > Without this bit set some uart sluggishness might be seen > while printing data on console, response is better when > enabling this bit. > Tested with Beagle XM (OMAP3630) > > Cc: Kevin Hilman <khilman@ti.com> > Cc: Paul Walmsley <paul@pwsan.com> > Signed-off-by: Govindraj.R <govindraj.raja@ti.com> > --- > But on omap3430 the bit is not available. Well that's good news that it exists on 36xx+ at least. But please make a few changes. This shouldn't set this bit on UARTs that don't support it. It should only be set if a hwmod dev_attr flag was set to indicate the presence of this feature. Using a flag is also important since it will allow us to disable the workaround that we'll need for earlier OMAPs. Also, I assume that this does not fix the RX sluggishness due to the missing RX timeout wakeup? Also, this assignment should be using symbolic macros rather than raw bits. - Paul ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer 2012-01-24 13:37 [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer Govindraj.R 2012-01-25 19:14 ` Paul Walmsley @ 2012-01-25 19:18 ` Paul Walmsley 2012-03-05 20:23 ` Paul Walmsley 1 sibling, 1 reply; 7+ messages in thread From: Paul Walmsley @ 2012-01-25 19:18 UTC (permalink / raw) To: Govindraj.R Cc: linux-omap, linux-serial, Kevin Hilman, Partha Basak, linux-arm-kernel cc'ing linux-arm-kernel also (correct address this time) Hi some comments On Tue, 24 Jan 2012, Govindraj.R wrote: > From: "Govindraj.R" <govindraj.raja@ti.com> > > On omap3630 onwards uart wer reg has bit 7 > for tx wakeup enable. > > Without this bit set some uart sluggishness might be seen > while printing data on console, response is better when > enabling this bit. > Tested with Beagle XM (OMAP3630) > > Cc: Kevin Hilman <khilman@ti.com> > Cc: Paul Walmsley <paul@pwsan.com> > Signed-off-by: Govindraj.R <govindraj.raja@ti.com> > --- > But on omap3430 the bit is not available. Well that's good news that it exists on 36xx+ at least. But please make a few changes. This shouldn't set this bit on UARTs that don't support it. It should only be set if a hwmod dev_attr flag was set to indicate the presence of this feature. Using a flag is also important since it will allow us to disable the workaround that we'll need for earlier OMAPs. Also, I assume that this does not fix the RX sluggishness due to the missing RX timeout wakeup? Also, this assignment should be using symbolic macros rather than raw bits. - Paul ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer 2012-01-25 19:18 ` Paul Walmsley @ 2012-03-05 20:23 ` Paul Walmsley 2012-03-06 10:05 ` Raja, Govindraj 0 siblings, 1 reply; 7+ messages in thread From: Paul Walmsley @ 2012-03-05 20:23 UTC (permalink / raw) To: Govindraj.R Cc: linux-omap, linux-serial, Kevin Hilman, Partha Basak, linux-arm-kernel Hello Govindraj Do you intend to update and repost this serial patch? Or should someone else deal with it? It would be good to get support for this additional wakeup bit. - Paul ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer 2012-03-05 20:23 ` Paul Walmsley @ 2012-03-06 10:05 ` Raja, Govindraj 2012-03-07 5:57 ` Paul Walmsley 0 siblings, 1 reply; 7+ messages in thread From: Raja, Govindraj @ 2012-03-06 10:05 UTC (permalink / raw) To: Paul Walmsley Cc: linux-omap, linux-serial, Kevin Hilman, Partha Basak, linux-arm-kernel On Tue, Mar 6, 2012 at 1:53 AM, Paul Walmsley <paul@pwsan.com> wrote: > > Hello Govindraj > > Do you intend to update and repost this serial patch? Or should someone > else deal with it? It would be good to get support for this additional > wakeup bit. Thanks for reminding. (I had got preempted with other activities, apologies for the delay) I see two ways of adding this tx wake-up flag. 1.) passing a feature flag from pdata and populating the feature value to wer. 2.) Duplicating the uart1/2/3 hwmod for omap3430 without dev attrib and uart1/2/3/4 hwmod for omap3630 with dev attribs. Approach-2 adds unnecessary code duplication in hwmod file with and without dev_attribs, So right now here is the patch to follow approach [1], If its strongly recommended to use approach-2 will add it. (My concern is the diffstat it might produce with approach-2) -- Thanks, Govindraj.R [1]: From 867dfa7328b4219be259a204555a6baae82ec4df Mon Sep 17 00:00:00 2001 From: "Govindraj.R" <govindraj.raja@ti.com> Date: Tue, 6 Mar 2012 15:04:47 +0530 Subject: [PATCH] OMAP: UART: enable tx wake up capability for 3630 above socs From omap3630 above UART wer(wakeup enable reg) has TX wakeup capability, enable the tx wakeup bit by passing the required feature flag from pdata. Also add missing wer reg restore from context restore function. Signed-off-by: Govindraj.R <govindraj.raja@ti.com> --- arch/arm/mach-omap2/serial.c | 3 +++ arch/arm/plat-omap/include/plat/omap-serial.h | 7 +++++++ drivers/tty/serial/omap-serial.c | 8 +++++++- 3 files changed, 17 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index f590afc..eb43996 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -357,6 +357,9 @@ void __init omap_serial_init_port(struct omap_board_data *bdata, omap_up.dma_rx_poll_rate = info->dma_rx_poll_rate; omap_up.autosuspend_timeout = info->autosuspend_timeout; + if (!cpu_is_omap24xx() && !cpu_is_omap3430()) + omap_up.has_feature = UART_FEATURE_TX_WAKEUP_EN; + /* Enable the MDR1 Errata i202 for OMAP2430/3xxx/44xx */ if (!cpu_is_omap2420() && !cpu_is_ti816x()) omap_up.errata |= UART_ERRATA_i202_MDR1_ACCESS; diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h index 9ff4444..b4f42dc 100644 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ b/arch/arm/plat-omap/include/plat/omap-serial.h @@ -61,6 +61,11 @@ #define UART_ERRATA_i202_MDR1_ACCESS BIT(0) #define UART_ERRATA_i291_DMA_FORCEIDLE BIT(1) +#define OMAP_UART_TX_WAKEUP_EN BIT(7) + +/* Feature flags */ +#define UART_FEATURE_TX_WAKEUP_EN BIT(0) + struct omap_uart_port_info { bool dma_enabled; /* To specify DMA Mode */ unsigned int uartclk; /* UART clock rate */ @@ -70,6 +75,7 @@ struct omap_uart_port_info { unsigned int dma_rx_timeout; unsigned int autosuspend_timeout; unsigned int dma_rx_poll_rate; + unsigned int has_feature; int (*get_context_loss_count)(struct device *); void (*set_forceidle)(struct platform_device *); @@ -117,6 +123,7 @@ struct uart_omap_port { unsigned char dlh; unsigned char mdr1; unsigned char scr; + unsigned char wer; int use_dma; /* diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index f809041..5d7330f 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -577,8 +577,10 @@ static int serial_omap_startup(struct uart_port *port) up->ier = UART_IER_RLSI | UART_IER_RDI; serial_out(up, UART_IER, up->ier); + up->wer |= OMAP_UART_WER_MOD_WKUP; + /* Enable module level wake up */ - serial_out(up, UART_OMAP_WER, OMAP_UART_WER_MOD_WKUP); + serial_out(up, UART_OMAP_WER, up->wer); pm_runtime_mark_last_busy(&up->pdev->dev); pm_runtime_put_autosuspend(&up->pdev->dev); @@ -1444,6 +1446,8 @@ static int serial_omap_probe(struct platform_device *pdev) } up->uart_dma.uart_base = mem->start; up->errata = omap_up_info->errata; + if (omap_up_info->has_feature & UART_FEATURE_TX_WAKEUP_EN) + up->wer |= OMAP_UART_TX_WAKEUP_EN; if (omap_up_info->dma_enabled) { up->uart_dma.uart_dma_tx = dma_tx->start; @@ -1569,6 +1573,8 @@ static void serial_omap_restore_context(struct uart_omap_port *up) serial_omap_mdr1_errataset(up, up->mdr1); else serial_out(up, UART_OMAP_MDR1, up->mdr1); + + serial_out(up, UART_OMAP_WER, up->wer); } static int serial_omap_runtime_suspend(struct device *dev) -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer 2012-03-06 10:05 ` Raja, Govindraj @ 2012-03-07 5:57 ` Paul Walmsley 2012-03-09 6:19 ` Raja, Govindraj 0 siblings, 1 reply; 7+ messages in thread From: Paul Walmsley @ 2012-03-07 5:57 UTC (permalink / raw) To: Raja, Govindraj Cc: linux-omap, linux-serial, Kevin Hilman, Partha Basak, linux-arm-kernel Hi On Tue, 6 Mar 2012, Raja, Govindraj wrote: > I see two ways of adding this tx wake-up flag. > > 1.) passing a feature flag from pdata and populating the feature value to wer. > > 2.) Duplicating the uart1/2/3 hwmod for omap3430 without dev attrib > and uart1/2/3/4 > hwmod for omap3630 with dev attribs. > > Approach-2 adds unnecessary code duplication in hwmod file with and without > dev_attribs, So right now here is the patch to follow approach [1], > > If its strongly recommended to use approach-2 will add it. > (My concern is the diffstat it might produce with approach-2) Both 1 and 2 are needed. The current way that errata are handled in arch/arm/mach-omap2/serial.c needs to be changed. Those should be flags that are passed from hwmod dev_attr data. The presence of the TX wakeup bit should simply be another dev_attr flag. These flags should be passed to the driver via the omap_up.errata field for the time being. The exception to this is if the IP block's revision register was changed when TX wakeups became possible. If that's the case, then that mechanism can be used in lieu of dev_attr and platform_data in this situation. - Paul ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer 2012-03-07 5:57 ` Paul Walmsley @ 2012-03-09 6:19 ` Raja, Govindraj 0 siblings, 0 replies; 7+ messages in thread From: Raja, Govindraj @ 2012-03-09 6:19 UTC (permalink / raw) To: Paul Walmsley Cc: linux-omap, linux-serial, Kevin Hilman, Partha Basak, linux-arm-kernel On Wed, Mar 7, 2012 at 11:27 AM, Paul Walmsley <paul@pwsan.com> wrote: > Hi > > On Tue, 6 Mar 2012, Raja, Govindraj wrote: > >> I see two ways of adding this tx wake-up flag. >> >> 1.) passing a feature flag from pdata and populating the feature value to wer. >> >> 2.) Duplicating the uart1/2/3 hwmod for omap3430 without dev attrib >> and uart1/2/3/4 >> hwmod for omap3630 with dev attribs. >> >> Approach-2 adds unnecessary code duplication in hwmod file with and without >> dev_attribs, So right now here is the patch to follow approach [1], >> >> If its strongly recommended to use approach-2 will add it. >> (My concern is the diffstat it might produce with approach-2) > > Both 1 and 2 are needed. > > The current way that errata are handled in arch/arm/mach-omap2/serial.c > needs to be changed. Those should be flags that are passed from hwmod > dev_attr data. The presence of the TX wakeup bit should simply be another > dev_attr flag. These flags should be passed to the driver via the > omap_up.errata field for the time being. okay. > > The exception to this is if the IP block's revision register was changed > when TX wakeups became possible. If that's the case, then that mechanism > can be used in lieu of dev_attr and platform_data in this situation. I will check on the MVR reg available for uart-rev on different omap socs, and will get back by end on next of week with a possible patch. -- Thanks, Govindraj.R -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-03-09 6:19 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-01-24 13:37 [RFC PATCH] OMAP: UART: Enable tx wakeup bit in wer Govindraj.R 2012-01-25 19:14 ` Paul Walmsley 2012-01-25 19:18 ` Paul Walmsley 2012-03-05 20:23 ` Paul Walmsley 2012-03-06 10:05 ` Raja, Govindraj 2012-03-07 5:57 ` Paul Walmsley 2012-03-09 6:19 ` Raja, Govindraj
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).