Skip to contentSkip to conversation

Initial multi-omap support for omap4

PATCH New Tony Lindgren 3 participants 17 messages Jan 30, 2010 – Feb 1, 2010

Subsystems (4)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

cover Initial multi-omap support for omap4

Hi all,

These patches allow compiling in also omap4 into the multi-omap configuration. As I don't yet have omap4, I've only boot tested these on omap2 and omap3.

Somebody with an omap4 board please boot test these with the omap3_defconfig and see what happens.. You might want to enable DEBUG_LL and EARLY_PRINTK with earlyprintk on the cmdline too.

Regards,

Tony

---

Tony Lindgren (9):
omap: Move multi-omap ifdeffery into it's own header file omap2/3/4: Clean up defines for entry-macro.S
omap4: Use get_irqnr_preamble
omap2/3/4: Clean up entry-macro.s for adding support for omap4 multiboot omap2/3/4: Allow booting omap4 with multi-omap configuration omap3/4: Fix compile for multi-omap for clkops_noncore_dpll_ops
omap: Fix gpio.c for multi-omap for omap4
omap2/3/4: Fix mach-omap2/serial.c for multiboot
omap2/3/4: Add omap4 into omap3_defconfnig

 arch/arm/configs/omap3_defconfig               |    6 +
 arch/arm/mach-omap2/clock34xx.c                |    2 
 arch/arm/mach-omap2/clock34xx.h                |    2 
 arch/arm/mach-omap2/clock34xx_data.c           |    6 -
 arch/arm/mach-omap2/clock44xx.c                |    2 
 arch/arm/mach-omap2/clock44xx.h                |    2 
 arch/arm/mach-omap2/clock44xx_data.c           |   12 +
 arch/arm/mach-omap2/include/mach/entry-macro.S |   81 +++++++--
 arch/arm/mach-omap2/serial.c                   |   18 +-
 arch/arm/plat-omap/gpio.c                      |  217 ++++++++++++++----------
 arch/arm/plat-omap/include/plat/cpu.h          |   70 --------
 arch/arm/plat-omap/include/plat/multi.h        |   94 ++++++++++
 12 files changed, 316 insertions(+), 196 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/multi.h
Signature · 1 line
Signature
author maintainer
#1 lore raw

PATCH 1/9 omap: Move multi-omap ifdeffery into it's own header file

This way we can include it easily as needed also for .S files.

---
 arch/arm/plat-omap/include/plat/cpu.h   |   70 -----------------------
 arch/arm/plat-omap/include/plat/multi.h |   94 +++++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+), 69 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/multi.h
arch/arm/plat-omap/include/plat/cpu.h +1 -69
index 995466d..b80151c 100644
@@ -31,6 +31,7 @@
 #define __ASM_ARCH_OMAP_CPU_H
 
 #include <linux/bitops.h>
+#include <plat/multi.h>
 
 /*
  * Omap device type i.e. EMU/HS/TST/GP/BAD
@@ -76,75 +77,6 @@ unsigned int omap_rev(void);
 #define GET_OMAP_REVISION()	((omap_rev() >> 8) & 0xff)
 
 /*
- * Test if multicore OMAP support is needed
- */
-#undef MULTI_OMAP1
-#undef MULTI_OMAP2
-#undef OMAP_NAME
-
-#ifdef CONFIG_ARCH_OMAP730
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP1
-#  define MULTI_OMAP1
-# else
-#  define OMAP_NAME omap730
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP850
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP1
-#  define MULTI_OMAP1
-# else
-#  define OMAP_NAME omap850
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP15XX
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP1
-#  define MULTI_OMAP1
-# else
-#  define OMAP_NAME omap1510
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP16XX
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP1
-#  define MULTI_OMAP1
-# else
-#  define OMAP_NAME omap16xx
-# endif
-#endif
-#if (defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
-# if (defined(OMAP_NAME) || defined(MULTI_OMAP1))
-#  error "OMAP1 and OMAP2 can't be selected at the same time"
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP2420
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP2
-#  define MULTI_OMAP2
-# else
-#  define OMAP_NAME omap2420
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP2430
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP2
-#  define MULTI_OMAP2
-# else
-#  define OMAP_NAME omap2430
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP3430
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP2
-#  define MULTI_OMAP2
-# else
-#  define OMAP_NAME omap3430
-# endif
-#endif
-
-/*
  * Macros to group OMAP into cpu classes.
  * These can be used in most places.
  * cpu_is_omap7xx():	True for OMAP730, OMAP850
arch/arm/plat-omap/include/plat/multi.h new file +94 -0

94 lines not on this page · raw message

author maintainer
#2 lore raw

PATCH 2/9 omap2/3/4: Clean up defines for entry-macro.S

In reply to Tony Lindgren

Define the irq base the same way as for omap2 and omap3, and start using get_irqnr_preamble.

---
 arch/arm/mach-omap2/include/mach/entry-macro.S |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/include/mach/entry-macro.S +7 -8
index 4fd6b1b..3e63aaa 100644
@@ -19,6 +19,12 @@
 #include <plat/omap34xx.h>
 #include <plat/omap44xx.h>
 
+#define OMAP2_IRQ_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
+#define OMAP3_IRQ_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
+#define OMAP4_IRQ_BASE		OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
+#define INTCPS_SIR_IRQ_OFFSET	0x0040	/* omap2/3 active interrupt offset */
+#define	ACTIVEIRQ_MASK		0x7f	/* omap2/3 active interrupt bits */
+
 		.macro	disable_fiq
 		.endm
 
@@ -27,11 +33,6 @@
 
 #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
 
-#define OMAP2_IRQ_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
-#define OMAP3_IRQ_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
-#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
-#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
-
 		.pushsection .data
 omap_irq_base:	.word	0
 		.popsection
@@ -90,8 +91,6 @@ omap_irq_base:	.word	0
 
 #ifdef CONFIG_ARCH_OMAP4
 
-#define OMAP44XX_VA_GIC_CPU_BASE	OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
-
 		.macro  get_irqnr_preamble, base, tmp
 		.endm
 
@@ -115,7 +114,7 @@ omap_irq_base:	.word	0
 		 * valid range for an IRQ (30-1020 inclusive).
 		 */
 		.macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-		ldr     \base, =OMAP44XX_VA_GIC_CPU_BASE
+		ldr     \base, =OMAP4_IRQ_BASE
 		ldr     \irqstat, [\base, #GIC_CPU_INTACK]
 
 		ldr     \tmp, =1021
author maintainer
#3 lore raw

PATCH 3/9 omap4: Use get_irqnr_preamble

In reply to Tony Lindgren

Use get_irqnr_preamble

---
 arch/arm/mach-omap2/include/mach/entry-macro.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/include/mach/entry-macro.S +1 -1
index 3e63aaa..101ed79 100644
@@ -92,6 +92,7 @@ omap_irq_base:	.word	0
 #ifdef CONFIG_ARCH_OMAP4
 
 		.macro  get_irqnr_preamble, base, tmp
+		ldr     \base, =OMAP4_IRQ_BASE
 		.endm
 
 		/*
@@ -114,7 +115,6 @@ omap_irq_base:	.word	0
 		 * valid range for an IRQ (30-1020 inclusive).
 		 */
 		.macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-		ldr     \base, =OMAP4_IRQ_BASE
 		ldr     \irqstat, [\base, #GIC_CPU_INTACK]
 
 		ldr     \tmp, =1021
author maintainer
#4 lore raw

PATCH 4/9 omap2/3/4: Clean up entry-macro.s for adding support for omap4 multiboot

In reply to Tony Lindgren

Move defines around and set up handlers based on MULTI_OMAP2.

Note that this will only allow compiling in omap4 with omap2 and omap3. It will not yet make omap4 boot with multi-omap.

---
 arch/arm/mach-omap2/include/mach/entry-macro.S |   38 +++++++++++++++++++++---
 1 files changed, 34 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/include/mach/entry-macro.S +34 -4
index 101ed79..fe3c9ad 100644
@@ -19,6 +19,8 @@
 #include <plat/omap34xx.h>
 #include <plat/omap44xx.h>
 
+#include <plat/multi.h>
+
 #define OMAP2_IRQ_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
 #define OMAP3_IRQ_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
 #define OMAP4_IRQ_BASE		OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
@@ -31,13 +33,15 @@
 		.macro  arch_ret_to_user, tmp1, tmp2
 		.endm
 
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+/*
+ * Unoptimized irq functions for multi-omap2, 3 and 4
+ */
 
+#ifdef MULTI_OMAP2
 		.pushsection .data
 omap_irq_base:	.word	0
 		.popsection
 
-#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_ARCH_OMAP3)
 		/* Configure the interrupt base on the first interrupt */
 		.macro  get_irqnr_preamble, base, tmp
 9:
@@ -62,7 +66,32 @@ omap_irq_base:	.word	0
 		b	9b
 9998:
 		.endm
-#else
+
+		/* Check the pending interrupts. Note that base already set */
+		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
+		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
+		cmp	\irqnr, #0x0
+		bne	9999f
+		ldr	\irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
+		cmp	\irqnr, #0x0
+		bne	9999f
+		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
+		cmp	\irqnr, #0x0
+9999:
+		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
+		and	\irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
+
+		.endm
+
+
+#else	/* MULTI_OMAP2 */
+
+
+/*
+ * Optimized irq functions for omap2, 3 and 4
+ */
+
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
 		.macro  get_irqnr_preamble, base, tmp
 #ifdef CONFIG_ARCH_OMAP2
 		ldr	\base, =OMAP2_IRQ_BASE
@@ -70,7 +99,7 @@ omap_irq_base:	.word	0
 		ldr	\base, =OMAP3_IRQ_BASE
 #endif
 		.endm
-#endif
+
 		/* Check the pending interrupts. Note that base already set */
 		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
 		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
@@ -155,6 +184,7 @@ omap_irq_base:	.word	0
 		cmp	\tmp, #0
 		.endm
 #endif
+#endif	/* MULTI_OMAP2 */
 
 		.macro	irq_prio_table
 		.endm
author maintainer
#5 lore raw

PATCH 5/9 omap2/3/4: Allow booting omap4 with multi-omap configuration

In reply to Tony Lindgren

Allow booting omap4 with multi-omap configuration.

Tested only on omap2 and omap3, please somebody test on omap4 and ack.

---
 arch/arm/mach-omap2/include/mach/entry-macro.S |   36 +++++++++++++++++++-----
 1 files changed, 29 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/include/mach/entry-macro.S +29 -7
index fe3c9ad..ff25c7e 100644
@@ -48,14 +48,18 @@ omap_irq_base:	.word	0
 		ldr	\base, =omap_irq_base	@ irq base address
 		ldr	\base, [\base, #0]	@ irq base value
 		cmp	\base, #0		@ already configured?
-		bne	9998f			@ nothing to do
+		bne	9997f			@ nothing to do
 
 		mrc	p15, 0, \tmp, c0, c0, 0	@ get processor revision
 		and	\tmp, \tmp, #0x000f0000	@ only check architecture
 		cmp	\tmp, #0x00060000	@ is v6?
 		beq	2400f			@ found v6 so it's omap24xx
-		cmp	\tmp, #0x000f0000	@ is cortex?
-		beq	3400f			@ found v7 so it's omap34xx
+		mrc	p15, 0, \tmp, c0, c0, 0	@ get processor revision
+		and	\tmp, \tmp, #0x000000f0	@ check cortex 8 or 9
+		cmp	\tmp, #0x00000080	@ cortex A-8?
+		beq	3400f			@ found A-8 so it's omap34xx
+		cmp	\tmp, #0x00000090	@ cortex A-9?
+		beq	4400f			@ found A-9 so it's omap44xx
 2400:		ldr	\base, =OMAP2_IRQ_BASE
 		ldr	\tmp, =omap_irq_base
 		str	\base, [\tmp, #0]
@@ -64,23 +68,41 @@ omap_irq_base:	.word	0
 		ldr	\tmp, =omap_irq_base
 		str	\base, [\tmp, #0]
 		b	9b
-9998:
+4400:		ldr	\base, =OMAP4_IRQ_BASE
+		ldr	\tmp, =omap_irq_base
+		str	\base, [\tmp, #0]
+		b	9b
+9997:
 		.endm
 
 		/* Check the pending interrupts. Note that base already set */
 		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
+		tst	\base, #0x100		@ gic address?
+		bne	4401f			@ found gic
+
+		/* Handle omap2 and omap3 */
 		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
 		cmp	\irqnr, #0x0
-		bne	9999f
+		bne	9998f
 		ldr	\irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
 		cmp	\irqnr, #0x0
-		bne	9999f
+		bne	9998f
 		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
 		cmp	\irqnr, #0x0
-9999:
+9998:
 		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
 		and	\irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
+		b	9999f
 
+		/* Handle omap4 */
+4401:		ldr     \irqstat, [\base, #GIC_CPU_INTACK]
+		ldr     \tmp, =1021
+		bic     \irqnr, \irqstat, #0x1c00
+		cmp     \irqnr, #29
+		cmpcc   \irqnr, \irqnr
+		cmpne   \irqnr, \tmp
+		cmpcs   \irqnr, \irqnr
+9999:
 		.endm
 
 
author maintainer
#6 lore raw

PATCH 6/9 omap3/4: Fix compile for multi-omap for clkops_noncore_dpll_ops

In reply to Tony Lindgren

Rename clkops_noncore_dpll_ops for omap3 and omap4.

---
 arch/arm/mach-omap2/clock34xx.c      |    2 +-
 arch/arm/mach-omap2/clock34xx.h      |    2 +-
 arch/arm/mach-omap2/clock34xx_data.c |    6 +++---
 arch/arm/mach-omap2/clock44xx.c      |    2 +-
 arch/arm/mach-omap2/clock44xx.h      |    2 +-
 arch/arm/mach-omap2/clock44xx_data.c |   12 ++++++------
 6 files changed, 13 insertions(+), 13 deletions(-)
arch/arm/mach-omap2/clock34xx.c +1 -1
index 1f1b5a6..ae9e2c8 100644
@@ -130,7 +130,7 @@ const struct clkops clkops_omap3430es2_hsotgusb_wait = {
 	.find_companion = omap2_clk_dflt_find_companion,
 };
 
-const struct clkops clkops_noncore_dpll_ops = {
+const struct clkops omap3_clkops_noncore_dpll_ops = {
 	.enable		= omap3_noncore_dpll_enable,
 	.disable	= omap3_noncore_dpll_disable,
 };
arch/arm/mach-omap2/clock34xx.h +1 -1
index 73f2109..313efc0 100644
@@ -20,6 +20,6 @@ extern struct clk *arm_fck_p;
 extern const struct clkops clkops_omap3430es2_ssi_wait;
 extern const struct clkops clkops_omap3430es2_hsotgusb_wait;
 extern const struct clkops clkops_omap3430es2_dss_usbhost_wait;
-extern const struct clkops clkops_noncore_dpll_ops;
+extern const struct clkops omap3_clkops_noncore_dpll_ops;
 
 #endif
arch/arm/mach-omap2/clock34xx_data.c +3 -3
index 0d04f92..8728f1f 100644
@@ -337,7 +337,7 @@ static struct dpll_data dpll2_dd = {
 
 static struct clk dpll2_ck = {
 	.name		= "dpll2_ck",
-	.ops		= &clkops_noncore_dpll_ops,
+	.ops		= &omap3_clkops_noncore_dpll_ops,
 	.parent		= &sys_ck,
 	.dpll_data	= &dpll2_dd,
 	.round_rate	= &omap2_dpll_round_rate,
@@ -554,7 +554,7 @@ static struct dpll_data dpll4_dd = {
 
 static struct clk dpll4_ck = {
 	.name		= "dpll4_ck",
-	.ops		= &clkops_noncore_dpll_ops,
+	.ops		= &omap3_clkops_noncore_dpll_ops,
 	.parent		= &sys_ck,
 	.dpll_data	= &dpll4_dd,
 	.round_rate	= &omap2_dpll_round_rate,
@@ -854,7 +854,7 @@ static struct dpll_data dpll5_dd = {
 
 static struct clk dpll5_ck = {
 	.name		= "dpll5_ck",
-	.ops		= &clkops_noncore_dpll_ops,
+	.ops		= &omap3_clkops_noncore_dpll_ops,
 	.parent		= &sys_ck,
 	.dpll_data	= &dpll5_dd,
 	.round_rate	= &omap2_dpll_round_rate,
arch/arm/mach-omap2/clock44xx.c +1 -1
index c238717..84ee6b0 100644
@@ -13,7 +13,7 @@
 #include <linux/errno.h>
 #include "clock.h"
 
-const struct clkops clkops_noncore_dpll_ops = {
+const struct clkops omap4_clkops_noncore_dpll_ops = {
 	.enable		= &omap3_noncore_dpll_enable,
 	.disable	= &omap3_noncore_dpll_disable,
 };
arch/arm/mach-omap2/clock44xx.h +1 -1
index 1f55b6b..efe8494 100644
@@ -12,6 +12,6 @@
 
 int omap4xxx_clk_init(void);
 
-extern const struct clkops clkops_noncore_dpll_ops;
+extern const struct clkops omap4_clkops_noncore_dpll_ops;
 
 #endif
arch/arm/mach-omap2/clock44xx_data.c +6 -6
index 35ffe63..86af31d 100644
@@ -279,7 +279,7 @@ static struct clk dpll_abe_ck = {
 	.parent		= &abe_dpll_refclk_mux_ck,
 	.dpll_data	= &dpll_abe_dd,
 	.init		= &omap2_init_dpll_parent,
-	.ops		= &clkops_noncore_dpll_ops,
+	.ops		= &omap4_clkops_noncore_dpll_ops,
 	.recalc		= &omap3_dpll_recalc,
 	.round_rate	= &omap2_dpll_round_rate,
 	.set_rate	= &omap3_noncore_dpll_set_rate,
@@ -668,7 +668,7 @@ static struct clk dpll_iva_ck = {
 	.parent		= &dpll_sys_ref_clk,
 	.dpll_data	= &dpll_iva_dd,
 	.init		= &omap2_init_dpll_parent,
-	.ops		= &clkops_noncore_dpll_ops,
+	.ops		= &omap4_clkops_noncore_dpll_ops,
 	.recalc		= &omap3_dpll_recalc,
 	.round_rate	= &omap2_dpll_round_rate,
 	.set_rate	= &omap3_noncore_dpll_set_rate,
@@ -731,7 +731,7 @@ static struct clk dpll_mpu_ck = {
 	.parent		= &dpll_sys_ref_clk,
 	.dpll_data	= &dpll_mpu_dd,
 	.init		= &omap2_init_dpll_parent,
-	.ops		= &clkops_noncore_dpll_ops,
+	.ops		= &omap4_clkops_noncore_dpll_ops,
 	.recalc		= &omap3_dpll_recalc,
 	.round_rate	= &omap2_dpll_round_rate,
 	.set_rate	= &omap3_noncore_dpll_set_rate,
@@ -807,7 +807,7 @@ static struct clk dpll_per_ck = {
 	.parent		= &dpll_sys_ref_clk,
 	.dpll_data	= &dpll_per_dd,
 	.init		= &omap2_init_dpll_parent,
-	.ops		= &clkops_noncore_dpll_ops,
+	.ops		= &omap4_clkops_noncore_dpll_ops,
 	.recalc		= &omap3_dpll_recalc,
 	.round_rate	= &omap2_dpll_round_rate,
 	.set_rate	= &omap3_noncore_dpll_set_rate,
@@ -930,7 +930,7 @@ static struct clk dpll_unipro_ck = {
 	.parent		= &dpll_sys_ref_clk,
 	.dpll_data	= &dpll_unipro_dd,
 	.init		= &omap2_init_dpll_parent,
-	.ops		= &clkops_noncore_dpll_ops,
+	.ops		= &omap4_clkops_noncore_dpll_ops,
 	.recalc		= &omap3_dpll_recalc,
 	.round_rate	= &omap2_dpll_round_rate,
 	.set_rate	= &omap3_noncore_dpll_set_rate,
@@ -988,7 +988,7 @@ static struct clk dpll_usb_ck = {
 	.parent		= &dpll_sys_ref_clk,
 	.dpll_data	= &dpll_usb_dd,
 	.init		= &omap2_init_dpll_parent,
-	.ops		= &clkops_noncore_dpll_ops,
+	.ops		= &omap4_clkops_noncore_dpll_ops,
 	.recalc		= &omap3_dpll_recalc,
 	.round_rate	= &omap2_dpll_round_rate,
 	.set_rate	= &omap3_noncore_dpll_set_rate,
author maintainer
#8 lore raw

PATCH 7/9 omap: Fix gpio.c for multi-omap for omap4

In reply to Tony Lindgren

Set up METHOD_GPIO_44XX instead of trying to use the METHOD_GPIO_24XX.

---
 arch/arm/plat-omap/gpio.c |  217 ++++++++++++++++++++++++++-------------------
 1 files changed, 126 insertions(+), 91 deletions(-)
arch/arm/plat-omap/gpio.c +126 -91
index a888304..4395d15 100644
@@ -202,6 +202,7 @@ struct gpio_bank {
 #define METHOD_GPIO_1610	2
 #define METHOD_GPIO_7XX		3
 #define METHOD_GPIO_24XX	5
+#define METHOD_GPIO_44XX	6
 
 #ifdef CONFIG_ARCH_OMAP16XX
 static struct gpio_bank gpio_bank_1610[5] = {
@@ -312,17 +313,17 @@ static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS];
 #ifdef CONFIG_ARCH_OMAP4
 static struct gpio_bank gpio_bank_44xx[6] = {
 	{ OMAP44XX_GPIO1_BASE, NULL, INT_44XX_GPIO_BANK1, IH_GPIO_BASE,
-		METHOD_GPIO_24XX },
+		METHOD_GPIO_44XX },
 	{ OMAP44XX_GPIO2_BASE, NULL, INT_44XX_GPIO_BANK2, IH_GPIO_BASE + 32,
-		METHOD_GPIO_24XX },
+		METHOD_GPIO_44XX },
 	{ OMAP44XX_GPIO3_BASE, NULL, INT_44XX_GPIO_BANK3, IH_GPIO_BASE + 64,
-		METHOD_GPIO_24XX },
+		METHOD_GPIO_44XX },
 	{ OMAP44XX_GPIO4_BASE, NULL, INT_44XX_GPIO_BANK4, IH_GPIO_BASE + 96,
-		METHOD_GPIO_24XX },
+		METHOD_GPIO_44XX },
 	{ OMAP44XX_GPIO5_BASE, NULL, INT_44XX_GPIO_BANK5, IH_GPIO_BASE + 128,
-		METHOD_GPIO_24XX },
+		METHOD_GPIO_44XX },
 	{ OMAP44XX_GPIO6_BASE, NULL, INT_44XX_GPIO_BANK6, IH_GPIO_BASE + 160,
-		METHOD_GPIO_24XX },
+		METHOD_GPIO_44XX },
 };
 
 #endif
@@ -430,7 +431,7 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
 		break;
 #endif
 #if defined(CONFIG_ARCH_OMAP4)
-	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		reg += OMAP4_GPIO_OE;
 		break;
 #endif
@@ -501,7 +502,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
 		break;
 #endif
 #ifdef CONFIG_ARCH_OMAP4
-	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		if (enable)
 			reg += OMAP4_GPIO_SETDATAOUT;
 		else
@@ -550,7 +551,7 @@ static int _get_gpio_datain(struct gpio_bank *bank, int gpio)
 		break;
 #endif
 #ifdef CONFIG_ARCH_OMAP4
-	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		reg += OMAP4_GPIO_DATAIN;
 		break;
 #endif
@@ -592,6 +593,7 @@ static int _get_gpio_dataout(struct gpio_bank *bank, int gpio)
 #endif
 #ifdef CONFIG_ARCH_OMAP2PLUS
 	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		reg += OMAP24XX_GPIO_DATAOUT;
 		break;
 #endif
@@ -622,11 +624,12 @@ void omap_set_gpio_debounce(int gpio, int enable)
 
 	bank = get_gpio_bank(gpio);
 	reg = bank->base;
-#ifdef CONFIG_ARCH_OMAP4
-	reg += OMAP4_GPIO_DEBOUNCENABLE;
-#else
-	reg += OMAP24XX_GPIO_DEBOUNCE_EN;
-#endif
+
+	if (cpu_is_omap44xx())
+		reg += OMAP4_GPIO_DEBOUNCENABLE;
+	else
+		reg += OMAP24XX_GPIO_DEBOUNCE_EN;
+
 	if (!(bank->mod_usage & l)) {
 		printk(KERN_ERR "GPIO %d not requested\n", gpio);
 		return;
@@ -672,11 +675,12 @@ void omap_set_gpio_debounce_time(int gpio, int enc_time)
 	}
 
 	enc_time &= 0xff;
-#ifdef CONFIG_ARCH_OMAP4
-	reg += OMAP4_GPIO_DEBOUNCINGTIME;
-#else
-	reg += OMAP24XX_GPIO_DEBOUNCE_VAL;
-#endif
+
+	if (cpu_is_omap44xx())
+		reg += OMAP4_GPIO_DEBOUNCINGTIME;
+	else
+		reg += OMAP24XX_GPIO_DEBOUNCE_VAL;
+
 	__raw_writel(enc_time, reg);
 }
 EXPORT_SYMBOL(omap_set_gpio_debounce_time);
@@ -854,6 +858,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 #endif
 #ifdef CONFIG_ARCH_OMAP2PLUS
 	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		set_24xx_gpio_triggering(bank, gpio, trigger);
 		break;
 #endif
@@ -938,7 +943,7 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
 		break;
 #endif
 #if defined(CONFIG_ARCH_OMAP4)
-	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		reg += OMAP4_GPIO_IRQSTATUS0;
 		break;
 #endif
@@ -949,12 +954,11 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
 	__raw_writel(gpio_mask, reg);
 
 	/* Workaround for clearing DSP GPIO interrupts to allow retention */
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-	reg = bank->base + OMAP24XX_GPIO_IRQSTATUS2;
-#endif
-#if defined(CONFIG_ARCH_OMAP4)
-	reg = bank->base + OMAP4_GPIO_IRQSTATUS1;
-#endif
+	if (cpu_is_omap24xx() || cpu_is_omap34xx())
+		reg = bank->base + OMAP24XX_GPIO_IRQSTATUS2;
+	else if (cpu_is_omap44xx())
+		reg = bank->base + OMAP4_GPIO_IRQSTATUS1;
+
 	if (cpu_is_omap24xx() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
 		__raw_writel(gpio_mask, reg);
 
@@ -1010,7 +1014,7 @@ static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank)
 		break;
 #endif
 #if defined(CONFIG_ARCH_OMAP4)
-	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		reg += OMAP4_GPIO_IRQSTATUSSET0;
 		mask = 0xffffffff;
 		break;
@@ -1082,7 +1086,7 @@ static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enab
 		break;
 #endif
 #ifdef CONFIG_ARCH_OMAP4
-	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		if (enable)
 			reg += OMAP4_GPIO_IRQSTATUSSET0;
 		else
@@ -1128,6 +1132,7 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
 #endif
 #ifdef CONFIG_ARCH_OMAP2PLUS
 	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		if (bank->non_wakeup_gpios & (1 << gpio)) {
 			printk(KERN_ERR "Unable to modify wakeup on "
 					"non-wakeup GPIO%d\n",
@@ -1222,7 +1227,8 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
 	}
 #endif
 #ifdef CONFIG_ARCH_OMAP2PLUS
-	if (bank->method == METHOD_GPIO_24XX) {
+	if ((bank->method == METHOD_GPIO_24XX) ||
+			(bank->method == METHOD_GPIO_44XX)) {
 		/* Disable wake-up during idle for dynamic tick */
 		void __iomem *reg = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
 		__raw_writel(1 << offset, reg);
@@ -1284,7 +1290,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 		isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1;
 #endif
 #if defined(CONFIG_ARCH_OMAP4)
-	if (bank->method == METHOD_GPIO_24XX)
+	if (bank->method == METHOD_GPIO_44XX)
 		isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0;
 #endif
 	while(1) {
@@ -1564,6 +1570,7 @@ static int gpio_is_input(struct gpio_bank *bank, int mask)
 		reg += OMAP7XX_GPIO_DIR_CONTROL;
 		break;
 	case METHOD_GPIO_24XX:
+	case METHOD_GPIO_44XX:
 		reg += OMAP24XX_GPIO_OE;
 		break;
 	}
@@ -1803,28 +1810,34 @@ static int __init _omap_gpio_init(void)
 		}
 
 #ifdef CONFIG_ARCH_OMAP2PLUS
-		if (bank->method == METHOD_GPIO_24XX) {
+		if ((bank->method == METHOD_GPIO_24XX) ||
+				(bank->method == METHOD_GPIO_44XX)) {
 			static const u32 non_wakeup_gpios[] = {
 				0xe203ffc0, 0x08700040
 			};
-		if (cpu_is_omap44xx()) {
-			__raw_writel(0xffffffff, bank->base +
+
+			if (cpu_is_omap44xx()) {
+				__raw_writel(0xffffffff, bank->base +
 						OMAP4_GPIO_IRQSTATUSCLR0);
-			__raw_writew(0x0015, bank->base +
+				__raw_writew(0x0015, bank->base +
 						OMAP4_GPIO_SYSCONFIG);
-			__raw_writel(0x00000000, bank->base +
+				__raw_writel(0x00000000, bank->base +
 						 OMAP4_GPIO_DEBOUNCENABLE);
-			/* Initialize interface clock ungated, module enabled */
-			__raw_writel(0, bank->base + OMAP4_GPIO_CTRL);
-		} else {
-			__raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_IRQENABLE1);
-			__raw_writel(0xffffffff, bank->base + OMAP24XX_GPIO_IRQSTATUS1);
-			__raw_writew(0x0015, bank->base + OMAP24XX_GPIO_SYSCONFIG);
-			__raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_DEBOUNCE_EN);
-
-			/* Initialize interface clock ungated, module enabled */
-			__raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL);
-		}
+				/* Initialize interface clock ungated, module enabled */
+				__raw_writel(0, bank->base + OMAP4_GPIO_CTRL);
+			} else {
+				__raw_writel(0x00000000, bank->base +
+						OMAP24XX_GPIO_IRQENABLE1);
+				__raw_writel(0xffffffff, bank->base +
+						OMAP24XX_GPIO_IRQSTATUS1);
+				__raw_writew(0x0015, bank->base +
+						OMAP24XX_GPIO_SYSCONFIG);
+				__raw_writel(0x00000000, bank->base +
+						OMAP24XX_GPIO_DEBOUNCE_EN);
+
+				/* Initialize interface clock ungated, module enabled */
+				__raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL);
+			}
 			if (i < ARRAY_SIZE(non_wakeup_gpios))
 				bank->non_wakeup_gpios = non_wakeup_gpios[i];
 			gpio_count = 32;
@@ -1926,7 +1939,7 @@ static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
 			break;
 #endif
 #ifdef CONFIG_ARCH_OMAP4
-		case METHOD_GPIO_24XX:
+		case METHOD_GPIO_44XX:
 			wake_status = bank->base + OMAP4_GPIO_IRQWAKEN0;
 			wake_clear = bank->base + OMAP4_GPIO_IRQWAKEN0;
 			wake_set = bank->base + OMAP4_GPIO_IRQWAKEN0;
@@ -1973,7 +1986,7 @@ static int omap_gpio_resume(struct sys_device *dev)
 			break;
 #endif
 #ifdef CONFIG_ARCH_OMAP4
-		case METHOD_GPIO_24XX:
+		case METHOD_GPIO_44XX:
 			wake_clear = bank->base + OMAP4_GPIO_IRQWAKEN0;
 			wake_set = bank->base + OMAP4_GPIO_IRQWAKEN0;
 			break;
@@ -2020,29 +2033,42 @@ void omap2_gpio_prepare_for_retention(void)
 
 		if (!(bank->enabled_non_wakeup_gpios))
 			continue;
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-		bank->saved_datain = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
-		l1 = __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT);
-		l2 = __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT);
-#endif
-#ifdef CONFIG_ARCH_OMAP4
-		bank->saved_datain = __raw_readl(bank->base +
-							OMAP4_GPIO_DATAIN);
-		l1 = __raw_readl(bank->base + OMAP4_GPIO_FALLINGDETECT);
-		l2 = __raw_readl(bank->base + OMAP4_GPIO_RISINGDETECT);
-#endif
+
+		if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+			bank->saved_datain = __raw_readl(bank->base +
+					OMAP24XX_GPIO_DATAIN);
+			l1 = __raw_readl(bank->base +
+					OMAP24XX_GPIO_FALLINGDETECT);
+			l2 = __raw_readl(bank->base +
+					OMAP24XX_GPIO_RISINGDETECT);
+		}
+
+		if (cpu_is_omap44xx()) {
+			bank->saved_datain = __raw_readl(bank->base +
+						OMAP4_GPIO_DATAIN);
+			l1 = __raw_readl(bank->base +
+						OMAP4_GPIO_FALLINGDETECT);
+			l2 = __raw_readl(bank->base +
+						OMAP4_GPIO_RISINGDETECT);
+		}
+
 		bank->saved_fallingdetect = l1;
 		bank->saved_risingdetect = l2;
 		l1 &= ~bank->enabled_non_wakeup_gpios;
 		l2 &= ~bank->enabled_non_wakeup_gpios;
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-		__raw_writel(l1, bank->base + OMAP24XX_GPIO_FALLINGDETECT);
-		__raw_writel(l2, bank->base + OMAP24XX_GPIO_RISINGDETECT);
-#endif
-#ifdef CONFIG_ARCH_OMAP4
-		__raw_writel(l1, bank->base + OMAP4_GPIO_FALLINGDETECT);
-		__raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
-#endif
+
+		if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+			__raw_writel(l1, bank->base +
+					OMAP24XX_GPIO_FALLINGDETECT);
+			__raw_writel(l2, bank->base +
+					OMAP24XX_GPIO_RISINGDETECT);
+		}
+
+		if (cpu_is_omap44xx()) {
+			__raw_writel(l1, bank->base + OMAP4_GPIO_FALLINGDETECT);
+			__raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
+		}
+
 		c++;
 	}
 	if (!c) {
@@ -2064,20 +2090,23 @@ void omap2_gpio_resume_after_retention(void)
 
 		if (!(bank->enabled_non_wakeup_gpios))
 			continue;
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-		__raw_writel(bank->saved_fallingdetect,
+
+		if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+			__raw_writel(bank->saved_fallingdetect,
 				 bank->base + OMAP24XX_GPIO_FALLINGDETECT);
-		__raw_writel(bank->saved_risingdetect,
+			__raw_writel(bank->saved_risingdetect,
 				 bank->base + OMAP24XX_GPIO_RISINGDETECT);
-		l = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
-#endif
-#ifdef CONFIG_ARCH_OMAP4
-		__raw_writel(bank->saved_fallingdetect,
+			l = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
+		}
+
+		if (cpu_is_omap44xx()) {
+			__raw_writel(bank->saved_fallingdetect,
 				 bank->base + OMAP4_GPIO_FALLINGDETECT);
-		__raw_writel(bank->saved_risingdetect,
+			__raw_writel(bank->saved_risingdetect,
 				 bank->base + OMAP4_GPIO_RISINGDETECT);
-		l = __raw_readl(bank->base + OMAP4_GPIO_DATAIN);
-#endif
+			l = __raw_readl(bank->base + OMAP4_GPIO_DATAIN);
+		}
+
 		/* Check if any of the non-wakeup interrupt GPIOs have changed
 		 * state.  If so, generate an IRQ by software.  This is
 		 * horribly racy, but it's the best we can do to work around
@@ -2103,30 +2132,36 @@ void omap2_gpio_resume_after_retention(void)
 
 		if (gen) {
 			u32 old0, old1;
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-			old0 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0);
-			old1 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
+
+			if (cpu_is_omap24xx() || cpu_is_omap44xx()) {
+				old0 = __raw_readl(bank->base +
+					OMAP24XX_GPIO_LEVELDETECT0);
+				old1 = __raw_readl(bank->base +
+					OMAP24XX_GPIO_LEVELDETECT1);
 			__raw_writel(old0 | gen, bank->base +
 					OMAP24XX_GPIO_LEVELDETECT0);
 			__raw_writel(old1 | gen, bank->base +
 					OMAP24XX_GPIO_LEVELDETECT1);
-			__raw_writel(old0, bank->base + OMAP24XX_GPIO_LEVELDETECT0);
-			__raw_writel(old1, bank->base + OMAP24XX_GPIO_LEVELDETECT1);
-#endif
-#ifdef CONFIG_ARCH_OMAP4
-			old0 = __raw_readl(bank->base +
+			__raw_writel(old0, bank->base +
+					OMAP24XX_GPIO_LEVELDETECT0);
+			__raw_writel(old1, bank->base +
+					OMAP24XX_GPIO_LEVELDETECT1);
+			}
+
+			if (cpu_is_omap44xx()) {
+				old0 = __raw_readl(bank->base +
 						OMAP4_GPIO_LEVELDETECT0);
-			old1 = __raw_readl(bank->base +
+				old1 = __raw_readl(bank->base +
 						OMAP4_GPIO_LEVELDETECT1);
-			__raw_writel(old0 | l, bank->base +
+				__raw_writel(old0 | l, bank->base +
 						OMAP4_GPIO_LEVELDETECT0);
-			__raw_writel(old1 | l, bank->base +
+				__raw_writel(old1 | l, bank->base +
 						OMAP4_GPIO_LEVELDETECT1);
-			__raw_writel(old0, bank->base +
+				__raw_writel(old0, bank->base +
 						OMAP4_GPIO_LEVELDETECT0);
-			__raw_writel(old1, bank->base +
+				__raw_writel(old1, bank->base +
 						OMAP4_GPIO_LEVELDETECT1);
-#endif
+			}
 		}
 	}
 
author maintainer
#9 lore raw

PATCH 8/9 omap2/3/4: Fix mach-omap2/serial.c for multiboot

In reply to Tony Lindgren

Initialize UART4 only for 3630 and 44xx.

---
 arch/arm/mach-omap2/serial.c |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/serial.c +20 -7
index 21e51c5..9bbc2c5 100644
@@ -108,7 +108,7 @@ static struct plat_serial8250_port serial_platform_data2[] = {
 	}
 };
 
-#ifdef CONFIG_ARCH_OMAP4
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 static struct plat_serial8250_port serial_platform_data3[] = {
 	{
 		.irq		= 70,
@@ -120,6 +120,15 @@ static struct plat_serial8250_port serial_platform_data3[] = {
 		.flags		= 0
 	}
 };
+
+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)
@@ -127,9 +136,8 @@ 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;
-#ifdef CONFIG_ARCH_OMAP4
-	serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;
-#endif
+	if (cpu_is_omap3630() || cpu_is_omap44xx())
+		omap2_set_globals_uart4(omap2_globals);
 }
 
 static inline unsigned int __serial_read_reg(struct uart_port *up,
@@ -574,7 +582,7 @@ static struct omap_uart_state omap_uart[] = {
 			},
 		},
 	},
-#ifdef CONFIG_ARCH_OMAP4
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 	{
 		.pdev = {
 			.name			= "serial8250",
@@ -722,8 +730,13 @@ void __init omap_serial_init_port(int port)
  */
 void __init omap_serial_init(void)
 {
-	int i;
+	int i, nr_ports;
+
+	if (!(cpu_is_omap3630() || cpu_is_omap4430()))
+		nr_ports = 3;
+	else
+		nr_ports = ARRAY_SIZE(omap_uart);
 
-	for (i = 0; i < ARRAY_SIZE(omap_uart); i++)
+	for (i = 0; i < nr_ports; i++)
 		omap_serial_init_port(i);
 }
author maintainer
#10 lore raw

PATCH 9/9 omap2/3/4: Add omap4 into omap3_defconfnig

In reply to Tony Lindgren

Add omap4 into omap3_defconfig. Note that this does not yet boot on omap4, but boots on omap2 and omap3.

Also note that CONFIG_SMP does not currently work on uniprocessor ARMs.

---
 arch/arm/configs/omap3_defconfig |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
arch/arm/configs/omap3_defconfig +5 -1
index 2bc80d7..714835e 100644
@@ -239,7 +239,7 @@ CONFIG_ARCH_OMAP_OTG=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_ARCH_OMAP2=y
 CONFIG_ARCH_OMAP3=y
-# CONFIG_ARCH_OMAP4 is not set
+CONFIG_ARCH_OMAP4=y
 
 #
 # OMAP Feature Selections
@@ -295,6 +295,7 @@ CONFIG_MACH_OMAP_ZOOM3=y
 CONFIG_MACH_CM_T35=y
 CONFIG_MACH_IGEP0020=y
 CONFIG_MACH_OMAP_3630SDP=y
+CONFIG_MACH_OMAP_4430SDP=y
 # CONFIG_OMAP3_EMU is not set
 # CONFIG_OMAP3_SDRC_AC_TIMING is not set
 
@@ -334,6 +335,7 @@ CONFIG_ARM_L1_CACHE_SHIFT=6
 # CONFIG_ARM_ERRATA_430973 is not set
 # CONFIG_ARM_ERRATA_458693 is not set
 # CONFIG_ARM_ERRATA_460075 is not set
+CONFIG_ARM_GIC=y
 CONFIG_COMMON_CLKDEV=y
 
 #
@@ -350,6 +352,7 @@ CONFIG_TICK_ONESHOT=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_SMP is not set
 CONFIG_VMSPLIT_3G=y
 # CONFIG_VMSPLIT_2G is not set
 # CONFIG_VMSPLIT_1G is not set
@@ -361,6 +364,7 @@ CONFIG_HZ=128
 # CONFIG_THUMB2_KERNEL is not set
 CONFIG_AEABI=y
 CONFIG_OABI_COMPAT=y
+CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
 # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
 # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
 # CONFIG_HIGHMEM is not set
#11 lore raw

cover Initial multi-omap support for omap4

In reply to Tony Lindgren

Tony,

Quoted 10 lines

-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Tony Lindgren
Sent: Saturday, January 30, 2010 7:31 AM
To: linux-arm-kernel at lists.infradead.org
Cc: linux-omap at vger.kernel.org
Subject: [PATCH 0/9] Initial multi-omap support for omap4

Hi all,

Quoted 7 lines

These patches allow compiling in also omap4 into the multi-omap configuration. As I don't yet have omap4, I've only boot tested these on omap2 and omap3.

Somebody with an omap4 board please boot test these with the omap3_defconfig and see what happens.. You might want to enable DEBUG_LL and EARLY_PRINTK with earlyprintk on the cmdline too.

Looks like this series have some dependent series because it doesn't apply on mainline.

So I tested this directly on linux-omap "multi-omap4" branch. It boots sufficiently but doesn't proceed after "brd_init". Didn't get much time to debug so attached log

Regards,
Santosh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omap3_defconfig.log
Type: application/octet-stream
Size: 10866 bytes
Desc: omap3_defconfig.log
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100130/4a7373c7/attachment-0001.obj>

author maintainer
#12 lore raw

cover Initial multi-omap support for omap4

Quoted 15 lines · Shilimkar, Santosh

Tony,

Quoted 14 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tony Lindgren
Sent: Saturday, January 30, 2010 7:31 AM
To: [email protected]
Cc: [email protected]
Subject: [PATCH 0/9] Initial multi-omap support for omap4

Hi all,

These patches allow compiling in also omap4 into the multi-omap configuration. As I don't yet have omap4, I've only boot tested these on omap2 and omap3.

Quoted 5 lines
Quoted 3 lines

Somebody with an omap4 board please boot test these with the omap3_defconfig and see what happens.. You might want to enable DEBUG_LL and EARLY_PRINTK with earlyprintk on the cmdline too.

Looks like this series have some dependent series because it doesn't apply on mainline.

Sorry, forgot to mention that these are against the earlier multi-omap patches. Basically stuff that's now queued for the merge window in the omap-for-linus branch.

Quoted 2 lines

So I tested this directly on linux-omap "multi-omap4" branch. It boots sufficiently but doesn't proceed after "brd_init". Didn't get much time to debug so attached log

Thanks for testing. Yeah these same are in the multi-omap4 branch also.

Regards,

Tony

#13 lore raw

cover Initial multi-omap support for omap4

In reply to Tony Lindgren
Quoted 6 lines
Quoted 6 lines

Hi all,

These patches allow compiling in also omap4 into the multi-omap configuration. As I don't yet have omap4, I've only boot tested these on omap2 and omap3.

Quoted 8 lines
Quoted 3 lines

Somebody with an omap4 board please boot test these with the omap3_defconfig and see what happens.. You might want to enable DEBUG_LL and EARLY_PRINTK with earlyprintk on the cmdline too.

Looks like this series have some dependent series because it doesn't apply on mainline.

So I tested this directly on linux-omap "multi-omap4" branch. It boots sufficiently but doesn't proceed after "brd_init". Didn't get much time to debug so attached log

Stand alone omap_4430sdp_defconfig also didn't fully boot on the linux-omap "multi-omap4". The log below shows that the serial platform data isn't configured correctly.

<6>io scheduler deadline registered
<6>io scheduler cfq registered (default)
<6>Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled <6>serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 104) is a ST16654 <6>serial8250.1: ttyS0 at MMIO 0x4806a000 (irq = 105) is a ST16654

Below patch to fix the boot for omap_4430sdp_defconfig. Small typo really.

arch/arm/plat-omap/include/plat/serial.h +1 -1
index 67ffa08..83dce4c 100644
@@ -33,7 +33,7 @@
 
 /* OMAP4 serial ports */
 #define OMAP4_UART1_BASE       OMAP2_UART1_BASE
-#define OMAP4_UART2_BASE       OMAP2_UART1_BASE
+#define OMAP4_UART2_BASE       OMAP2_UART2_BASE
 #define OMAP4_UART3_BASE       0x48020000
 #define OMAP4_UART4_BASE       0x4806e000
 

For multi-omap build, for now I need to disable
[*] Reset unused clocks during boot

With this OMAP4430 boots with omap3_defconfig :)

Regards,
Santosh

author maintainer
#14 lore raw

cover Initial multi-omap support for omap4

Quoted 31 lines · Shilimkar, Santosh
Quoted 6 lines
Quoted 6 lines

Hi all,

These patches allow compiling in also omap4 into the multi-omap configuration. As I don't yet have omap4, I've only boot tested these on omap2 and omap3.

Quoted 8 lines
Quoted 3 lines

Somebody with an omap4 board please boot test these with the omap3_defconfig and see what happens.. You might want to enable DEBUG_LL and EARLY_PRINTK with earlyprintk on the cmdline too.

Looks like this series have some dependent series because it doesn't apply on mainline.

So I tested this directly on linux-omap "multi-omap4" branch. It boots sufficiently but doesn't proceed after "brd_init". Didn't get much time to debug so attached log

Stand alone omap_4430sdp_defconfig also didn't fully boot on the linux-omap "multi-omap4". The log below shows that the serial platform data isn't configured correctly.

<6>io scheduler deadline registered
<6>io scheduler cfq registered (default)
<6>Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled <6>serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 104) is a ST16654 <6>serial8250.1: ttyS0 at MMIO 0x4806a000 (irq = 105) is a ST16654

Below patch to fix the boot for omap_4430sdp_defconfig. Small typo really.

arch/arm/plat-omap/include/plat/serial.h +0 -0
index 67ffa08..83dce4c 100644

arch/arm/plat-omap/include/plat/serial.h line 38

Quoted 7 lines
arch/arm/plat-omap/include/plat/serial.h +1 -1
@@ -33,7 +33,7 @@
 
 /* OMAP4 serial ports */
 #define OMAP4_UART1_BASE       OMAP2_UART1_BASE
-#define OMAP4_UART2_BASE       OMAP2_UART1_BASE
+#define OMAP4_UART2_BASE       OMAP2_UART2_BASE
 #define OMAP4_UART3_BASE       0x48020000
 #define OMAP4_UART4_BASE       0x4806e000

Heh OK :) Sounds like at this point it makes sense to merge that into the original patch redo omap-for-linus partially.

Can I also add your Acked-by for these patches then?

Quoted 2 lines

For multi-omap build, for now I need to disable
[*] Reset unused clocks during boot

Sounds like omap4 has some clocks left on from the bootloader that it should clk_get and clk_enable during init. That should be easy to track if you boot with "debug" in your cmdline and take a look at the list of unused clocks that are shut down with late_initcall.

Quoted 1 line

With this OMAP4430 boots with omap3_defconfig :)

Cool, thanks, good to hear!

Now the only omap2/3/4 that's not booting with omap3_defconfig is 2430 because of the different clock offsets compare dot 2420. That should get fixed eventually though.

Regards,

Tony

#15 lore raw

cover Initial multi-omap support for omap4

Quoted 50 lines

-----Original Message-----
From: Tony Lindgren [mailto:tony at atomide.com]
Sent: Saturday, January 30, 2010 9:55 PM
To: Shilimkar, Santosh
Cc: linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
Subject: Re: [PATCH 0/9] Initial multi-omap support for omap4

Quoted 31 lines · Shilimkar, Santosh
Quoted 6 lines
Quoted 6 lines

Hi all,

These patches allow compiling in also omap4 into the multi-omap configuration. As I don't yet have omap4, I've only boot tested these on omap2 and omap3.

Quoted 8 lines
Quoted 3 lines

Somebody with an omap4 board please boot test these with the omap3_defconfig and see what happens.. You might want to enable DEBUG_LL and EARLY_PRINTK with earlyprintk on the cmdline too.

Looks like this series have some dependent series because it doesn't apply on mainline.

So I tested this directly on linux-omap "multi-omap4" branch. It boots sufficiently but doesn't proceed after "brd_init". Didn't get much time to debug so attached log

Stand alone omap_4430sdp_defconfig also didn't fully boot on the linux-omap "multi-omap4". The log below shows that the serial platform data isn't configured correctly.

<6>io scheduler deadline registered
<6>io scheduler cfq registered (default)
<6>Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled <6>serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 104) is a ST16654 <6>serial8250.1: ttyS0 at MMIO 0x4806a000 (irq = 105) is a ST16654

Below patch to fix the boot for omap_4430sdp_defconfig. Small typo really.

arch/arm/plat-omap/include/plat/serial.h +0 -0
index 67ffa08..83dce4c 100644

arch/arm/plat-omap/include/plat/serial.h line 38

Quoted 7 lines
arch/arm/plat-omap/include/plat/serial.h +1 -1
@@ -33,7 +33,7 @@
 
 /* OMAP4 serial ports */
 #define OMAP4_UART1_BASE       OMAP2_UART1_BASE
-#define OMAP4_UART2_BASE       OMAP2_UART1_BASE
+#define OMAP4_UART2_BASE       OMAP2_UART2_BASE
 #define OMAP4_UART3_BASE       0x48020000
 #define OMAP4_UART4_BASE       0x4806e000

Heh OK :) Sounds like at this point it makes sense to merge that into the original patch redo omap-for-linus partially.

Quoted 1 line

Can I also add your Acked-by for these patches then?

Yes please.

Quoted 8 lines
Quoted 2 lines

For multi-omap build, for now I need to disable
[*] Reset unused clocks during boot

Sounds like omap4 has some clocks left on from the bootloader that it should clk_get and clk_enable during init. That should be easy to track if you boot with "debug" in your cmdline and take a look at the list of unused clocks that are shut down with late_initcall.

I know it hangs when it tries to cut down UART3 ( console) clock. The clock support got just recently merged and drivers are not yet migrated so, need to still depend on bootloader. The work is ongoing and soon the patches will be pushed. Few drivers are planned to be handled in hwmod way so we were holding these patches.

Quoted 11 lines
Quoted 1 line

With this OMAP4430 boots with omap3_defconfig :)

Cool, thanks, good to hear!

Now the only omap2/3/4 that's not booting with omap3_defconfig is 2430 because of the different clock offsets compare dot 2420. That should get fixed eventually though.

Regards,

Tony

author maintainer
#16 lore raw

cover Initial multi-omap support for omap4

Quoted 40 lines · Shilimkar, Santosh
Quoted 40 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Saturday, January 30, 2010 9:55 PM
To: Shilimkar, Santosh
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 0/9] Initial multi-omap support for omap4

Quoted 32 lines · Shilimkar, Santosh
Quoted 6 lines
Quoted 6 lines

Hi all,

These patches allow compiling in also omap4 into the multi-omap configuration. As I don't yet have omap4, I've only boot tested these on omap2 and omap3.

Quoted 8 lines
Quoted 3 lines

Somebody with an omap4 board please boot test these with the omap3_defconfig and see what happens.. You might want to enable DEBUG_LL and EARLY_PRINTK with earlyprintk on the cmdline too.

Looks like this series have some dependent series because it doesn't apply on mainline.

So I tested this directly on linux-omap "multi-omap4" branch. It boots sufficiently but doesn't proceed after "brd_init". Didn't get much time to debug so attached log

Stand alone omap_4430sdp_defconfig also didn't fully boot on the linux-omap "multi-omap4". The log below shows that the serial platform data isn't configured correctly.

<6>io scheduler deadline registered
<6>io scheduler cfq registered (default)
<6>Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled <6>serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 104) is a ST16654 <6>serial8250.1: ttyS0 at MMIO 0x4806a000 (irq = 105) is a ST16654

Below patch to fix the boot for omap_4430sdp_defconfig. Small typo really.

arch/arm/plat-omap/include/plat/serial.h +0 -0
index 67ffa08..83dce4c 100644
@@ -33,7 +33,7 @@
 
Quoted 6 lines
Quoted 6 lines

arch/arm/plat-omap/include/plat/serial.h line 38

Quoted 6 lines
arch/arm/plat-omap/include/plat/serial.h +1 -1
 /* OMAP4 serial ports */
 #define OMAP4_UART1_BASE       OMAP2_UART1_BASE
-#define OMAP4_UART2_BASE       OMAP2_UART1_BASE
+#define OMAP4_UART2_BASE       OMAP2_UART2_BASE
 #define OMAP4_UART3_BASE       0x48020000
 #define OMAP4_UART4_BASE       0x4806e000

I've refreshed the second patch in the earlier multi-omap series with your fix above.

Quoted 5 lines
Quoted 4 lines

Heh OK :) Sounds like at this point it makes sense to merge that into the original patch redo omap-for-linus partially.

Can I also add your Acked-by for these patches then?

Yes please.

OK, added your Acked-by to all the omap4 patches. Also fixed three checkpatch.pl warnings about long lines for the gpio patch.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

For multi-omap build, for now I need to disable
[*] Reset unused clocks during boot

Sounds like omap4 has some clocks left on from the bootloader that it should clk_get and clk_enable during init. That should be easy to track if you boot with "debug" in your cmdline and take a look at the list of unused clocks that are shut down with late_initcall.

Quoted 6 lines

I know it hangs when it tries to cut down UART3 ( console) clock. The clock support got just recently merged and drivers are not yet migrated so, need to still depend on bootloader. The work is ongoing and soon the patches will be pushed. Few drivers are planned to be handled in hwmod way so we were holding these patches.

OK

Tony