Skip to contentSkip to conversation

OMAP3630: UART4 startup

RFC PATCH Superseded Sergio Aguirre 3 participants 8 messages Feb 26, 2010

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover OMAP3630: UART4 startup

Hi,

This is the v2 of the RFC for UART4 addition for 3630 chips.

Changes with respect to v1 [1]:
- Added AUTOIDLE handling.
- Added respective entries to prcm_setup_regs.

Indirect dependencies:
- Tested with Thomas Weber's patch [2].

Known issues:
- After enabling earlyprintk in 3630sdp, this is shown in the logs during bootup:

--- LOG START ---
Unhandled fault: imprecise external abort (0x1c06) at 0xc000e71c

 Internal error: : 1c06 [#1]
 last sysfs file:
 Modules linked in:
 CPU: 0    Not tainted  (2.6.33-rc8-07945-gac969e9 #13)
 PC is at init_timer_key+0x0/0x1c
 LR is at omap_serial_init_port+0xdc/0x2d4
 pc : [<c005cee0>]    lr : [<c000e54c>]    psr: 60000013
 sp : cf823f70  ip : d0800000  fp : c0381b68
 r10: c0381ed0  r9 : 00000360  r8 : c0381ec8
 r7 : 00000015  r6 : 00000000  r5 : 00000020  r4 : c0381b08
 r3 : c0035db8  r2 : 00000000  r1 : 00000000  r0 : c0381ed0
 Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
 Control: 10c5387f  Table: 80004019  DAC: 00000017
 Process swapper (pid: 1, stack limit = 0xcf8222e8)
 Stack: (0xcf823f70 to 0xcf824000)
 3f60:                                     00000003 fb020000 c0381aa8 00000004
 3f80: 00000004 c000b380 00000000 00000000 00000000 00000000 00000000 c000e76c
 3fa0: c00232e4 00000000 c000b380 c000fd78 c00232e4 c000fca4 c00232e4 c000b398
 3fc0: c00232e4 c002b33c 00000031 00000000 00000000 00000192 00000000 c00232e4
 3fe0: 00000000 00000000 00000000 c0008578 00000000 c002cdbc 00000000 00000000
 [<c005cee0>] (init_timer_key+0x0/0x1c) from [<c000e54c>] (omap_serial_init_port+0xdc/0x2d4)
 [<c000e54c>] (omap_serial_init_port+0xdc/0x2d4) from [<c000e76c>] (omap_serial_init+0x28/0x34)
 [<c000e76c>] (omap_serial_init+0x28/0x34) from [<c000fd78>] (zoom_peripherals_init+0x44/0x68)
 [<c000fd78>] (zoom_peripherals_init+0x44/0x68) from [<c000fca4>] (omap_sdp_init+0x14/0x50)
 [<c000fca4>] (omap_sdp_init+0x14/0x50) from [<c000b398>] (customize_machine+0x18/0x24)
 [<c000b398>] (customize_machine+0x18/0x24) from [<c002b33c>] (do_one_initcall+0x5c/0x1b4)
 [<c002b33c>] (do_one_initcall+0x5c/0x1b4) from [<c0008578>] (kernel_init+0x90/0x10c)
 [<c0008578>] (kernel_init+0x90/0x10c) from [<c002cdbc>] (kernel_thread_exit+0x0/0x8)
 Code: e5801004 e5831000 e5813004 e12fff1e (e3a03000)
 ---[ end trace 1b75b31a2719ed1c ]---
 Kernel panic - not syncing: Attempted to kill init!
 --- LOG END ---

Detailed patchlist summary:

Sergio Aguirre (5):
ARM: OMAP3630: PRCM: Add UART4 control bits
OMAP clock: Add UART4 autoidle bit for 3630
OMAP clock: Add uart4_ick/fck definitions for 3630
OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs
omap3: serial: Add uart4 wakeup handling

 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          |    4 ++++
 5 files changed, 38 insertions(+), 2 deletions(-)

Regards,
Sergio

[1] http://marc.info/?l=linux-omap&m=126710887505294&w=2
[2] http://marc.info/?l=linux-kernel&m=126709078514087&w=2

#1 lore raw

RFC PATCH v2 1/5 ARM: OMAP3630: PRCM: Add UART4 control bits

This bits are exclusive of omap 36xx family of chips.

---
 arch/arm/mach-omap2/prcm-common.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/prcm-common.h +4 -0
index 90f603d..c4e7bcb 100644
@@ -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
Signature · 1 line
1.6.3.3
#2 lore raw

RFC PATCH v2 2/5 OMAP clock: Add UART4 autoidle bit for 3630

In reply to Sergio Aguirre
---
 arch/arm/mach-omap2/cm-regbits-34xx.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/cm-regbits-34xx.h +2 -0
index a3a3ca0..834b671 100644
@@ -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)
Signature · 1 line
1.6.3.3
maintainer
#3 lore raw

Re: [RFC v2][PATCH 2/5] OMAP clock: Add UART4 autoidle bit for 3630

Quoted 1 line · Sergio Aguirre

This patch is missing a patch description.

It also should be combined with your patch #1.

- Paul

Quoted 24 lines
---
 arch/arm/mach-omap2/cm-regbits-34xx.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/cm-regbits-34xx.h +2 -0
index a3a3ca0..834b671 100644
@@ -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)
Signature · 6 lines
1.6.3.3

--
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
#4 lore raw

RFC PATCH v2 3/5 OMAP clock: Add uart4_ick/fck definitions for 3630

In reply to Sergio Aguirre

This is only valid for omap 36xx family of chips.

---
 arch/arm/mach-omap2/clock3xxx_data.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/clock3xxx_data.c +22 -0
index d5153b6..e8afaa6 100644
@@ -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),
Signature · 1 line
1.6.3.3
#5 lore raw

RFC PATCH v2 4/5 OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs

In reply to Sergio Aguirre
---
 arch/arm/mach-omap2/pm34xx.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/pm34xx.c +6 -2
index fee2efb..81082f2 100644
@@ -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 */
Signature · 1 line
1.6.3.3
#6 lore raw

RFC PATCH v2 5/5 omap3: serial: Add uart4 wakeup handling

In reply to Sergio Aguirre
---
 arch/arm/mach-omap2/serial.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/serial.c +4 -0
index da77930..6e1b17e 100644
@@ -475,6 +475,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;
Signature · 1 line
1.6.3.3
#7 lore raw

Re: [RFC v2][PATCH 5/5] omap3: serial: Add uart4 wakeup handling

Sergio Aguirre <[email protected]> writes:

This one needs a better changelog also.

Otherwise, change looks right.

Kevin

Quoted 27 lines
---
 arch/arm/mach-omap2/serial.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/serial.c +4 -0
index da77930..6e1b17e 100644
@@ -475,6 +475,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;
Signature · 6 lines
1.6.3.3

--
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