* [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
@ 2010-06-04 13:43 Govindraj.R
2010-06-04 14:03 ` Gopinath, Thara
2010-06-04 15:35 ` Kevin Hilman
0 siblings, 2 replies; 11+ messages in thread
From: Govindraj.R @ 2010-06-04 13:43 UTC (permalink / raw)
To: linux-omap; +Cc: Kevin Hilman, Sergio Aguirre
This patch makes the following:
- Adds missing wakeup padding register handling.
- Fixes a hardcode to use PER module ONLY on UART3.
- Muxmode usage needed for uart4 for 3630 for padconf
wakeup on rx line.
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
---
arch/arm/mach-omap2/serial.c | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index da9fee6..70a9089 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -42,6 +42,7 @@
#include "prm.h"
#include "pm.h"
#include "cm.h"
+#include "mux.h"
#include "prm-regbits-34xx.h"
#define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52
@@ -68,6 +69,7 @@ struct omap_uart_state {
u32 wk_mask;
u32 padconf;
u32 dma_enabled;
+ u16 muxmode;
struct clk *ick;
struct clk *fck;
@@ -229,8 +231,20 @@ static inline void omap_uart_disable_clocks(struct omap_uart_state *uart)
omap_device_idle(uart->pdev);
}
+static inline void omap_uart_setmux_mode(struct omap_uart_state *uart)
+{
+ u16 w = omap_ctrl_readw(uart->padconf);
+ w &= ~0x7;
+ w |= OMAP_MUX_MODE2;
+ omap_ctrl_writew(w, uart->padconf);
+}
+
static void omap_uart_enable_wakeup(struct omap_uart_state *uart)
{
+ /* Set appropriate muxmode */
+ if (uart->muxmode && uart->padconf)
+ omap_uart_setmux_mode(uart);
+
/* Set wake-enable bit */
if (uart->wk_en && uart->wk_mask) {
u32 v = __raw_readl(uart->wk_en);
@@ -248,6 +262,10 @@ static void omap_uart_enable_wakeup(struct omap_uart_state *uart)
static void omap_uart_disable_wakeup(struct omap_uart_state *uart)
{
+ /* Set appropriate muxmode */
+ if (uart->muxmode && uart->padconf)
+ omap_uart_setmux_mode(uart);
+
/* Clear wake-enable bit */
if (uart->wk_en && uart->wk_mask) {
u32 v = __raw_readl(uart->wk_en);
@@ -338,6 +356,9 @@ void omap_uart_resume_idle(int num)
if (num == uart->num) {
omap_uart_enable_clocks(uart);
+ if (uart->muxmode && uart->padconf)
+ omap_uart_setmux_mode(uart);
+
/* Check for IO pad wakeup */
if (cpu_is_omap34xx() && uart->padconf) {
u16 p = omap_ctrl_readw(uart->padconf);
@@ -416,9 +437,10 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
omap_uart_smart_idle_enable(uart, 0);
if (cpu_is_omap34xx()) {
- u32 mod = (uart->num == 2) ? OMAP3430_PER_MOD : CORE_MOD;
+ u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD;
u32 wk_mask = 0;
u32 padconf = 0;
+ u16 muxmode = 0;
uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1);
uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1);
@@ -435,9 +457,15 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
wk_mask = OMAP3430_ST_UART3_MASK;
padconf = 0x19e;
break;
+ case 3:
+ wk_mask = OMAP3630_ST_UART4_MASK;
+ padconf = 0x0d2;
+ muxmode = OMAP_MUX_MODE2;
+ break;
}
uart->wk_mask = wk_mask;
uart->padconf = padconf;
+ uart->muxmode = muxmode;
} else if (cpu_is_omap24xx()) {
u32 wk_mask = 0;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 11+ messages in thread* RE: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-04 13:43 [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630 Govindraj.R
@ 2010-06-04 14:03 ` Gopinath, Thara
2010-06-04 14:08 ` Govindraj
2010-06-04 15:35 ` Kevin Hilman
1 sibling, 1 reply; 11+ messages in thread
From: Gopinath, Thara @ 2010-06-04 14:03 UTC (permalink / raw)
To: Raja, Govindraj, linux-omap@vger.kernel.org; +Cc: Kevin Hilman, Aguirre, Sergio
>>-----Original Message-----
>>From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of
>>Govindraj.R
>>Sent: Friday, June 04, 2010 7:14 PM
>>To: linux-omap@vger.kernel.org
>>Cc: Kevin Hilman; Aguirre, Sergio
>>Subject: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
>>
>>This patch makes the following:
>> - Adds missing wakeup padding register handling.
>> - Fixes a hardcode to use PER module ONLY on UART3.
>> - Muxmode usage needed for uart4 for 3630 for padconf
>> wakeup on rx line.
>>
>>Cc: Kevin Hilman <khilman@deeprootsystems.com>
>>Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
>>Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
>>---
>> arch/arm/mach-omap2/serial.c | 30 +++++++++++++++++++++++++++++-
>> 1 files changed, 29 insertions(+), 1 deletions(-)
>>
>>diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
>>index da9fee6..70a9089 100644
>>--- a/arch/arm/mach-omap2/serial.c
>>+++ b/arch/arm/mach-omap2/serial.c
>>@@ -42,6 +42,7 @@
>> #include "prm.h"
>> #include "pm.h"
>> #include "cm.h"
>>+#include "mux.h"
>> #include "prm-regbits-34xx.h"
>>
>> #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52
>>@@ -68,6 +69,7 @@ struct omap_uart_state {
>> u32 wk_mask;
>> u32 padconf;
>> u32 dma_enabled;
>>+ u16 muxmode;
>>
>> struct clk *ick;
>> struct clk *fck;
>>@@ -229,8 +231,20 @@ static inline void omap_uart_disable_clocks(struct omap_uart_state *uart)
>> omap_device_idle(uart->pdev);
>> }
>>
>>+static inline void omap_uart_setmux_mode(struct omap_uart_state *uart)
>>+{
>>+ u16 w = omap_ctrl_readw(uart->padconf);
>>+ w &= ~0x7;
>>+ w |= OMAP_MUX_MODE2;
Why it is hard coded to MUX_MODE2? Should it not be w |= uart->muxmode?
Regards
Thara
>>+ omap_ctrl_writew(w, uart->padconf);
>>+}
>>+
>> static void omap_uart_enable_wakeup(struct omap_uart_state *uart)
>> {
>>+ /* Set appropriate muxmode */
>>+ if (uart->muxmode && uart->padconf)
>>+ omap_uart_setmux_mode(uart);
>>+
>> /* Set wake-enable bit */
>> if (uart->wk_en && uart->wk_mask) {
>> u32 v = __raw_readl(uart->wk_en);
>>@@ -248,6 +262,10 @@ static void omap_uart_enable_wakeup(struct omap_uart_state *uart)
>>
>> static void omap_uart_disable_wakeup(struct omap_uart_state *uart)
>> {
>>+ /* Set appropriate muxmode */
>>+ if (uart->muxmode && uart->padconf)
>>+ omap_uart_setmux_mode(uart);
>>+
>> /* Clear wake-enable bit */
>> if (uart->wk_en && uart->wk_mask) {
>> u32 v = __raw_readl(uart->wk_en);
>>@@ -338,6 +356,9 @@ void omap_uart_resume_idle(int num)
>> if (num == uart->num) {
>> omap_uart_enable_clocks(uart);
>>
>>+ if (uart->muxmode && uart->padconf)
>>+ omap_uart_setmux_mode(uart);
>>+
>> /* Check for IO pad wakeup */
>> if (cpu_is_omap34xx() && uart->padconf) {
>> u16 p = omap_ctrl_readw(uart->padconf);
>>@@ -416,9 +437,10 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
>> omap_uart_smart_idle_enable(uart, 0);
>>
>> if (cpu_is_omap34xx()) {
>>- u32 mod = (uart->num == 2) ? OMAP3430_PER_MOD : CORE_MOD;
>>+ u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD;
>> u32 wk_mask = 0;
>> u32 padconf = 0;
>>+ u16 muxmode = 0;
>>
>> uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1);
>> uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1);
>>@@ -435,9 +457,15 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
>> wk_mask = OMAP3430_ST_UART3_MASK;
>> padconf = 0x19e;
>> break;
>>+ case 3:
>>+ wk_mask = OMAP3630_ST_UART4_MASK;
>>+ padconf = 0x0d2;
>>+ muxmode = OMAP_MUX_MODE2;
>>+ break;
>> }
>> uart->wk_mask = wk_mask;
>> uart->padconf = padconf;
>>+ uart->muxmode = muxmode;
>> } else if (cpu_is_omap24xx()) {
>> u32 wk_mask = 0;
>>
>>--
>>1.6.3.3
>>
>>
>>
>>
>>--
>>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] 11+ messages in thread* Re: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-04 14:03 ` Gopinath, Thara
@ 2010-06-04 14:08 ` Govindraj
0 siblings, 0 replies; 11+ messages in thread
From: Govindraj @ 2010-06-04 14:08 UTC (permalink / raw)
To: Gopinath, Thara
Cc: Raja, Govindraj, linux-omap@vger.kernel.org, Kevin Hilman,
Aguirre, Sergio
On Fri, Jun 4, 2010 at 7:33 PM, Gopinath, Thara <thara@ti.com> wrote:
>
>
>>>-----Original Message-----
>>>From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of
>>>Govindraj.R
>>>Sent: Friday, June 04, 2010 7:14 PM
>>>To: linux-omap@vger.kernel.org
>>>Cc: Kevin Hilman; Aguirre, Sergio
>>>Subject: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
>>>
>>>This patch makes the following:
>>> - Adds missing wakeup padding register handling.
>>> - Fixes a hardcode to use PER module ONLY on UART3.
>>> - Muxmode usage needed for uart4 for 3630 for padconf
>>> wakeup on rx line.
>>>
>>>Cc: Kevin Hilman <khilman@deeprootsystems.com>
>>>Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
>>>Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
>>>---
>>> arch/arm/mach-omap2/serial.c | 30 +++++++++++++++++++++++++++++-
>>> 1 files changed, 29 insertions(+), 1 deletions(-)
>>>
>>>diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
>>>index da9fee6..70a9089 100644
>>>--- a/arch/arm/mach-omap2/serial.c
>>>+++ b/arch/arm/mach-omap2/serial.c
>>>@@ -42,6 +42,7 @@
>>> #include "prm.h"
>>> #include "pm.h"
>>> #include "cm.h"
>>>+#include "mux.h"
>>> #include "prm-regbits-34xx.h"
>>>
>>> #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52
>>>@@ -68,6 +69,7 @@ struct omap_uart_state {
>>> u32 wk_mask;
>>> u32 padconf;
>>> u32 dma_enabled;
>>>+ u16 muxmode;
>>>
>>> struct clk *ick;
>>> struct clk *fck;
>>>@@ -229,8 +231,20 @@ static inline void omap_uart_disable_clocks(struct omap_uart_state *uart)
>>> omap_device_idle(uart->pdev);
>>> }
>>>
>>>+static inline void omap_uart_setmux_mode(struct omap_uart_state *uart)
>>>+{
>>>+ u16 w = omap_ctrl_readw(uart->padconf);
>>>+ w &= ~0x7;
>>>+ w |= OMAP_MUX_MODE2;
>
> Why it is hard coded to MUX_MODE2? Should it not be w |= uart->muxmode?
>
> Regards
> Thara
Yes correct it should been w |= uart->muxmode.
---
Regards,
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] 11+ messages in thread
* Re: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-04 13:43 [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630 Govindraj.R
2010-06-04 14:03 ` Gopinath, Thara
@ 2010-06-04 15:35 ` Kevin Hilman
2010-06-07 8:47 ` Govindraj
2010-06-07 10:06 ` Tony Lindgren
1 sibling, 2 replies; 11+ messages in thread
From: Kevin Hilman @ 2010-06-04 15:35 UTC (permalink / raw)
To: Govindraj.R; +Cc: linux-omap, Sergio Aguirre
"Govindraj.R" <govindraj.raja@ti.com> writes:
> This patch makes the following:
> - Adds missing wakeup padding register handling.
> - Fixes a hardcode to use PER module ONLY on UART3.
> - Muxmode usage needed for uart4 for 3630 for padconf
> wakeup on rx line.
The need for this muxmode needs to be better described.
The usage of the new set muxmode function is not terribly clear.
You're calling it in both _enable_wakeup() and _disable_wakeup() and
in _resume_idle(), but it's not terribly clear (to me, or the casual
changelog reader) why this is being done.
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
> Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
> ---
> arch/arm/mach-omap2/serial.c | 30 +++++++++++++++++++++++++++++-
> 1 files changed, 29 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> index da9fee6..70a9089 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -42,6 +42,7 @@
> #include "prm.h"
> #include "pm.h"
> #include "cm.h"
> +#include "mux.h"
> #include "prm-regbits-34xx.h"
>
> #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52
> @@ -68,6 +69,7 @@ struct omap_uart_state {
> u32 wk_mask;
> u32 padconf;
> u32 dma_enabled;
> + u16 muxmode;
>
> struct clk *ick;
> struct clk *fck;
> @@ -229,8 +231,20 @@ static inline void omap_uart_disable_clocks(struct omap_uart_state *uart)
> omap_device_idle(uart->pdev);
> }
>
> +static inline void omap_uart_setmux_mode(struct omap_uart_state *uart)
How about _set_muxmode()
> +{
> + u16 w = omap_ctrl_readw(uart->padconf);
insert blank line
> + w &= ~0x7;
> + w |= OMAP_MUX_MODE2;
> + omap_ctrl_writew(w, uart->padconf);
> +}
> +
> static void omap_uart_enable_wakeup(struct omap_uart_state *uart)
> {
> + /* Set appropriate muxmode */
you can drop these comments, as it doesn't add anything that the code
doesn't already say.
> + if (uart->muxmode && uart->padconf)
> + omap_uart_setmux_mode(uart);
> +
> /* Set wake-enable bit */
> if (uart->wk_en && uart->wk_mask) {
> u32 v = __raw_readl(uart->wk_en);
> @@ -248,6 +262,10 @@ static void omap_uart_enable_wakeup(struct omap_uart_state *uart)
>
> static void omap_uart_disable_wakeup(struct omap_uart_state *uart)
> {
> + /* Set appropriate muxmode */
> + if (uart->muxmode && uart->padconf)
> + omap_uart_setmux_mode(uart);
> +
> /* Clear wake-enable bit */
> if (uart->wk_en && uart->wk_mask) {
> u32 v = __raw_readl(uart->wk_en);
> @@ -338,6 +356,9 @@ void omap_uart_resume_idle(int num)
> if (num == uart->num) {
> omap_uart_enable_clocks(uart);
>
> + if (uart->muxmode && uart->padconf)
> + omap_uart_setmux_mode(uart);
> +
> /* Check for IO pad wakeup */
> if (cpu_is_omap34xx() && uart->padconf) {
> u16 p = omap_ctrl_readw(uart->padconf);
> @@ -416,9 +437,10 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
> omap_uart_smart_idle_enable(uart, 0);
>
> if (cpu_is_omap34xx()) {
> - u32 mod = (uart->num == 2) ? OMAP3430_PER_MOD : CORE_MOD;
> + u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD;
> u32 wk_mask = 0;
> u32 padconf = 0;
> + u16 muxmode = 0;
>
> uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1);
> uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1);
> @@ -435,9 +457,15 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
> wk_mask = OMAP3430_ST_UART3_MASK;
> padconf = 0x19e;
> break;
> + case 3:
> + wk_mask = OMAP3630_ST_UART4_MASK;
> + padconf = 0x0d2;
> + muxmode = OMAP_MUX_MODE2;
> + break;
> }
> uart->wk_mask = wk_mask;
> uart->padconf = padconf;
> + uart->muxmode = muxmode;
> } else if (cpu_is_omap24xx()) {
> u32 wk_mask = 0;
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-04 15:35 ` Kevin Hilman
@ 2010-06-07 8:47 ` Govindraj
2010-06-07 10:06 ` Tony Lindgren
1 sibling, 0 replies; 11+ messages in thread
From: Govindraj @ 2010-06-07 8:47 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Govindraj.R, linux-omap, Sergio Aguirre
On Fri, Jun 4, 2010 at 9:05 PM, Kevin Hilman
<khilman@deeprootsystems.com> wrote:
> "Govindraj.R" <govindraj.raja@ti.com> writes:
>
>> This patch makes the following:
>> - Adds missing wakeup padding register handling.
>> - Fixes a hardcode to use PER module ONLY on UART3.
>> - Muxmode usage needed for uart4 for 3630 for padconf
>> wakeup on rx line.
>
> The need for this muxmode needs to be better described.
>
> The usage of the new set muxmode function is not terribly clear.
> You're calling it in both _enable_wakeup() and _disable_wakeup() and
> in _resume_idle(), but it's not terribly clear (to me, or the casual
> changelog reader) why this is being done.
Intention was to ensure being in the right mux mode before accessing the
padconf reg. Since we have padconf usage in these function I have
mux mode configuration before accessing padconf reg.
Will update changelog accordingly.
>>
>> +static inline void omap_uart_setmux_mode(struct omap_uart_state *uart)
>
> How about _set_muxmode()
ok fine, will change to omap_uart_set_muxmode(
>
>> +{
>> + u16 w = omap_ctrl_readw(uart->padconf);
>
> insert blank line
Sure will do.
> } else if (cpu_is_omap24xx()) {
>> u32 wk_mask = 0;
>
> Kevin
> --
> 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
>
---
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] 11+ messages in thread* Re: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-04 15:35 ` Kevin Hilman
2010-06-07 8:47 ` Govindraj
@ 2010-06-07 10:06 ` Tony Lindgren
2010-06-07 11:32 ` Govindraj
1 sibling, 1 reply; 11+ messages in thread
From: Tony Lindgren @ 2010-06-07 10:06 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Govindraj.R, linux-omap, Sergio Aguirre
* Kevin Hilman <khilman@deeprootsystems.com> [100604 18:30]:
>
> > + w &= ~0x7;
> > + w |= OMAP_MUX_MODE2;
> > + omap_ctrl_writew(w, uart->padconf);
Generic NAK for tinkering with the mux registers directly.
Instead, Govindraj, please add omap_mux_request_signal() into mux.c:
void __iomem * __init omap_mux_request_signal(char *muxname);
Which returns the address of the mux register in question based
on the signal name. Then in the platform init code you can request
the pins for all the UARTs in use, and provide functions to remux
them as needed for the idle modes.
This will work for omap2 also at some point once it's converted to
use the common mux framework. And it will work in a generic way
for all omaps under mach-omap2 eventually.
You can take a look at the omap_mux_get_gpio() in mux.c for a
similar example.
Regards,
Tony
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-07 10:06 ` Tony Lindgren
@ 2010-06-07 11:32 ` Govindraj
2010-06-07 14:56 ` Govindraj
0 siblings, 1 reply; 11+ messages in thread
From: Govindraj @ 2010-06-07 11:32 UTC (permalink / raw)
To: Tony Lindgren; +Cc: Kevin Hilman, Govindraj.R, linux-omap, Sergio Aguirre
On Mon, Jun 7, 2010 at 3:36 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Kevin Hilman <khilman@deeprootsystems.com> [100604 18:30]:
>>
>> > + w &= ~0x7;
>> > + w |= OMAP_MUX_MODE2;
>> > + omap_ctrl_writew(w, uart->padconf);
>
> Generic NAK for tinkering with the mux registers directly.
>
> Instead, Govindraj, please add omap_mux_request_signal() into mux.c:
>
> void __iomem * __init omap_mux_request_signal(char *muxname);
>
> Which returns the address of the mux register in question based
> on the signal name. Then in the platform init code you can request
> the pins for all the UARTs in use, and provide functions to remux
> them as needed for the idle modes.
>
> This will work for omap2 also at some point once it's converted to
> use the common mux framework. And it will work in a generic way
> for all omaps under mach-omap2 eventually.
>
> You can take a look at the omap_mux_get_gpio() in mux.c for a
> similar example.
ok fine, will check out.
Thanks for the review.
---
Regards,
Govindraj.R
>
> Regards,
>
> Tony
> --
> 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
>
--
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] 11+ messages in thread
* Re: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-07 11:32 ` Govindraj
@ 2010-06-07 14:56 ` Govindraj
2010-06-09 14:28 ` Tony Lindgren
0 siblings, 1 reply; 11+ messages in thread
From: Govindraj @ 2010-06-07 14:56 UTC (permalink / raw)
To: Tony Lindgren; +Cc: Kevin Hilman, Govindraj.R, linux-omap, Sergio Aguirre
On Mon, Jun 7, 2010 at 5:02 PM, Govindraj <govindraj.ti@gmail.com> wrote:
> On Mon, Jun 7, 2010 at 3:36 PM, Tony Lindgren <tony@atomide.com> wrote:
>> * Kevin Hilman <khilman@deeprootsystems.com> [100604 18:30]:
>>>
>>> > + w &= ~0x7;
>>> > + w |= OMAP_MUX_MODE2;
>>> > + omap_ctrl_writew(w, uart->padconf);
>>
>> Generic NAK for tinkering with the mux registers directly.
>>
>> Instead, Govindraj, please add omap_mux_request_signal() into mux.c:
>>
>> void __iomem * __init omap_mux_request_signal(char *muxname);
Looking into mach-omap2/mux.c
Wouldn't retrieving offset will be enough as i have to depend on
again *_mux_* function call for remux which can have the offset and val
as parameter.
So I need to use ""K15_24XX_UART3_TX" as name to retrieve
UART3 offset if I am correct and traverse through the list doing an strcmp
on name to retrieve offset.
In that case I dont find uart1/2/4 in list,
Should that be added into the list?
Regards,
Govindraj.R
>>
>> Which returns the address of the mux register in question based
>> on the signal name. Then in the platform init code you can request
>> the pins for all the UARTs in use, and provide functions to remux
>> them as needed for the idle modes.
>>
>> This will work for omap2 also at some point once it's converted to
>> use the common mux framework. And it will work in a generic way
>> for all omaps under mach-omap2 eventually.
>>
>> You can take a look at the omap_mux_get_gpio() in mux.c for a
>> similar example.
>
--
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] 11+ messages in thread
* Re: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-07 14:56 ` Govindraj
@ 2010-06-09 14:28 ` Tony Lindgren
2010-06-10 8:54 ` Govindraj
0 siblings, 1 reply; 11+ messages in thread
From: Tony Lindgren @ 2010-06-09 14:28 UTC (permalink / raw)
To: Govindraj; +Cc: Kevin Hilman, Govindraj.R, linux-omap, Sergio Aguirre
* Govindraj <govindraj.ti@gmail.com> [100607 17:50]:
> On Mon, Jun 7, 2010 at 5:02 PM, Govindraj <govindraj.ti@gmail.com> wrote:
> > On Mon, Jun 7, 2010 at 3:36 PM, Tony Lindgren <tony@atomide.com> wrote:
> >> * Kevin Hilman <khilman@deeprootsystems.com> [100604 18:30]:
> >>>
> >>> > + w &= ~0x7;
> >>> > + w |= OMAP_MUX_MODE2;
> >>> > + omap_ctrl_writew(w, uart->padconf);
> >>
> >> Generic NAK for tinkering with the mux registers directly.
> >>
> >> Instead, Govindraj, please add omap_mux_request_signal() into mux.c:
> >>
> >> void __iomem * __init omap_mux_request_signal(char *muxname);
>
> Looking into mach-omap2/mux.c
>
> Wouldn't retrieving offset will be enough as i have to depend on
> again *_mux_* function call for remux which can have the offset and val
> as parameter.
You call omap_mux_request_signal with the signal name, and get
the register address. Then you can just set it with readw/writew.
> So I need to use ""K15_24XX_UART3_TX" as name to retrieve
> UART3 offset if I am correct and traverse through the list doing an strcmp
> on name to retrieve offset.
>
> In that case I dont find uart1/2/4 in list,
> Should that be added into the list?
No, that's the old mux code. You want to do something like
void __iomem *uart1_rx;
uart1_rx = omap_mux_request_signal("uart1_rx");
if (!uart1_rx)
return -ENODEV;
...
See the signal names in mux34xx.c and the TRM. Then omap2 and omap4
will work automatically once the mux code is ready for those.
Regards,
Tony
--
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] 11+ messages in thread* Re: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-09 14:28 ` Tony Lindgren
@ 2010-06-10 8:54 ` Govindraj
2010-06-10 11:12 ` Tony Lindgren
0 siblings, 1 reply; 11+ messages in thread
From: Govindraj @ 2010-06-10 8:54 UTC (permalink / raw)
To: Tony Lindgren; +Cc: Kevin Hilman, Govindraj.R, linux-omap, Sergio Aguirre
On Wed, Jun 9, 2010 at 7:58 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Govindraj <govindraj.ti@gmail.com> [100607 17:50]:
>> On Mon, Jun 7, 2010 at 5:02 PM, Govindraj <govindraj.ti@gmail.com> wrote:
>> > On Mon, Jun 7, 2010 at 3:36 PM, Tony Lindgren <tony@atomide.com> wrote:
>> >> * Kevin Hilman <khilman@deeprootsystems.com> [100604 18:30]:
>> >>>
>> >>> > + w &= ~0x7;
>> >>> > + w |= OMAP_MUX_MODE2;
>> >>> > + omap_ctrl_writew(w, uart->padconf);
>> >>
>> >> Generic NAK for tinkering with the mux registers directly.
>> >>
>> >> Instead, Govindraj, please add omap_mux_request_signal() into mux.c:
>> >>
>> >> void __iomem * __init omap_mux_request_signal(char *muxname);
>>
>> Looking into mach-omap2/mux.c
>>
>> Wouldn't retrieving offset will be enough as i have to depend on
>> again *_mux_* function call for remux which can have the offset and val
>> as parameter.
>
> You call omap_mux_request_signal with the signal name, and get
> the register address. Then you can just set it with readw/writew.
>
>> So I need to use ""K15_24XX_UART3_TX" as name to retrieve
>> UART3 offset if I am correct and traverse through the list doing an strcmp
>> on name to retrieve offset.
>>
>> In that case I dont find uart1/2/4 in list,
>> Should that be added into the list?
>
> No, that's the old mux code. You want to do something like
>
> void __iomem *uart1_rx;
>
> uart1_rx = omap_mux_request_signal("uart1_rx");
> if (!uart1_rx)
> return -ENODEV;
Thanks got it,
-> Shouldn't we just retrieve the offset and then use
omap_ctrl_writew\ omap_ctrl_readw calls?
-> I hope muxmode configuration can be done in the
existing code itself by manually populating the mode
and use offset retrieved from omap_mux_request_signal
and use omap_ctrl_writew.
Any comment?
--
Regards,
Govindraj.R
> ...
>
> See the signal names in mux34xx.c and the TRM. Then omap2 and omap4
> will work automatically once the mux code is ready for those.
>
> Regards,
>
> Tony
>
--
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] 11+ messages in thread* Re: [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630
2010-06-10 8:54 ` Govindraj
@ 2010-06-10 11:12 ` Tony Lindgren
0 siblings, 0 replies; 11+ messages in thread
From: Tony Lindgren @ 2010-06-10 11:12 UTC (permalink / raw)
To: Govindraj; +Cc: Kevin Hilman, Govindraj.R, linux-omap, Sergio Aguirre
* Govindraj <govindraj.ti@gmail.com> [100610 11:49]:
>
> -> Shouldn't we just retrieve the offset and then use
> omap_ctrl_writew\ omap_ctrl_readw calls?
Sure that works too. And that actually has the advantage
that it's more likely to keep the mux read/write access
in the platform init code.
> -> I hope muxmode configuration can be done in the
> existing code itself by manually populating the mode
> and use offset retrieved from omap_mux_request_signal
> and use omap_ctrl_writew.
> Any comment?
I'm not sure I follow you, but you should keep any mux
functions in the platform init code and keep the driver
as generic as possible.
Regards,
Tony
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-06-10 11:12 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-04 13:43 [pm-wip/uart][PATCH 2/4] OMAP3: serial: Fix uart4 handling for 3630 Govindraj.R
2010-06-04 14:03 ` Gopinath, Thara
2010-06-04 14:08 ` Govindraj
2010-06-04 15:35 ` Kevin Hilman
2010-06-07 8:47 ` Govindraj
2010-06-07 10:06 ` Tony Lindgren
2010-06-07 11:32 ` Govindraj
2010-06-07 14:56 ` Govindraj
2010-06-09 14:28 ` Tony Lindgren
2010-06-10 8:54 ` Govindraj
2010-06-10 11:12 ` Tony Lindgren
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).