* [RFC part1/2 merge v3][PATCH 01/10] OMAP3: serial: Check for zero-based physical addr
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:21 ` Felipe Balbi
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 02/10] omap2/3/4: serial: Remove condition for getting uart4_phys Sergio Aguirre
` (9 subsequent siblings)
10 siblings, 1 reply; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
This is for protecting a wrong mapping attempt of a zero-based
physical address.
The result is that, no serial port will be attempted to be mapped.
Also add an additional protection for NULL clocks before attempting
to enable them (if above condition applies)
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/serial.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index da77930..6010d3d 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -664,6 +664,12 @@ void __init omap_serial_early_init(void)
struct device *dev = &pdev->dev;
struct plat_serial8250_port *p = dev->platform_data;
+ /* Don't map zero-based physical address */
+ if (p->mapbase == 0) {
+ printk(KERN_WARNING "omap serial: No physical address"
+ " for uart#%d, so skipping early_init...\n", i);
+ continue;
+ }
/*
* Module 4KB + L4 interconnect 4KB
* Static mapping, never released
@@ -727,6 +733,14 @@ void __init omap_serial_init_port(int port)
pdev = &uart->pdev;
dev = &pdev->dev;
+ /* Don't proceed if there's no clocks available */
+ if (unlikely(!uart->ick || !uart->fck)) {
+ printk(KERN_ERR "Can't init uart%d, no clocks available\n",
+ port);
+ WARN_ON(1);
+ return;
+ }
+
omap_uart_enable_clocks(uart);
omap_uart_reset(uart);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [RFC part1/2 merge v3][PATCH 01/10] OMAP3: serial: Check for zero-based physical addr
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 01/10] OMAP3: serial: Check for zero-based physical addr Sergio Aguirre
@ 2010-03-09 16:21 ` Felipe Balbi
2010-03-09 16:30 ` Aguirre, Sergio
0 siblings, 1 reply; 15+ messages in thread
From: Felipe Balbi @ 2010-03-09 16:21 UTC (permalink / raw)
To: Sergio Aguirre
Cc: linux-omap, Kevin Hilman, Vikram Pandita, Paul Walmsley,
Tony Lindgren, Felipe Balbi
On Tue, Mar 09, 2010 at 10:16:45AM -0600, Sergio Aguirre wrote:
> @@ -664,6 +664,12 @@ void __init omap_serial_early_init(void)
> struct device *dev = &pdev->dev;
> struct plat_serial8250_port *p = dev->platform_data;
>
> + /* Don't map zero-based physical address */
> + if (p->mapbase == 0) {
> + printk(KERN_WARNING "omap serial: No physical address"
> + " for uart#%d, so skipping early_init...\n", i);
> + continue;
you have a *dev available, could you use some of the dev_* macros ? Then
it's easy to know from where the message come from.
> @@ -727,6 +733,14 @@ void __init omap_serial_init_port(int port)
> pdev = &uart->pdev;
> dev = &pdev->dev;
>
> + /* Don't proceed if there's no clocks available */
> + if (unlikely(!uart->ick || !uart->fck)) {
> + printk(KERN_ERR "Can't init uart%d, no clocks available\n",
> + port);
> + WARN_ON(1);
change printk() + WARN_ON() into:
WARN(1, "%s: can't init uart%d, no clocks available\n",
koject_name(&dev->kobj), port);
--
balbi
^ permalink raw reply [flat|nested] 15+ messages in thread* RE: [RFC part1/2 merge v3][PATCH 01/10] OMAP3: serial: Check for zero-based physical addr
2010-03-09 16:21 ` Felipe Balbi
@ 2010-03-09 16:30 ` Aguirre, Sergio
2010-03-09 17:39 ` Felipe Balbi
0 siblings, 1 reply; 15+ messages in thread
From: Aguirre, Sergio @ 2010-03-09 16:30 UTC (permalink / raw)
To: me@felipebalbi.com
Cc: linux-omap@vger.kernel.org, Kevin Hilman, Pandita, Vikram,
Paul Walmsley, Tony Lindgren
Hi Felipe,
From: Felipe Balbi [mailto:me@felipebalbi.com]
Sent: Tuesday, March 09, 2010 10:21 AM
> On Tue, Mar 09, 2010 at 10:16:45AM -0600, Sergio Aguirre wrote:
> > @@ -664,6 +664,12 @@ void __init omap_serial_early_init(void)
> > struct device *dev = &pdev->dev;
> > struct plat_serial8250_port *p = dev->platform_data;
> >
> > + /* Don't map zero-based physical address */
> > + if (p->mapbase == 0) {
> > + printk(KERN_WARNING "omap serial: No physical address"
> > + " for uart#%d, so skipping early_init...\n", i);
> > + continue;
>
> you have a *dev available, could you use some of the dev_* macros ? Then
> it's easy to know from where the message come from.
Ok, I didn't do that, since there are other printks in the same function.
I can change it here, no problem.
I guess I can add a separate patch to standardize and change all
printks to dev_* macros... would that make sense?
>
> > @@ -727,6 +733,14 @@ void __init omap_serial_init_port(int port)
> > pdev = &uart->pdev;
> > dev = &pdev->dev;
> >
> > + /* Don't proceed if there's no clocks available */
> > + if (unlikely(!uart->ick || !uart->fck)) {
> > + printk(KERN_ERR "Can't init uart%d, no clocks available\n",
> > + port);
> > + WARN_ON(1);
>
> change printk() + WARN_ON() into:
>
> WARN(1, "%s: can't init uart%d, no clocks available\n",
> koject_name(&dev->kobj), port);
That looks nicer. Thanks!
Regards,
Sergio
>
> --
> balbi
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [RFC part1/2 merge v3][PATCH 01/10] OMAP3: serial: Check for zero-based physical addr
2010-03-09 16:30 ` Aguirre, Sergio
@ 2010-03-09 17:39 ` Felipe Balbi
0 siblings, 0 replies; 15+ messages in thread
From: Felipe Balbi @ 2010-03-09 17:39 UTC (permalink / raw)
To: Aguirre, Sergio
Cc: me@felipebalbi.com, linux-omap@vger.kernel.org, Kevin Hilman,
Pandita, Vikram, Paul Walmsley, Tony Lindgren
Hi,
On Tue, Mar 09, 2010 at 10:30:08AM -0600, Aguirre, Sergio wrote:
> Ok, I didn't do that, since there are other printks in the same function.
>
> I can change it here, no problem.
>
> I guess I can add a separate patch to standardize and change all
> printks to dev_* macros... would that make sense?
sure that would make more sense :-)
> > change printk() + WARN_ON() into:
> >
> > WARN(1, "%s: can't init uart%d, no clocks available\n",
> > koject_name(&dev->kobj), port);
>
> That looks nicer. Thanks!
np
--
balbi
^ permalink raw reply [flat|nested] 15+ messages in thread
* [RFC part1/2 merge v3][PATCH 02/10] omap2/3/4: serial: Remove condition for getting uart4_phys
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 01/10] OMAP3: serial: Check for zero-based physical addr Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 03/10] ARM: OMAP3630: PRCM: Add UART4 control bits Sergio Aguirre
` (8 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
This check is invalid, since we haven't filled the
omap_revision var at this point.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/serial.c | 14 +-------------
1 files changed, 1 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 6010d3d..c9e203b 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -115,7 +115,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
}
};
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
static struct plat_serial8250_port serial_platform_data3[] = {
{
.irq = 70,
@@ -128,23 +127,12 @@ static struct plat_serial8250_port serial_platform_data3[] = {
}
};
-static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals)
-{
- serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;
-}
-#else
-static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals)
-{
-}
-#endif
-
void __init omap2_set_globals_uart(struct omap_globals *omap2_globals)
{
serial_platform_data0[0].mapbase = omap2_globals->uart1_phys;
serial_platform_data1[0].mapbase = omap2_globals->uart2_phys;
serial_platform_data2[0].mapbase = omap2_globals->uart3_phys;
- if (cpu_is_omap3630() || cpu_is_omap44xx())
- omap2_set_globals_uart4(omap2_globals);
+ serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;
}
static inline unsigned int __serial_read_reg(struct uart_port *up,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC part1/2 merge v3][PATCH 03/10] ARM: OMAP3630: PRCM: Add UART4 control bits
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 01/10] OMAP3: serial: Check for zero-based physical addr Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 02/10] omap2/3/4: serial: Remove condition for getting uart4_phys Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 04/10] OMAP clock: Add uart4_ick/fck definitions for 3630 Sergio Aguirre
` (7 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
This bits are exclusive of omap 36xx family of chips.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/cm-regbits-34xx.h | 2 ++
arch/arm/mach-omap2/prcm-common.h | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h
index a3a3ca0..834b671 100644
--- a/arch/arm/mach-omap2/cm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-34xx.h
@@ -649,6 +649,8 @@
#define OMAP3430_ST_MCBSP2_MASK (1 << 0)
/* CM_AUTOIDLE_PER */
+#define OMAP3630_AUTO_UART4 (1 << 18)
+#define OMAP3630_AUTO_UART4_SHIFT 18
#define OMAP3430_AUTO_GPIO6 (1 << 17)
#define OMAP3430_AUTO_GPIO6_SHIFT 17
#define OMAP3430_AUTO_GPIO5 (1 << 16)
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 90f603d..c4e7bcb 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -390,6 +390,8 @@
#define OMAP3430_EN_MPU_SHIFT 1
/* CM_FCLKEN_PER, CM_ICLKEN_PER, PM_WKEN_PER shared bits */
+#define OMAP3630_EN_UART4 (1 << 18)
+#define OMAP3630_EN_UART4_SHIFT 18
#define OMAP3430_EN_GPIO6 (1 << 17)
#define OMAP3430_EN_GPIO6_SHIFT 17
#define OMAP3430_EN_GPIO5 (1 << 16)
@@ -430,6 +432,8 @@
#define OMAP3430_EN_MCBSP2_SHIFT 0
/* CM_IDLEST_PER, PM_WKST_PER shared bits */
+#define OMAP3630_ST_UART4_SHIFT 18
+#define OMAP3630_ST_UART4_MASK (1 << 18)
#define OMAP3430_ST_GPIO6_SHIFT 17
#define OMAP3430_ST_GPIO6_MASK (1 << 17)
#define OMAP3430_ST_GPIO5_SHIFT 16
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC part1/2 merge v3][PATCH 04/10] OMAP clock: Add uart4_ick/fck definitions for 3630
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
` (2 preceding siblings ...)
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 03/10] ARM: OMAP3630: PRCM: Add UART4 control bits Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 05/10] OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs Sergio Aguirre
` (6 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
This is only valid for omap 36xx family of chips.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/clock3xxx_data.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index d5153b6..e8afaa6 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -2541,6 +2541,16 @@ static struct clk uart3_fck = {
.recalc = &followparent_recalc,
};
+static struct clk uart4_fck = {
+ .name = "uart4_fck",
+ .ops = &clkops_omap2_dflt_wait,
+ .parent = &per_48m_fck,
+ .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+ .enable_bit = OMAP3630_EN_UART4_SHIFT,
+ .clkdm_name = "per_clkdm",
+ .recalc = &followparent_recalc,
+};
+
static struct clk gpt2_fck = {
.name = "gpt2_fck",
.ops = &clkops_omap2_dflt_wait,
@@ -2791,6 +2801,16 @@ static struct clk uart3_ick = {
.recalc = &followparent_recalc,
};
+static struct clk uart4_ick = {
+ .name = "uart4_ick",
+ .ops = &clkops_omap2_dflt_wait,
+ .parent = &per_l4_ick,
+ .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+ .enable_bit = OMAP3630_EN_UART4_SHIFT,
+ .clkdm_name = "per_clkdm",
+ .recalc = &followparent_recalc,
+};
+
static struct clk gpt9_ick = {
.name = "gpt9_ick",
.ops = &clkops_omap2_dflt_wait,
@@ -3420,6 +3440,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "per_96m_fck", &per_96m_fck, CK_3XXX),
CLK(NULL, "per_48m_fck", &per_48m_fck, CK_3XXX),
CLK(NULL, "uart3_fck", &uart3_fck, CK_3XXX),
+ CLK(NULL, "uart4_fck", &uart4_fck, CK_36XX),
CLK(NULL, "gpt2_fck", &gpt2_fck, CK_3XXX),
CLK(NULL, "gpt3_fck", &gpt3_fck, CK_3XXX),
CLK(NULL, "gpt4_fck", &gpt4_fck, CK_3XXX),
@@ -3443,6 +3464,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "gpio2_ick", &gpio2_ick, CK_3XXX),
CLK(NULL, "wdt3_ick", &wdt3_ick, CK_3XXX),
CLK(NULL, "uart3_ick", &uart3_ick, CK_3XXX),
+ CLK(NULL, "uart4_ick", &uart4_ick, CK_36XX),
CLK(NULL, "gpt9_ick", &gpt9_ick, CK_3XXX),
CLK(NULL, "gpt8_ick", &gpt8_ick, CK_3XXX),
CLK(NULL, "gpt7_ick", &gpt7_ick, CK_3XXX),
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC part1/2 merge v3][PATCH 05/10] OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
` (3 preceding siblings ...)
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 04/10] OMAP clock: Add uart4_ick/fck definitions for 3630 Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 06/10] omap3: serial: Fix uart4 handling for 3630 Sergio Aguirre
` (5 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
To standarize among other uarts (1 to 3), we shall now:
- Enable uart4 autodile bit.
- Enable uart4 wakeup in PER.
- Allow uart4 to wakeup the MPU.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/pm34xx.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index fee2efb..81082f2 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -734,6 +734,9 @@ static void __init omap3_d2d_idle(void)
static void __init prcm_setup_regs(void)
{
+ u32 omap3630_auto_uart4 = cpu_is_omap3630() ? OMAP3630_AUTO_UART4 : 0;
+ u32 omap3630_en_uart4 = cpu_is_omap3630() ? OMAP3630_EN_UART4 : 0;
+
/* XXX Reset all wkdeps. This should be done when initializing
* powerdomains */
prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
@@ -820,6 +823,7 @@ static void __init prcm_setup_regs(void)
CM_AUTOIDLE);
cm_write_mod_reg(
+ omap3630_auto_uart4 |
OMAP3430_AUTO_GPIO6 |
OMAP3430_AUTO_GPIO5 |
OMAP3430_AUTO_GPIO4 |
@@ -899,14 +903,14 @@ static void __init prcm_setup_regs(void)
OMAP3430_EN_GPIO4 | OMAP3430_EN_GPIO5 |
OMAP3430_EN_GPIO6 | OMAP3430_EN_UART3 |
OMAP3430_EN_MCBSP2 | OMAP3430_EN_MCBSP3 |
- OMAP3430_EN_MCBSP4,
+ OMAP3430_EN_MCBSP4 | omap3630_en_uart4,
OMAP3430_PER_MOD, PM_WKEN);
/* and allow them to wake up MPU */
prm_write_mod_reg(OMAP3430_GRPSEL_GPIO2 | OMAP3430_EN_GPIO3 |
OMAP3430_GRPSEL_GPIO4 | OMAP3430_EN_GPIO5 |
OMAP3430_GRPSEL_GPIO6 | OMAP3430_EN_UART3 |
OMAP3430_EN_MCBSP2 | OMAP3430_EN_MCBSP3 |
- OMAP3430_EN_MCBSP4,
+ OMAP3430_EN_MCBSP4 | omap3630_en_uart4,
OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);
/* Don't attach IVA interrupts */
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC part1/2 merge v3][PATCH 06/10] omap3: serial: Fix uart4 handling for 3630
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
` (4 preceding siblings ...)
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 05/10] OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 07/10] omap3: zoom2/3 / 3630sdp: Don't init always all uarts Sergio Aguirre
` (4 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
This patch makes the following:
- Adds missing wakeup padding register handling.
- Fixes a hardcode to use PER module ONLY on UART3.
- Adds UART4 IRQ number define for 36xx chips.
- Corrects IRQ number for 3630 case.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/serial.c | 9 ++++++++-
arch/arm/plat-omap/include/plat/irqs.h | 2 ++
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index c9e203b..02f992c 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -444,7 +444,7 @@ 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;
@@ -463,6 +463,10 @@ 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;
+ break;
}
uart->wk_mask = wk_mask;
uart->padconf = padconf;
@@ -694,6 +698,9 @@ void __init omap_serial_early_init(void)
if (cpu_is_omap44xx())
p->irq += 32;
+
+ if (cpu_is_omap3630() && (i == 3))
+ p->irq = INT_36XX_UART4_IRQ;
}
}
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index b65088a..7d3820c 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -358,6 +358,8 @@
#define INT_35XX_CCDC_VD1_IRQ 92
#define INT_35XX_CCDC_VD2_IRQ 93
+#define INT_36XX_UART4_IRQ 80
+
/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and
* 16 MPUIO lines */
#define OMAP_MAX_GPIO_LINES 192
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC part1/2 merge v3][PATCH 07/10] omap3: zoom2/3 / 3630sdp: Don't init always all uarts
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
` (5 preceding siblings ...)
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 06/10] omap3: serial: Fix uart4 handling for 3630 Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 08/10] omap3: 3630sdp: Explicitly enable all UARTs Sergio Aguirre
` (3 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
This is useless, since in Zoom2/3 boards, the ports aren't even
physically accessible.
They must be explicitly initted in the board-zoom2.c, board-zoom3.c
and board-3630sdp.c files instead.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/board-zoom-peripherals.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
mode change 100755 => 100644 arch/arm/mach-omap2/board-zoom-peripherals.c
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
old mode 100755
new mode 100644
index ca95d8d..6b39849
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -280,7 +280,6 @@ static void enable_board_wakeup_source(void)
void __init zoom_peripherals_init(void)
{
omap_i2c_init();
- omap_serial_init();
usb_musb_init(&musb_board_data);
enable_board_wakeup_source();
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC part1/2 merge v3][PATCH 08/10] omap3: 3630sdp: Explicitly enable all UARTs
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
` (6 preceding siblings ...)
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 07/10] omap3: zoom2/3 / 3630sdp: Don't init always all uarts Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 09/10] omap3: zoom 2/3: Change debugboard serial port id Sergio Aguirre
` (2 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
All UARTs seem physically reachable, so, enable them all.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/board-3630sdp.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
mode change 100755 => 100644 arch/arm/mach-omap2/board-3630sdp.c
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
old mode 100755
new mode 100644
index 4386d2b..399117a
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -96,6 +96,7 @@ static struct omap_board_mux board_mux[] __initdata = {
static void __init omap_sdp_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
+ omap_serial_init();
zoom_peripherals_init();
board_smc91x_init();
enable_board_wakeup_source();
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC part1/2 merge v3][PATCH 09/10] omap3: zoom 2/3: Change debugboard serial port id
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
` (7 preceding siblings ...)
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 08/10] omap3: 3630sdp: Explicitly enable all UARTs Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 10/10] omap3: zoom2/3: Register only 1 8250 port Sergio Aguirre
2010-03-09 16:33 ` [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Aguirre, Sergio
10 siblings, 0 replies; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
This is now changed to PLAT8250_DEV_PLATFORM (= 0), because
it's the only port that's going to be initialized in
Zoom 2/3 boards.
So, it doesn't make sense to keep the hardcoded 3 value anymore.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/board-zoom-debugboard.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c
index bb4018b..e15d2e8 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -96,7 +96,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
static struct platform_device zoom_debugboard_serial_device = {
.name = "serial8250",
- .id = 3,
+ .id = PLAT8250_DEV_PLATFORM,
.dev = {
.platform_data = serial_platform_data,
},
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [RFC part1/2 merge v3][PATCH 10/10] omap3: zoom2/3: Register only 1 8250 port
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
` (8 preceding siblings ...)
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 09/10] omap3: zoom 2/3: Change debugboard serial port id Sergio Aguirre
@ 2010-03-09 16:16 ` Sergio Aguirre
2010-03-09 16:33 ` [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Aguirre, Sergio
10 siblings, 0 replies; 15+ messages in thread
From: Sergio Aguirre @ 2010-03-09 16:16 UTC (permalink / raw)
To: linux-omap
Cc: Kevin Hilman, Vikram Pandita, Paul Walmsley, Tony Lindgren,
Felipe Balbi, Sergio Aguirre
There's no more serial ports available, so, doesn't make sense
to create 4 device nodes.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/configs/omap_zoom2_defconfig | 2 +-
arch/arm/configs/omap_zoom3_defconfig | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/configs/omap_zoom2_defconfig b/arch/arm/configs/omap_zoom2_defconfig
index a82e813..3dfd2d5 100644
--- a/arch/arm/configs/omap_zoom2_defconfig
+++ b/arch/arm/configs/omap_zoom2_defconfig
@@ -660,7 +660,7 @@ CONFIG_DEVKMEM=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=32
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
diff --git a/arch/arm/configs/omap_zoom3_defconfig b/arch/arm/configs/omap_zoom3_defconfig
index ff8ac3d..a1c0c43 100644
--- a/arch/arm/configs/omap_zoom3_defconfig
+++ b/arch/arm/configs/omap_zoom3_defconfig
@@ -680,7 +680,7 @@ CONFIG_DEVKMEM=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=32
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* RE: [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes
2010-03-09 16:16 [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes + zoom2/3 changes Sergio Aguirre
` (9 preceding siblings ...)
2010-03-09 16:16 ` [RFC part1/2 merge v3][PATCH 10/10] omap3: zoom2/3: Register only 1 8250 port Sergio Aguirre
@ 2010-03-09 16:33 ` Aguirre, Sergio
10 siblings, 0 replies; 15+ messages in thread
From: Aguirre, Sergio @ 2010-03-09 16:33 UTC (permalink / raw)
To: linux-omap@vger.kernel.org
Cc: Kevin Hilman, Pandita, Vikram, Paul Walmsley, Tony Lindgren,
Felipe Balbi
Hi,
On a general note.
To avoid spamming with frequent resends and version changes, I'll better
wait for any of you to review it today, and tomorrow I'll resend, grouping
all comments I'll receive today.
Thanks for your attention, comments and time!
Regards,
Sergio
> -----Original Message-----
> From: Aguirre, Sergio
> Sent: Tuesday, March 09, 2010 10:17 AM
> To: linux-omap@vger.kernel.org
> Cc: Kevin Hilman; Pandita, Vikram; Paul Walmsley; Tony Lindgren; Felipe
> Balbi; Aguirre, Sergio
> Subject: [RFC part1/2 merge v3][PATCH 00/10] omap2/3/4: uart4 fixes +
> zoom2/3 changes
>
> Hi,
>
> This is v3 of my serial work series merge found here: [1].
>
> And it's meant to be applied on top of Thomas's patch: [2]
>
> Changelog compared to previous version:
> - Added WARN_ON when no clocks acquired for a uart to be
> initialized. (Thanks Felipe and Kevin)
> - Added missing patch description to patch:
> "OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs"
> - Replaced unexisting word "initted" -> "initialized" (Thanks Kevin)
>
> Please let me know your comments and thoughts.
>
> Thanks to:
> - Vikram Pandita
> - Paul Walmsley
> - Kevin Hilman
> - Manjunath Kondaiah
> - Felipe Balbi
>
> For the feedback recieved so far. I really appreciate it.
>
> Regards,
> Sergio
>
> Detailed changelog:
>
> Sergio Aguirre (10):
> OMAP3: serial: Check for zero-based physical addr
> omap2/3/4: serial: Remove condition for getting uart4_phys
> ARM: OMAP3630: PRCM: Add UART4 control bits
> OMAP clock: Add uart4_ick/fck definitions for 3630
> OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs
> omap3: serial: Fix uart4 handling for 3630
> omap3: zoom2/3 / 3630sdp: Don't init always all uarts
> omap3: 3630sdp: Explicitly enable all UARTs
> omap3: zoom 2/3: Change debugboard serial port id
> omap3: zoom2/3: Register only 1 8250 port
>
> arch/arm/configs/omap_zoom2_defconfig | 2 +-
> arch/arm/configs/omap_zoom3_defconfig | 2 +-
> arch/arm/mach-omap2/board-3630sdp.c | 1 +
> arch/arm/mach-omap2/board-zoom-debugboard.c | 2 +-
> arch/arm/mach-omap2/board-zoom-peripherals.c | 1 -
> arch/arm/mach-omap2/clock3xxx_data.c | 22 +++++++++++++++
> arch/arm/mach-omap2/cm-regbits-34xx.h | 2 +
> arch/arm/mach-omap2/pm34xx.c | 8 ++++-
> arch/arm/mach-omap2/prcm-common.h | 4 +++
> arch/arm/mach-omap2/serial.c | 37 ++++++++++++++++-----
> -----
> arch/arm/plat-omap/include/plat/irqs.h | 2 +
> 11 files changed, 63 insertions(+), 20 deletions(-)
> mode change 100755 => 100644 arch/arm/mach-omap2/board-3630sdp.c
> mode change 100755 => 100644 arch/arm/mach-omap2/board-zoom-peripherals.c
>
> [1] http://marc.info/?l=linux-omap&m=126806929506991&w=2
> [2] http://marc.info/?l=linux-kernel&m=126709078514087&w=2
^ permalink raw reply [flat|nested] 15+ messages in thread