All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] omap multiboot improvments for merge window after 2.6.34
@ 2010-01-16  1:35 ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

Hi all,

Here are some multiboot improvments for review. These patches
are intended for the 2.6.34 merge window.

Comments and testing would be nice, I've tested them so far
on osk, 770, n800, rx51 and overo.

Regards,

Tony

---

Tony Lindgren (4):
      omap: Clean the serial port defines
      omap: Make uncompress code and DEBUG_LL code generic
      omap: Remove old DEBUG_LL serial port options
      omap: Make get_irqnr_and_base common for mach-omap2 multiboot


 arch/arm/mach-omap1/include/mach/debug-macro.S |   83 ++++++++++--
 arch/arm/mach-omap1/serial.c                   |   18 ++-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   91 +++++++++----
 arch/arm/mach-omap2/include/mach/entry-macro.S |   55 +++++---
 arch/arm/mach-omap2/serial.c                   |   26 +++-
 arch/arm/plat-omap/Kconfig                     |   19 ---
 arch/arm/plat-omap/common.c                    |   18 +++
 arch/arm/plat-omap/include/plat/common.h       |    5 +
 arch/arm/plat-omap/include/plat/serial.h       |   62 ++++++---
 arch/arm/plat-omap/include/plat/uncompress.h   |  168 +++++++++++++++++-------
 10 files changed, 390 insertions(+), 155 deletions(-)

-- 
Signature

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 0/4] omap multiboot improvments for merge window after 2.6.34
@ 2010-01-16  1:35 ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

Here are some multiboot improvments for review. These patches
are intended for the 2.6.34 merge window.

Comments and testing would be nice, I've tested them so far
on osk, 770, n800, rx51 and overo.

Regards,

Tony

---

Tony Lindgren (4):
      omap: Clean the serial port defines
      omap: Make uncompress code and DEBUG_LL code generic
      omap: Remove old DEBUG_LL serial port options
      omap: Make get_irqnr_and_base common for mach-omap2 multiboot


 arch/arm/mach-omap1/include/mach/debug-macro.S |   83 ++++++++++--
 arch/arm/mach-omap1/serial.c                   |   18 ++-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   91 +++++++++----
 arch/arm/mach-omap2/include/mach/entry-macro.S |   55 +++++---
 arch/arm/mach-omap2/serial.c                   |   26 +++-
 arch/arm/plat-omap/Kconfig                     |   19 ---
 arch/arm/plat-omap/common.c                    |   18 +++
 arch/arm/plat-omap/include/plat/common.h       |    5 +
 arch/arm/plat-omap/include/plat/serial.h       |   62 ++++++---
 arch/arm/plat-omap/include/plat/uncompress.h   |  168 +++++++++++++++++-------
 10 files changed, 390 insertions(+), 155 deletions(-)

-- 
Signature

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 1/4] omap: Clean the serial port defines
  2010-01-16  1:35 ` Tony Lindgren
@ 2010-01-16  1:35   ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

This way we don't have conflicts with the defines
with compiling in multiple omaps. Set the addresses
for uarts in struct omap_globals for the early serial
init code.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   16 +++++----
 arch/arm/mach-omap1/serial.c                   |    6 ++-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   15 ++++----
 arch/arm/mach-omap2/serial.c                   |   15 ++++++--
 arch/arm/plat-omap/common.c                    |   18 ++++++++++
 arch/arm/plat-omap/include/plat/common.h       |    5 +++
 arch/arm/plat-omap/include/plat/serial.h       |   44 +++++++++++++-----------
 7 files changed, 77 insertions(+), 42 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index aedb746..23e4724 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -11,6 +11,10 @@
  *
 */
 
+#include <linux/serial_reg.h>
+
+#include <plat/serial.h>
+
 		.macro	addruart,rx
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
@@ -30,13 +34,13 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		beq	1002f
-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
+		ldrb	\rd, [\rx, #(UART_LSR << OMAP7XX_PORT_SHIFT)]
+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		bne	1001b
 1002:
 		.endm
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 6e5207c..349de90 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -64,7 +64,7 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
 
 static struct plat_serial8250_port serial_platform_data[] = {
 	{
-		.mapbase	= OMAP_UART1_BASE,
+		.mapbase	= OMAP1_UART1_BASE,
 		.irq		= INT_UART1,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -72,7 +72,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.uartclk	= OMAP16XX_BASE_BAUD * 16,
 	},
 	{
-		.mapbase	= OMAP_UART2_BASE,
+		.mapbase	= OMAP1_UART2_BASE,
 		.irq		= INT_UART2,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -80,7 +80,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.uartclk	= OMAP16XX_BASE_BAUD * 16,
 	},
 	{
-		.mapbase	= OMAP_UART3_BASE,
+		.mapbase	= OMAP1_UART3_BASE,
 		.irq		= INT_UART3,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index e9f255d..0c96e1c 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -11,6 +11,10 @@
  *
 */
 
+#include <linux/serial_reg.h>
+
+#include <plat/serial.h>
+
 		.macro	addruart,rx
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
@@ -44,15 +48,10 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
-		beq	1002f
-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		bne	1001b
-1002:
 		.endm
 
 		.macro	waituart,rd,rx
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 837b347..21e51c5 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -74,7 +74,6 @@ static LIST_HEAD(uart_list);
 
 static struct plat_serial8250_port serial_platform_data0[] = {
 	{
-		.mapbase	= OMAP_UART1_BASE,
 		.irq		= 72,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -87,7 +86,6 @@ static struct plat_serial8250_port serial_platform_data0[] = {
 
 static struct plat_serial8250_port serial_platform_data1[] = {
 	{
-		.mapbase	= OMAP_UART2_BASE,
 		.irq		= 73,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -100,7 +98,6 @@ static struct plat_serial8250_port serial_platform_data1[] = {
 
 static struct plat_serial8250_port serial_platform_data2[] = {
 	{
-		.mapbase	= OMAP_UART3_BASE,
 		.irq		= 74,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -114,7 +111,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
 #ifdef CONFIG_ARCH_OMAP4
 static struct plat_serial8250_port serial_platform_data3[] = {
 	{
-		.mapbase	= OMAP_UART4_BASE,
 		.irq		= 70,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -125,6 +121,17 @@ static struct plat_serial8250_port serial_platform_data3[] = {
 	}
 };
 #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;
+#ifdef CONFIG_ARCH_OMAP4
+	serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;
+#endif
+}
+
 static inline unsigned int __serial_read_reg(struct uart_port *up,
 					   int offset)
 {
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index bf1eaf3..1c72b65 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -34,6 +34,7 @@
 #include <plat/control.h>
 #include <plat/mux.h>
 #include <plat/fpga.h>
+#include <plat/serial.h>
 
 #include <plat/clock.h>
 
@@ -233,11 +234,15 @@ static struct omap_globals omap242x_globals = {
 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP2420_CTRL_BASE),
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),
+	.uart1_phys	= OMAP2_UART1_BASE,
+	.uart2_phys	= OMAP2_UART2_BASE,
+	.uart3_phys	= OMAP2_UART3_BASE,
 };
 
 void __init omap2_set_globals_242x(void)
 {
 	__omap2_set_globals(&omap242x_globals);
+	omap2_set_globals_uart(&omap242x_globals);
 }
 #endif
 
@@ -251,11 +256,15 @@ static struct omap_globals omap243x_globals = {
 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),
+	.uart1_phys	= OMAP2_UART1_BASE,
+	.uart2_phys	= OMAP2_UART2_BASE,
+	.uart3_phys	= OMAP2_UART3_BASE,
 };
 
 void __init omap2_set_globals_243x(void)
 {
 	__omap2_set_globals(&omap243x_globals);
+	omap2_set_globals_uart(&omap243x_globals);
 }
 #endif
 
@@ -269,11 +278,15 @@ static struct omap_globals omap343x_globals = {
 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
+	.uart1_phys	= OMAP3_UART1_BASE,
+	.uart2_phys	= OMAP3_UART2_BASE,
+	.uart3_phys	= OMAP3_UART3_BASE,
 };
 
 void __init omap2_set_globals_343x(void)
 {
 	__omap2_set_globals(&omap343x_globals);
+	omap2_set_globals_uart(&omap343x_globals);
 }
 #endif
 
@@ -285,6 +298,10 @@ static struct omap_globals omap4_globals = {
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
 	.cm2	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
+	.uart1_phys	= OMAP4_UART1_BASE,
+	.uart2_phys	= OMAP4_UART2_BASE,
+	.uart3_phys	= OMAP4_UART3_BASE,
+	.uart4_phys	= OMAP4_UART4_BASE,
 };
 
 void __init omap2_set_globals_443x(void)
@@ -292,6 +309,7 @@ void __init omap2_set_globals_443x(void)
 	omap2_set_globals_tap(&omap4_globals);
 	omap2_set_globals_control(&omap4_globals);
 	omap2_set_globals_prcm(&omap4_globals);
+	omap2_set_globals_uart(&omap4_globals);
 }
 #endif
 
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 32c2227..a8fa0d7 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -47,6 +47,10 @@ struct omap_globals {
 	void __iomem	*prm;		/* Power and Reset Management */
 	void __iomem	*cm;		/* Clock Management */
 	void __iomem	*cm2;
+	unsigned long	uart1_phys;
+	unsigned long	uart2_phys;
+	unsigned long	uart3_phys;
+	unsigned long	uart4_phys;
 };
 
 void omap2_set_globals_242x(void);
@@ -59,6 +63,7 @@ void omap2_set_globals_tap(struct omap_globals *);
 void omap2_set_globals_sdrc(struct omap_globals *);
 void omap2_set_globals_control(struct omap_globals *);
 void omap2_set_globals_prcm(struct omap_globals *);
+void omap2_set_globals_uart(struct omap_globals *);
 
 /**
  * omap_test_timeout - busy-loop, testing a condition
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index f5a4a92..c7e2b85 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -15,37 +15,39 @@
 
 #include <linux/init.h>
 
-#if defined(CONFIG_ARCH_OMAP1)
 /* OMAP1 serial ports */
-#define OMAP_UART1_BASE		0xfffb0000
-#define OMAP_UART2_BASE		0xfffb0800
-#define OMAP_UART3_BASE		0xfffb9800
-#elif defined(CONFIG_ARCH_OMAP2)
+#define OMAP1_UART1_BASE	0xfffb0000
+#define OMAP1_UART2_BASE	0xfffb0800
+#define OMAP1_UART3_BASE	0xfffb9800
+
 /* OMAP2 serial ports */
-#define OMAP_UART1_BASE		0x4806a000
-#define OMAP_UART2_BASE		0x4806c000
-#define OMAP_UART3_BASE		0x4806e000
-#elif defined(CONFIG_ARCH_OMAP3)
+#define OMAP2_UART1_BASE	0x4806a000
+#define OMAP2_UART2_BASE	0x4806c000
+#define OMAP2_UART3_BASE	0x4806e000
+
 /* OMAP3 serial ports */
-#define OMAP_UART1_BASE		0x4806a000
-#define OMAP_UART2_BASE		0x4806c000
-#define OMAP_UART3_BASE		0x49020000
-#elif defined(CONFIG_ARCH_OMAP4)
+#define OMAP3_UART1_BASE	0x4806a000
+#define OMAP3_UART2_BASE	0x4806c000
+#define OMAP3_UART3_BASE	0x49020000
+
 /* OMAP4 serial ports */
-#define OMAP_UART1_BASE		0x4806a000
-#define OMAP_UART2_BASE		0x4806c000
-#define OMAP_UART3_BASE		0x48020000
-#define OMAP_UART4_BASE		0x4806e000
-#endif
+#define OMAP4_UART1_BASE	0x4806a000
+#define OMAP4_UART2_BASE	0x4806c000
+#define OMAP4_UART3_BASE	0x48020000
+#define OMAP4_UART4_BASE	0x4806e000
+
+#define OMAP_PORT_SHIFT		2
+#define OMAP7XX_PORT_SHIFT	0
 
 #define OMAP1510_BASE_BAUD	(12000000/16)
 #define OMAP16XX_BASE_BAUD	(48000000/16)
 #define OMAP24XX_BASE_BAUD	(48000000/16)
 
+/* This is only used by 8250.c for omap1510 */
 #define is_omap_port(pt)	({int __ret = 0;			\
-			if ((pt)->port.mapbase == OMAP_UART1_BASE ||	\
-			    (pt)->port.mapbase == OMAP_UART2_BASE ||	\
-			    (pt)->port.mapbase == OMAP_UART3_BASE)	\
+			if ((pt)->port.mapbase == OMAP1_UART1_BASE ||	\
+			    (pt)->port.mapbase == OMAP1_UART2_BASE ||	\
+			    (pt)->port.mapbase == OMAP1_UART3_BASE)	\
 				__ret = 1;				\
 			__ret;						\
 			})


^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 1/4] omap: Clean the serial port defines
@ 2010-01-16  1:35   ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel

This way we don't have conflicts with the defines
with compiling in multiple omaps. Set the addresses
for uarts in struct omap_globals for the early serial
init code.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   16 +++++----
 arch/arm/mach-omap1/serial.c                   |    6 ++-
 arch/arm/mach-omap2/include/mach/debug-macro.S |   15 ++++----
 arch/arm/mach-omap2/serial.c                   |   15 ++++++--
 arch/arm/plat-omap/common.c                    |   18 ++++++++++
 arch/arm/plat-omap/include/plat/common.h       |    5 +++
 arch/arm/plat-omap/include/plat/serial.h       |   44 +++++++++++++-----------
 7 files changed, 77 insertions(+), 42 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index aedb746..23e4724 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -11,6 +11,10 @@
  *
 */
 
+#include <linux/serial_reg.h>
+
+#include <plat/serial.h>
+
 		.macro	addruart,rx
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
@@ -30,13 +34,13 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		beq	1002f
-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
+		ldrb	\rd, [\rx, #(UART_LSR << OMAP7XX_PORT_SHIFT)]
+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		bne	1001b
 1002:
 		.endm
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 6e5207c..349de90 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -64,7 +64,7 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
 
 static struct plat_serial8250_port serial_platform_data[] = {
 	{
-		.mapbase	= OMAP_UART1_BASE,
+		.mapbase	= OMAP1_UART1_BASE,
 		.irq		= INT_UART1,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -72,7 +72,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.uartclk	= OMAP16XX_BASE_BAUD * 16,
 	},
 	{
-		.mapbase	= OMAP_UART2_BASE,
+		.mapbase	= OMAP1_UART2_BASE,
 		.irq		= INT_UART2,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -80,7 +80,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.uartclk	= OMAP16XX_BASE_BAUD * 16,
 	},
 	{
-		.mapbase	= OMAP_UART3_BASE,
+		.mapbase	= OMAP1_UART3_BASE,
 		.irq		= INT_UART3,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index e9f255d..0c96e1c 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -11,6 +11,10 @@
  *
 */
 
+#include <linux/serial_reg.h>
+
+#include <plat/serial.h>
+
 		.macro	addruart,rx
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
@@ -44,15 +48,10 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
-		beq	1002f
-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		bne	1001b
-1002:
 		.endm
 
 		.macro	waituart,rd,rx
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 837b347..21e51c5 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -74,7 +74,6 @@ static LIST_HEAD(uart_list);
 
 static struct plat_serial8250_port serial_platform_data0[] = {
 	{
-		.mapbase	= OMAP_UART1_BASE,
 		.irq		= 72,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -87,7 +86,6 @@ static struct plat_serial8250_port serial_platform_data0[] = {
 
 static struct plat_serial8250_port serial_platform_data1[] = {
 	{
-		.mapbase	= OMAP_UART2_BASE,
 		.irq		= 73,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -100,7 +98,6 @@ static struct plat_serial8250_port serial_platform_data1[] = {
 
 static struct plat_serial8250_port serial_platform_data2[] = {
 	{
-		.mapbase	= OMAP_UART3_BASE,
 		.irq		= 74,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -114,7 +111,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
 #ifdef CONFIG_ARCH_OMAP4
 static struct plat_serial8250_port serial_platform_data3[] = {
 	{
-		.mapbase	= OMAP_UART4_BASE,
 		.irq		= 70,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -125,6 +121,17 @@ static struct plat_serial8250_port serial_platform_data3[] = {
 	}
 };
 #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;
+#ifdef CONFIG_ARCH_OMAP4
+	serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;
+#endif
+}
+
 static inline unsigned int __serial_read_reg(struct uart_port *up,
 					   int offset)
 {
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index bf1eaf3..1c72b65 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -34,6 +34,7 @@
 #include <plat/control.h>
 #include <plat/mux.h>
 #include <plat/fpga.h>
+#include <plat/serial.h>
 
 #include <plat/clock.h>
 
@@ -233,11 +234,15 @@ static struct omap_globals omap242x_globals = {
 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP2420_CTRL_BASE),
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),
+	.uart1_phys	= OMAP2_UART1_BASE,
+	.uart2_phys	= OMAP2_UART2_BASE,
+	.uart3_phys	= OMAP2_UART3_BASE,
 };
 
 void __init omap2_set_globals_242x(void)
 {
 	__omap2_set_globals(&omap242x_globals);
+	omap2_set_globals_uart(&omap242x_globals);
 }
 #endif
 
@@ -251,11 +256,15 @@ static struct omap_globals omap243x_globals = {
 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),
+	.uart1_phys	= OMAP2_UART1_BASE,
+	.uart2_phys	= OMAP2_UART2_BASE,
+	.uart3_phys	= OMAP2_UART3_BASE,
 };
 
 void __init omap2_set_globals_243x(void)
 {
 	__omap2_set_globals(&omap243x_globals);
+	omap2_set_globals_uart(&omap243x_globals);
 }
 #endif
 
@@ -269,11 +278,15 @@ static struct omap_globals omap343x_globals = {
 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
+	.uart1_phys	= OMAP3_UART1_BASE,
+	.uart2_phys	= OMAP3_UART2_BASE,
+	.uart3_phys	= OMAP3_UART3_BASE,
 };
 
 void __init omap2_set_globals_343x(void)
 {
 	__omap2_set_globals(&omap343x_globals);
+	omap2_set_globals_uart(&omap343x_globals);
 }
 #endif
 
@@ -285,6 +298,10 @@ static struct omap_globals omap4_globals = {
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
 	.cm2	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
+	.uart1_phys	= OMAP4_UART1_BASE,
+	.uart2_phys	= OMAP4_UART2_BASE,
+	.uart3_phys	= OMAP4_UART3_BASE,
+	.uart4_phys	= OMAP4_UART4_BASE,
 };
 
 void __init omap2_set_globals_443x(void)
@@ -292,6 +309,7 @@ void __init omap2_set_globals_443x(void)
 	omap2_set_globals_tap(&omap4_globals);
 	omap2_set_globals_control(&omap4_globals);
 	omap2_set_globals_prcm(&omap4_globals);
+	omap2_set_globals_uart(&omap4_globals);
 }
 #endif
 
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 32c2227..a8fa0d7 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -47,6 +47,10 @@ struct omap_globals {
 	void __iomem	*prm;		/* Power and Reset Management */
 	void __iomem	*cm;		/* Clock Management */
 	void __iomem	*cm2;
+	unsigned long	uart1_phys;
+	unsigned long	uart2_phys;
+	unsigned long	uart3_phys;
+	unsigned long	uart4_phys;
 };
 
 void omap2_set_globals_242x(void);
@@ -59,6 +63,7 @@ void omap2_set_globals_tap(struct omap_globals *);
 void omap2_set_globals_sdrc(struct omap_globals *);
 void omap2_set_globals_control(struct omap_globals *);
 void omap2_set_globals_prcm(struct omap_globals *);
+void omap2_set_globals_uart(struct omap_globals *);
 
 /**
  * omap_test_timeout - busy-loop, testing a condition
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index f5a4a92..c7e2b85 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -15,37 +15,39 @@
 
 #include <linux/init.h>
 
-#if defined(CONFIG_ARCH_OMAP1)
 /* OMAP1 serial ports */
-#define OMAP_UART1_BASE		0xfffb0000
-#define OMAP_UART2_BASE		0xfffb0800
-#define OMAP_UART3_BASE		0xfffb9800
-#elif defined(CONFIG_ARCH_OMAP2)
+#define OMAP1_UART1_BASE	0xfffb0000
+#define OMAP1_UART2_BASE	0xfffb0800
+#define OMAP1_UART3_BASE	0xfffb9800
+
 /* OMAP2 serial ports */
-#define OMAP_UART1_BASE		0x4806a000
-#define OMAP_UART2_BASE		0x4806c000
-#define OMAP_UART3_BASE		0x4806e000
-#elif defined(CONFIG_ARCH_OMAP3)
+#define OMAP2_UART1_BASE	0x4806a000
+#define OMAP2_UART2_BASE	0x4806c000
+#define OMAP2_UART3_BASE	0x4806e000
+
 /* OMAP3 serial ports */
-#define OMAP_UART1_BASE		0x4806a000
-#define OMAP_UART2_BASE		0x4806c000
-#define OMAP_UART3_BASE		0x49020000
-#elif defined(CONFIG_ARCH_OMAP4)
+#define OMAP3_UART1_BASE	0x4806a000
+#define OMAP3_UART2_BASE	0x4806c000
+#define OMAP3_UART3_BASE	0x49020000
+
 /* OMAP4 serial ports */
-#define OMAP_UART1_BASE		0x4806a000
-#define OMAP_UART2_BASE		0x4806c000
-#define OMAP_UART3_BASE		0x48020000
-#define OMAP_UART4_BASE		0x4806e000
-#endif
+#define OMAP4_UART1_BASE	0x4806a000
+#define OMAP4_UART2_BASE	0x4806c000
+#define OMAP4_UART3_BASE	0x48020000
+#define OMAP4_UART4_BASE	0x4806e000
+
+#define OMAP_PORT_SHIFT		2
+#define OMAP7XX_PORT_SHIFT	0
 
 #define OMAP1510_BASE_BAUD	(12000000/16)
 #define OMAP16XX_BASE_BAUD	(48000000/16)
 #define OMAP24XX_BASE_BAUD	(48000000/16)
 
+/* This is only used by 8250.c for omap1510 */
 #define is_omap_port(pt)	({int __ret = 0;			\
-			if ((pt)->port.mapbase == OMAP_UART1_BASE ||	\
-			    (pt)->port.mapbase == OMAP_UART2_BASE ||	\
-			    (pt)->port.mapbase == OMAP_UART3_BASE)	\
+			if ((pt)->port.mapbase == OMAP1_UART1_BASE ||	\
+			    (pt)->port.mapbase == OMAP1_UART2_BASE ||	\
+			    (pt)->port.mapbase == OMAP1_UART3_BASE)	\
 				__ret = 1;				\
 			__ret;						\
 			})

^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16  1:35 ` Tony Lindgren
@ 2010-01-16  1:35   ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

Define arch_decomp_setup() the same way as some other
architectures do. Use arch_id to configure the debug uart
based on the machine_is by storing it into the uart
scratchpad register for DEBUG_LL code to use.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   67 +++++++++-
 arch/arm/mach-omap1/serial.c                   |   12 ++
 arch/arm/mach-omap2/include/mach/debug-macro.S |   76 ++++++++---
 arch/arm/mach-omap2/serial.c                   |   11 ++
 arch/arm/plat-omap/include/plat/serial.h       |   18 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |  168 +++++++++++++++++-------
 6 files changed, 276 insertions(+), 76 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index 23e4724..0174858 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -15,18 +15,71 @@
 
 #include <plat/serial.h>
 
+omap_uart_phys:	.word	0x0
+omap_uart_virt:	.word	0x0
+
+		/*
+		 * Note that this code won't work if the bootloader passes
+		 * a wrong machine ID number in r1. To debug, just hardcode
+		 * the desired UART phys and virt addresses temporarily into
+		 * the omap_uart_phys and omap_uart_virt above.
+		 */
 		.macro	addruart,rx
+
+		/* Use omap_uart_phys/virt if already configured */
+9:		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		ldreq	\rx, omap_uart_phys	@ physical base address
+		ldrne	\rx, omap_uart_virt	@ virtual base
+		cmp	\rx, #0			@ is port configured?
+		bne	99f			@ already configured
+
+		/* Check 7XX UART1 scratchpad register for uart to use */
+		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		moveq	\rx, #0xff000000	@ physical base address
+		movne	\rx, #0xfe000000	@ virtual base
+		orr	\rx, \rx, #0x00fb0000	@ OMAP1UART1
+		ldrb	\rx, [\rx, #(UART_SCR << OMAP7XX_PORT_SHIFT)]
+		cmp	\rx, #0			@ anything in 7XX scratchpad?
+		bne	10f			@ found 7XX uart
+
+		/* Check 15xx/16xx UART1 scratchpad register for uart to use */
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
 		moveq	\rx, #0xff000000	@ physical base address
 		movne	\rx, #0xfe000000	@ virtual base
-		orr	\rx, \rx, #0x00fb0000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		orr	\rx, \rx, #0x00009000	@ UART 3
-#endif
-#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
-		orr	\rx, \rx, #0x00000800	@ UART 2 & 3
-#endif
+		orr	\rx, \rx, #0x00fb0000	@ OMAP1UART1
+		ldrb	\rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)]
+
+		/* Select the UART to use based on the UART1 scratchpad value */
+10:		cmp	\rx, #0			@ no port configured?
+		beq	11f			@ if none, try to use UART1
+		cmp	\rx, #OMAP1UART1
+		beq	11f			@ configure OMAP1UART1
+		cmp	\rx, #OMAP1UART2
+		beq	12f			@ configure OMAP1UART2
+		cmp	\rx, #OMAP1UART3
+		beq	13f			@ configure OMAP2UART3
+
+		/* Configure the UART offset from the phys/virt base */
+11:		mov	\rx, #0x00fb0000	@ OMAP1UART1
+		b	98f
+12:		mov	\rx, #0x00fb0000	@ OMAP1UART1
+		orr	\rx, \rx, #0x00000800	@ OMAP1UART2
+		b	98f
+13:		mov	\rx, #0x00fb0000	@ OMAP1UART1
+		orr	\rx, \rx, #0x00000800	@ OMAP1UART2
+		orr	\rx, \rx, #0x00009000	@ OMAP1UART3
+
+		/* Store both phys and virt address for the uart */
+98:		add	\rx, \rx, #0xff000000	@ phys base
+		str	\rx, omap_uart_phys
+		sub	\rx, \rx, #0xff000000	@ phys base
+		add	\rx, \rx, #0xfe000000	@ virt base
+		str	\rx, omap_uart_virt
+		b	9b
+99:
 		.endm
 
 		.macro	senduart,rd,rx
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 349de90..c36de59 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -52,6 +52,15 @@ static inline void omap_serial_outp(struct plat_serial8250_port *p, int offset,
  */
 static void __init omap_serial_reset(struct plat_serial8250_port *p)
 {
+	u8 scratchpad = 0;
+
+	/*
+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
+	 */
+	if (p->mapbase == OMAP1_UART1_BASE)
+		scratchpad = omap_serial_in(p, UART_SCR);
+
 	omap_serial_outp(p, UART_OMAP_MDR1, 0x07);	/* disable UART */
 	omap_serial_outp(p, UART_OMAP_SCR, 0x08);	/* TX watermark */
 	omap_serial_outp(p, UART_OMAP_MDR1, 0x00);	/* enable UART */
@@ -60,6 +69,9 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
 		omap_serial_outp(p, UART_OMAP_SYSC, 0x01);
 		while (!(omap_serial_in(p, UART_OMAP_SYSC) & 0x01));
 	}
+
+	if (p->mapbase == OMAP1_UART1_BASE)
+		omap_serial_outp(p, UART_SCR, scratchpad);
 }
 
 static struct plat_serial8250_port serial_platform_data[] = {
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 0c96e1c..1b83584 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -15,32 +15,66 @@
 
 #include <plat/serial.h>
 
+omap_uart_phys:	.word	0x0
+omap_uart_virt:	.word	0x0
+
+		/*
+		 * Note that this code won't work if the bootloader passes
+		 * a wrong machine ID number in r1. To debug, just hardcode
+		 * the desired UART phys and virt addresses temporarily into
+		 * the omap_uart_phys and omap_uart_virt above.
+		 */
 		.macro	addruart,rx
+
+		/* Use omap_uart_phys/virt if already configured */
+10:		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		ldreq	\rx, omap_uart_phys	@ physical base address
+		ldrne	\rx, omap_uart_virt	@ virtual base
+		cmp	\rx, #0			@ is port configured?
+		bne	99f			@ already configured
+
+		/* Check UART1 scratchpad register for uart to use */
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
-#ifdef  CONFIG_ARCH_OMAP2
 		moveq	\rx, #0x48000000	@ physical base address
 		movne	\rx, #0xfa000000	@ virtual base
-		orr	\rx, \rx, #0x0006a000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
-		add	\rx, \rx, #0x00002000	@ UART 2
-#endif
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		add	\rx, \rx, #0x00004000	@ UART 3
-#endif
-
-#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
-		moveq	\rx, #0x48000000	@ physical base address
-		movne	\rx, #0xfa000000	@ virtual base
-		orr	\rx, \rx, #0x0006a000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
-		add	\rx, \rx, #0x00002000	@ UART 2
-#endif
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		add	\rx, \rx, #0x00fb0000	@ UART 3
-		add	\rx, \rx, #0x00006000
-#endif
-#endif
+		orr	\rx, \rx, #0x0006a000	@ uart1 on omap2/3/4
+		ldrb	\rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)] @ scratchpad
+
+		/* Select the UART to use based on the UART1 scratchpad value */
+		cmp	\rx, #0			@ no port configured?
+		beq	21f			@ if none, try to use UART1
+		cmp	\rx, #OMAP2UART1	@ OMAP2/3/4UART1
+		beq	21f			@ configure OMAP2/3/4UART1
+		cmp	\rx, #OMAP2UART2	@ OMAP2/3/4UART2
+		beq	22f			@ configure OMAP2/3/4UART2
+		cmp	\rx, #OMAP2UART3	@ only on 24xx
+		beq	23f			@ configure OMAP2UART3
+		cmp	\rx, #OMAP3UART3	@ only on 34xx
+		beq	33f			@ configure OMAP3UART3
+
+		/* Configure the UART offset from the phys/virt base */
+21:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
+		b	98f
+22:		mov	\rx, #0x0006a000
+		add	\rx, \rx, #0x00002000	@ OMAP2/3/4UART2
+		b	98f
+23:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
+		add	\rx, \rx, #0x00004000	@ OMAP2UART3
+		b	98f
+33:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
+		add	\rx, \rx, #0x00fb0000
+		add	\rx, \rx, #0x00006000	@ OMAP3UART3
+
+		/* Store both phys and virt address for the uart */
+98:		add	\rx, \rx, #0x48000000	@ phys base
+		str	\rx, omap_uart_phys
+		sub	\rx, \rx, #0x48000000	@ phys base
+		add	\rx, \rx, #0xfa000000	@ virt base
+		str	\rx, omap_uart_virt
+		b	10b
+99:
 		.endm
 
 		.macro	senduart,rd,rx
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 21e51c5..48157ce 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -161,11 +161,22 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
 static inline void __init omap_uart_reset(struct omap_uart_state *uart)
 {
 	struct plat_serial8250_port *p = uart->p;
+	u8 scratchpad = 0;
+
+	/*
+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
+	 */
+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
+		scratchpad = serial_read_reg(p, UART_SCR);
 
 	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
 	serial_write_reg(p, UART_OMAP_SCR, 0x08);
 	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
 	serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
+
+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
+		serial_write_reg(p, UART_SCR, scratchpad);
 }
 
 #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index c7e2b85..327362a 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -43,6 +43,24 @@
 #define OMAP16XX_BASE_BAUD	(48000000/16)
 #define OMAP24XX_BASE_BAUD	(48000000/16)
 
+/*
+ * DEBUG_LL port encoding stored into the UART1 scratchpad register by
+ * decomp_setup in uncompress.h
+ */
+#define OMAP1UART1		11
+#define OMAP1UART2		12
+#define OMAP1UART3		13
+#define OMAP2UART1		21
+#define OMAP2UART2		22
+#define OMAP2UART3		23
+#define OMAP3UART1		OMAP2UART1
+#define OMAP3UART2		OMAP2UART2
+#define OMAP3UART3		33
+#define OMAP4UART1		OMAP2UART1
+#define OMAP4UART2		OMAP2UART2
+#define OMAP4UART3		43
+#define OMAP4UART4		44
+
 /* This is only used by 8250.c for omap1510 */
 #define is_omap_port(pt)	({int __ret = 0;			\
 			if ((pt)->port.mapbase == OMAP1_UART1_BASE ||	\
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index 13c305d..479bac8 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -19,62 +19,36 @@
 
 #include <linux/types.h>
 #include <linux/serial_reg.h>
+
+#include <asm/mach-types.h>
+
 #include <plat/serial.h>
 
-unsigned int system_rev;
+static volatile u8 *uart1_base;
+static volatile u8 *uart_base;
+static volatile int uart_shift;
 
-#define UART_OMAP_MDR1		0x08	/* mode definition register */
-#define OMAP_ID_730		0x355F
-#define OMAP_ID_850		0x362C
-#define ID_MASK			0x7fff
-#define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
-#define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK
+/*
+ * Store the DEBUG_LL uart number into UART1 scratchpad register.
+ * See also debug-macro.S, and serial.c for related code.
+ *
+ * Please note that we currently assume that:
+ * - UART1 clocks are enabled for register access
+ * - UART1 scratchpad register can be used
+ */
+static void set_uart1_scratchpad(unsigned char port)
+{
+	uart1_base[UART_SCR << uart_shift] = port;
+}
 
 static void putc(int c)
 {
-	volatile u8 * uart = 0;
-	int shift = 2;
-
-#ifdef CONFIG_MACH_OMAP_PALMTE
-	return;
-#endif
-
-#ifdef CONFIG_ARCH_OMAP
-#ifdef	CONFIG_OMAP_LL_DEBUG_UART3
-	uart = (volatile u8 *)(OMAP_UART3_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
-	uart = (volatile u8 *)(OMAP_UART2_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_UART1)
-	uart = (volatile u8 *)(OMAP_UART1_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_NONE)
-	return;
-#else
-	return;
-#endif
-
-#ifdef CONFIG_ARCH_OMAP1
-	/* Determine which serial port to use */
-	do {
-		/* MMU is not on, so cpu_is_omapXXXX() won't work here */
-		unsigned int omap_id = omap_get_id();
-
-		if (omap_id == OMAP_ID_730 || omap_id == OMAP_ID_850)
-			shift = 0;
-
-		if (check_port(uart, shift))
-			break;
-		/* Silent boot if no serial ports are enabled. */
+	if (!uart_base)
 		return;
-	} while (0);
-#endif /* CONFIG_ARCH_OMAP1 */
-#endif
 
-	/*
-	 * Now, xmit each character
-	 */
-	while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
+	while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
 		barrier();
-	uart[UART_TX << shift] = c;
+	uart_base[UART_TX << uart_shift] = c;
 }
 
 static inline void flush(void)
@@ -82,7 +56,105 @@ static inline void flush(void)
 }
 
 /*
+ * Macros to configure UART1 and debug UART
+ */
+#define _DEBUG_LL_ENTRY(mach, uart1, dbg_uart, shift, dbg_id, reset_fn)	\
+	if (machine_is_##mach()) {					\
+		uart1_base = (volatile u8 *)(uart1);			\
+		uart_base = (volatile u8 *)(dbg_uart);			\
+		uart_shift = (shift);					\
+		port = (dbg_id);					\
+		reset_fn;						\
+		break;							\
+	}
+
+#define DEBUG_LL_OMAP7XX(p, mach)					\
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART1_BASE, OMAP1_UART##p##_BASE,	\
+		OMAP7XX_PORT_SHIFT, OMAP1UART##p, set_uart1_scratchpad(port))
+
+#define DEBUG_LL_OMAP1(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART1_BASE, OMAP1_UART##p##_BASE,	\
+		OMAP_PORT_SHIFT, OMAP1UART##p, set_uart1_scratchpad(port))
+
+#define DEBUG_LL_OMAP2(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP2_UART1_BASE, OMAP2_UART##p##_BASE,	\
+		OMAP_PORT_SHIFT, OMAP2UART##p, set_uart1_scratchpad(port))
+
+#define DEBUG_LL_OMAP3(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP3_UART1_BASE, OMAP3_UART##p##_BASE,	\
+		OMAP_PORT_SHIFT, OMAP3UART##p, set_uart1_scratchpad(port))
+
+#define DEBUG_LL_OMAP4(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP4_UART1_BASE, OMAP4_UART##p##_BASE,	\
+		OMAP_PORT_SHIFT, OMAP4UART##p, set_uart1_scratchpad(port))
+
+static inline void __arch_decomp_setup(unsigned long arch_id)
+{
+	int port = 0;
+
+	/*
+	 * Initialize the port based on the machine ID from the bootloader.
+	 * Note that we're using macros here instead of switch statement
+	 * as machine_is functions are optimized out for the boards that
+	 * are not selected.
+	 */
+	do {
+		/* omap7xx/8xx based boards using UART1 with shift 0 */
+		DEBUG_LL_OMAP7XX(1, herald);
+		DEBUG_LL_OMAP7XX(1, omap_perseus2);
+
+		/* omap15xx/16xx based boards using UART1 */
+		DEBUG_LL_OMAP1(1, ams_delta);
+		DEBUG_LL_OMAP1(1, nokia770);
+		DEBUG_LL_OMAP1(1, omap_h2);
+		DEBUG_LL_OMAP1(1, omap_h3);
+		DEBUG_LL_OMAP1(1, omap_innovator);
+		DEBUG_LL_OMAP1(1, omap_osk);
+		DEBUG_LL_OMAP1(1, omap_palmte);
+		DEBUG_LL_OMAP1(1, omap_palmz71);
+
+		/* omap15xx/16xx based boards using UART2 */
+		DEBUG_LL_OMAP1(2, omap_palmtt);
+
+		/* omap15xx/16xx based boards using UART3 */
+		DEBUG_LL_OMAP1(3, sx1);
+
+		/* omap2 based boards using UART1 */
+		DEBUG_LL_OMAP2(1, omap2evm);
+		DEBUG_LL_OMAP2(1, omap_2430sdp);
+		DEBUG_LL_OMAP2(1, omap_apollon);
+		DEBUG_LL_OMAP2(1, omap_h4);
+
+		/* omap2 based boards using UART3 */
+		DEBUG_LL_OMAP2(3, nokia_n800);
+		DEBUG_LL_OMAP2(3, nokia_n810);
+		DEBUG_LL_OMAP2(3, nokia_n810_wimax);
+
+		/* omap3 based boards using UART1 */
+		DEBUG_LL_OMAP2(1, omap3evm);
+		DEBUG_LL_OMAP3(1, omap_3430sdp);
+		DEBUG_LL_OMAP3(1, omap_3630sdp);
+
+		/* omap3 based boards using UART3 */
+		DEBUG_LL_OMAP3(3, cm_t35);
+		DEBUG_LL_OMAP3(3, igep0020);
+		DEBUG_LL_OMAP3(3, nokia_rx51);
+		DEBUG_LL_OMAP3(3, omap3517evm);
+		DEBUG_LL_OMAP3(3, omap3_beagle);
+		DEBUG_LL_OMAP3(3, omap3_pandora);
+		DEBUG_LL_OMAP3(3, omap_ldp);
+		DEBUG_LL_OMAP3(3, overo);
+		DEBUG_LL_OMAP3(3, touchbook);
+
+		/* omap4 based boards using UART3 */
+		DEBUG_LL_OMAP4(3, omap_4430sdp);
+
+	} while (0);
+}
+
+#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
+
+/*
  * nothing to do
  */
-#define arch_decomp_setup()
 #define arch_decomp_wdog()


^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-16  1:35   ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel

Define arch_decomp_setup() the same way as some other
architectures do. Use arch_id to configure the debug uart
based on the machine_is by storing it into the uart
scratchpad register for DEBUG_LL code to use.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   67 +++++++++-
 arch/arm/mach-omap1/serial.c                   |   12 ++
 arch/arm/mach-omap2/include/mach/debug-macro.S |   76 ++++++++---
 arch/arm/mach-omap2/serial.c                   |   11 ++
 arch/arm/plat-omap/include/plat/serial.h       |   18 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |  168 +++++++++++++++++-------
 6 files changed, 276 insertions(+), 76 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index 23e4724..0174858 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -15,18 +15,71 @@
 
 #include <plat/serial.h>
 
+omap_uart_phys:	.word	0x0
+omap_uart_virt:	.word	0x0
+
+		/*
+		 * Note that this code won't work if the bootloader passes
+		 * a wrong machine ID number in r1. To debug, just hardcode
+		 * the desired UART phys and virt addresses temporarily into
+		 * the omap_uart_phys and omap_uart_virt above.
+		 */
 		.macro	addruart,rx
+
+		/* Use omap_uart_phys/virt if already configured */
+9:		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		ldreq	\rx, omap_uart_phys	@ physical base address
+		ldrne	\rx, omap_uart_virt	@ virtual base
+		cmp	\rx, #0			@ is port configured?
+		bne	99f			@ already configured
+
+		/* Check 7XX UART1 scratchpad register for uart to use */
+		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		moveq	\rx, #0xff000000	@ physical base address
+		movne	\rx, #0xfe000000	@ virtual base
+		orr	\rx, \rx, #0x00fb0000	@ OMAP1UART1
+		ldrb	\rx, [\rx, #(UART_SCR << OMAP7XX_PORT_SHIFT)]
+		cmp	\rx, #0			@ anything in 7XX scratchpad?
+		bne	10f			@ found 7XX uart
+
+		/* Check 15xx/16xx UART1 scratchpad register for uart to use */
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
 		moveq	\rx, #0xff000000	@ physical base address
 		movne	\rx, #0xfe000000	@ virtual base
-		orr	\rx, \rx, #0x00fb0000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		orr	\rx, \rx, #0x00009000	@ UART 3
-#endif
-#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
-		orr	\rx, \rx, #0x00000800	@ UART 2 & 3
-#endif
+		orr	\rx, \rx, #0x00fb0000	@ OMAP1UART1
+		ldrb	\rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)]
+
+		/* Select the UART to use based on the UART1 scratchpad value */
+10:		cmp	\rx, #0			@ no port configured?
+		beq	11f			@ if none, try to use UART1
+		cmp	\rx, #OMAP1UART1
+		beq	11f			@ configure OMAP1UART1
+		cmp	\rx, #OMAP1UART2
+		beq	12f			@ configure OMAP1UART2
+		cmp	\rx, #OMAP1UART3
+		beq	13f			@ configure OMAP2UART3
+
+		/* Configure the UART offset from the phys/virt base */
+11:		mov	\rx, #0x00fb0000	@ OMAP1UART1
+		b	98f
+12:		mov	\rx, #0x00fb0000	@ OMAP1UART1
+		orr	\rx, \rx, #0x00000800	@ OMAP1UART2
+		b	98f
+13:		mov	\rx, #0x00fb0000	@ OMAP1UART1
+		orr	\rx, \rx, #0x00000800	@ OMAP1UART2
+		orr	\rx, \rx, #0x00009000	@ OMAP1UART3
+
+		/* Store both phys and virt address for the uart */
+98:		add	\rx, \rx, #0xff000000	@ phys base
+		str	\rx, omap_uart_phys
+		sub	\rx, \rx, #0xff000000	@ phys base
+		add	\rx, \rx, #0xfe000000	@ virt base
+		str	\rx, omap_uart_virt
+		b	9b
+99:
 		.endm
 
 		.macro	senduart,rd,rx
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 349de90..c36de59 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -52,6 +52,15 @@ static inline void omap_serial_outp(struct plat_serial8250_port *p, int offset,
  */
 static void __init omap_serial_reset(struct plat_serial8250_port *p)
 {
+	u8 scratchpad = 0;
+
+	/*
+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
+	 */
+	if (p->mapbase == OMAP1_UART1_BASE)
+		scratchpad = omap_serial_in(p, UART_SCR);
+
 	omap_serial_outp(p, UART_OMAP_MDR1, 0x07);	/* disable UART */
 	omap_serial_outp(p, UART_OMAP_SCR, 0x08);	/* TX watermark */
 	omap_serial_outp(p, UART_OMAP_MDR1, 0x00);	/* enable UART */
@@ -60,6 +69,9 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
 		omap_serial_outp(p, UART_OMAP_SYSC, 0x01);
 		while (!(omap_serial_in(p, UART_OMAP_SYSC) & 0x01));
 	}
+
+	if (p->mapbase == OMAP1_UART1_BASE)
+		omap_serial_outp(p, UART_SCR, scratchpad);
 }
 
 static struct plat_serial8250_port serial_platform_data[] = {
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 0c96e1c..1b83584 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -15,32 +15,66 @@
 
 #include <plat/serial.h>
 
+omap_uart_phys:	.word	0x0
+omap_uart_virt:	.word	0x0
+
+		/*
+		 * Note that this code won't work if the bootloader passes
+		 * a wrong machine ID number in r1. To debug, just hardcode
+		 * the desired UART phys and virt addresses temporarily into
+		 * the omap_uart_phys and omap_uart_virt above.
+		 */
 		.macro	addruart,rx
+
+		/* Use omap_uart_phys/virt if already configured */
+10:		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		ldreq	\rx, omap_uart_phys	@ physical base address
+		ldrne	\rx, omap_uart_virt	@ virtual base
+		cmp	\rx, #0			@ is port configured?
+		bne	99f			@ already configured
+
+		/* Check UART1 scratchpad register for uart to use */
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
-#ifdef  CONFIG_ARCH_OMAP2
 		moveq	\rx, #0x48000000	@ physical base address
 		movne	\rx, #0xfa000000	@ virtual base
-		orr	\rx, \rx, #0x0006a000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
-		add	\rx, \rx, #0x00002000	@ UART 2
-#endif
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		add	\rx, \rx, #0x00004000	@ UART 3
-#endif
-
-#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
-		moveq	\rx, #0x48000000	@ physical base address
-		movne	\rx, #0xfa000000	@ virtual base
-		orr	\rx, \rx, #0x0006a000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
-		add	\rx, \rx, #0x00002000	@ UART 2
-#endif
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		add	\rx, \rx, #0x00fb0000	@ UART 3
-		add	\rx, \rx, #0x00006000
-#endif
-#endif
+		orr	\rx, \rx, #0x0006a000	@ uart1 on omap2/3/4
+		ldrb	\rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)] @ scratchpad
+
+		/* Select the UART to use based on the UART1 scratchpad value */
+		cmp	\rx, #0			@ no port configured?
+		beq	21f			@ if none, try to use UART1
+		cmp	\rx, #OMAP2UART1	@ OMAP2/3/4UART1
+		beq	21f			@ configure OMAP2/3/4UART1
+		cmp	\rx, #OMAP2UART2	@ OMAP2/3/4UART2
+		beq	22f			@ configure OMAP2/3/4UART2
+		cmp	\rx, #OMAP2UART3	@ only on 24xx
+		beq	23f			@ configure OMAP2UART3
+		cmp	\rx, #OMAP3UART3	@ only on 34xx
+		beq	33f			@ configure OMAP3UART3
+
+		/* Configure the UART offset from the phys/virt base */
+21:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
+		b	98f
+22:		mov	\rx, #0x0006a000
+		add	\rx, \rx, #0x00002000	@ OMAP2/3/4UART2
+		b	98f
+23:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
+		add	\rx, \rx, #0x00004000	@ OMAP2UART3
+		b	98f
+33:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
+		add	\rx, \rx, #0x00fb0000
+		add	\rx, \rx, #0x00006000	@ OMAP3UART3
+
+		/* Store both phys and virt address for the uart */
+98:		add	\rx, \rx, #0x48000000	@ phys base
+		str	\rx, omap_uart_phys
+		sub	\rx, \rx, #0x48000000	@ phys base
+		add	\rx, \rx, #0xfa000000	@ virt base
+		str	\rx, omap_uart_virt
+		b	10b
+99:
 		.endm
 
 		.macro	senduart,rd,rx
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 21e51c5..48157ce 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -161,11 +161,22 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
 static inline void __init omap_uart_reset(struct omap_uart_state *uart)
 {
 	struct plat_serial8250_port *p = uart->p;
+	u8 scratchpad = 0;
+
+	/*
+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
+	 */
+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
+		scratchpad = serial_read_reg(p, UART_SCR);
 
 	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
 	serial_write_reg(p, UART_OMAP_SCR, 0x08);
 	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
 	serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
+
+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
+		serial_write_reg(p, UART_SCR, scratchpad);
 }
 
 #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index c7e2b85..327362a 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -43,6 +43,24 @@
 #define OMAP16XX_BASE_BAUD	(48000000/16)
 #define OMAP24XX_BASE_BAUD	(48000000/16)
 
+/*
+ * DEBUG_LL port encoding stored into the UART1 scratchpad register by
+ * decomp_setup in uncompress.h
+ */
+#define OMAP1UART1		11
+#define OMAP1UART2		12
+#define OMAP1UART3		13
+#define OMAP2UART1		21
+#define OMAP2UART2		22
+#define OMAP2UART3		23
+#define OMAP3UART1		OMAP2UART1
+#define OMAP3UART2		OMAP2UART2
+#define OMAP3UART3		33
+#define OMAP4UART1		OMAP2UART1
+#define OMAP4UART2		OMAP2UART2
+#define OMAP4UART3		43
+#define OMAP4UART4		44
+
 /* This is only used by 8250.c for omap1510 */
 #define is_omap_port(pt)	({int __ret = 0;			\
 			if ((pt)->port.mapbase == OMAP1_UART1_BASE ||	\
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index 13c305d..479bac8 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -19,62 +19,36 @@
 
 #include <linux/types.h>
 #include <linux/serial_reg.h>
+
+#include <asm/mach-types.h>
+
 #include <plat/serial.h>
 
-unsigned int system_rev;
+static volatile u8 *uart1_base;
+static volatile u8 *uart_base;
+static volatile int uart_shift;
 
-#define UART_OMAP_MDR1		0x08	/* mode definition register */
-#define OMAP_ID_730		0x355F
-#define OMAP_ID_850		0x362C
-#define ID_MASK			0x7fff
-#define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
-#define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK
+/*
+ * Store the DEBUG_LL uart number into UART1 scratchpad register.
+ * See also debug-macro.S, and serial.c for related code.
+ *
+ * Please note that we currently assume that:
+ * - UART1 clocks are enabled for register access
+ * - UART1 scratchpad register can be used
+ */
+static void set_uart1_scratchpad(unsigned char port)
+{
+	uart1_base[UART_SCR << uart_shift] = port;
+}
 
 static void putc(int c)
 {
-	volatile u8 * uart = 0;
-	int shift = 2;
-
-#ifdef CONFIG_MACH_OMAP_PALMTE
-	return;
-#endif
-
-#ifdef CONFIG_ARCH_OMAP
-#ifdef	CONFIG_OMAP_LL_DEBUG_UART3
-	uart = (volatile u8 *)(OMAP_UART3_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
-	uart = (volatile u8 *)(OMAP_UART2_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_UART1)
-	uart = (volatile u8 *)(OMAP_UART1_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_NONE)
-	return;
-#else
-	return;
-#endif
-
-#ifdef CONFIG_ARCH_OMAP1
-	/* Determine which serial port to use */
-	do {
-		/* MMU is not on, so cpu_is_omapXXXX() won't work here */
-		unsigned int omap_id = omap_get_id();
-
-		if (omap_id == OMAP_ID_730 || omap_id == OMAP_ID_850)
-			shift = 0;
-
-		if (check_port(uart, shift))
-			break;
-		/* Silent boot if no serial ports are enabled. */
+	if (!uart_base)
 		return;
-	} while (0);
-#endif /* CONFIG_ARCH_OMAP1 */
-#endif
 
-	/*
-	 * Now, xmit each character
-	 */
-	while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
+	while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
 		barrier();
-	uart[UART_TX << shift] = c;
+	uart_base[UART_TX << uart_shift] = c;
 }
 
 static inline void flush(void)
@@ -82,7 +56,105 @@ static inline void flush(void)
 }
 
 /*
+ * Macros to configure UART1 and debug UART
+ */
+#define _DEBUG_LL_ENTRY(mach, uart1, dbg_uart, shift, dbg_id, reset_fn)	\
+	if (machine_is_##mach()) {					\
+		uart1_base = (volatile u8 *)(uart1);			\
+		uart_base = (volatile u8 *)(dbg_uart);			\
+		uart_shift = (shift);					\
+		port = (dbg_id);					\
+		reset_fn;						\
+		break;							\
+	}
+
+#define DEBUG_LL_OMAP7XX(p, mach)					\
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART1_BASE, OMAP1_UART##p##_BASE,	\
+		OMAP7XX_PORT_SHIFT, OMAP1UART##p, set_uart1_scratchpad(port))
+
+#define DEBUG_LL_OMAP1(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART1_BASE, OMAP1_UART##p##_BASE,	\
+		OMAP_PORT_SHIFT, OMAP1UART##p, set_uart1_scratchpad(port))
+
+#define DEBUG_LL_OMAP2(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP2_UART1_BASE, OMAP2_UART##p##_BASE,	\
+		OMAP_PORT_SHIFT, OMAP2UART##p, set_uart1_scratchpad(port))
+
+#define DEBUG_LL_OMAP3(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP3_UART1_BASE, OMAP3_UART##p##_BASE,	\
+		OMAP_PORT_SHIFT, OMAP3UART##p, set_uart1_scratchpad(port))
+
+#define DEBUG_LL_OMAP4(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP4_UART1_BASE, OMAP4_UART##p##_BASE,	\
+		OMAP_PORT_SHIFT, OMAP4UART##p, set_uart1_scratchpad(port))
+
+static inline void __arch_decomp_setup(unsigned long arch_id)
+{
+	int port = 0;
+
+	/*
+	 * Initialize the port based on the machine ID from the bootloader.
+	 * Note that we're using macros here instead of switch statement
+	 * as machine_is functions are optimized out for the boards that
+	 * are not selected.
+	 */
+	do {
+		/* omap7xx/8xx based boards using UART1 with shift 0 */
+		DEBUG_LL_OMAP7XX(1, herald);
+		DEBUG_LL_OMAP7XX(1, omap_perseus2);
+
+		/* omap15xx/16xx based boards using UART1 */
+		DEBUG_LL_OMAP1(1, ams_delta);
+		DEBUG_LL_OMAP1(1, nokia770);
+		DEBUG_LL_OMAP1(1, omap_h2);
+		DEBUG_LL_OMAP1(1, omap_h3);
+		DEBUG_LL_OMAP1(1, omap_innovator);
+		DEBUG_LL_OMAP1(1, omap_osk);
+		DEBUG_LL_OMAP1(1, omap_palmte);
+		DEBUG_LL_OMAP1(1, omap_palmz71);
+
+		/* omap15xx/16xx based boards using UART2 */
+		DEBUG_LL_OMAP1(2, omap_palmtt);
+
+		/* omap15xx/16xx based boards using UART3 */
+		DEBUG_LL_OMAP1(3, sx1);
+
+		/* omap2 based boards using UART1 */
+		DEBUG_LL_OMAP2(1, omap2evm);
+		DEBUG_LL_OMAP2(1, omap_2430sdp);
+		DEBUG_LL_OMAP2(1, omap_apollon);
+		DEBUG_LL_OMAP2(1, omap_h4);
+
+		/* omap2 based boards using UART3 */
+		DEBUG_LL_OMAP2(3, nokia_n800);
+		DEBUG_LL_OMAP2(3, nokia_n810);
+		DEBUG_LL_OMAP2(3, nokia_n810_wimax);
+
+		/* omap3 based boards using UART1 */
+		DEBUG_LL_OMAP2(1, omap3evm);
+		DEBUG_LL_OMAP3(1, omap_3430sdp);
+		DEBUG_LL_OMAP3(1, omap_3630sdp);
+
+		/* omap3 based boards using UART3 */
+		DEBUG_LL_OMAP3(3, cm_t35);
+		DEBUG_LL_OMAP3(3, igep0020);
+		DEBUG_LL_OMAP3(3, nokia_rx51);
+		DEBUG_LL_OMAP3(3, omap3517evm);
+		DEBUG_LL_OMAP3(3, omap3_beagle);
+		DEBUG_LL_OMAP3(3, omap3_pandora);
+		DEBUG_LL_OMAP3(3, omap_ldp);
+		DEBUG_LL_OMAP3(3, overo);
+		DEBUG_LL_OMAP3(3, touchbook);
+
+		/* omap4 based boards using UART3 */
+		DEBUG_LL_OMAP4(3, omap_4430sdp);
+
+	} while (0);
+}
+
+#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
+
+/*
  * nothing to do
  */
-#define arch_decomp_setup()
 #define arch_decomp_wdog()

^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 3/4] omap: Remove old DEBUG_LL serial port options
  2010-01-16  1:35 ` Tony Lindgren
@ 2010-01-16  1:35   ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

These are no longer needed. Note that zoom boards
should now set their own function in uncompress.h
and debug-macro.S for the external UART.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/Kconfig |   19 -------------------
 1 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index e2ea04a..484d6a9 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -141,25 +141,6 @@ config OMAP_DM_TIMER
 	help
 	 Select this option if you want to use OMAP Dual-Mode timers.
 
-choice
-	prompt "Low-level debug console UART"
-	depends on ARCH_OMAP
-	default OMAP_LL_DEBUG_NONE
-
-config OMAP_LL_DEBUG_UART1
-	bool "UART1"
-
-config OMAP_LL_DEBUG_UART2
-	bool "UART2"
-
-config OMAP_LL_DEBUG_UART3
-	bool "UART3"
-
-config OMAP_LL_DEBUG_NONE
-	bool "None"
-
-endchoice
-
 config OMAP_SERIAL_WAKE
 	bool "Enable wake-up events for serial ports"
 	depends on ARCH_OMAP1 && OMAP_MUX


^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 3/4] omap: Remove old DEBUG_LL serial port options
@ 2010-01-16  1:35   ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel

These are no longer needed. Note that zoom boards
should now set their own function in uncompress.h
and debug-macro.S for the external UART.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/Kconfig |   19 -------------------
 1 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index e2ea04a..484d6a9 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -141,25 +141,6 @@ config OMAP_DM_TIMER
 	help
 	 Select this option if you want to use OMAP Dual-Mode timers.
 
-choice
-	prompt "Low-level debug console UART"
-	depends on ARCH_OMAP
-	default OMAP_LL_DEBUG_NONE
-
-config OMAP_LL_DEBUG_UART1
-	bool "UART1"
-
-config OMAP_LL_DEBUG_UART2
-	bool "UART2"
-
-config OMAP_LL_DEBUG_UART3
-	bool "UART3"
-
-config OMAP_LL_DEBUG_NONE
-	bool "None"
-
-endchoice
-
 config OMAP_SERIAL_WAKE
 	bool "Enable wake-up events for serial ports"
 	depends on ARCH_OMAP1 && OMAP_MUX

^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot
  2010-01-16  1:35 ` Tony Lindgren
@ 2010-01-16  1:35   ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

Make get_irqnr_and_base common for mach-omap2 multiboot

Note that this will only work currently for 24xx and 34xx.

The overhead of this should be minimal, it basically adds one
cmp to see if omap_irq_base has been configured already.
If necessary, we can set separate optimized get_irqnr_and_base
for non-multiboot configurations.

Support for 44xx can be added later on for basic multiboot,
and similar patch should be done for mach-omap1/entry-macro.S.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/include/mach/entry-macro.S |   55 ++++++++++++++++--------
 1 files changed, 37 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
index c7f1720..3f75a09 100644
--- a/arch/arm/mach-omap2/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
@@ -17,18 +17,7 @@
 
 #include <plat/omap24xx.h>
 #include <plat/omap34xx.h>
-
-/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
-#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
-#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
-#elif defined(CONFIG_ARCH_OMAP34XX)
-#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
-#endif
-#if defined(CONFIG_ARCH_OMAP4)
 #include <plat/omap44xx.h>
-#endif
-#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
-#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
 
 		.macro	disable_fiq
 		.endm
@@ -39,23 +28,53 @@
 		.macro  arch_ret_to_user, tmp1, tmp2
 		.endm
 
-#ifndef CONFIG_ARCH_OMAP4
+#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
+	defined(CONFIG_ARCH_OMAP34XX)
+
+#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
+#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
+
+omap_irq_base:	.word	0x0
+
 		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
-		ldr	\base, =OMAP2_VA_IC_BASE
-		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
+		ldr	\base, omap_irq_base
+		cmp	\base, #0		@ is irq base configured?
+		bne	9998f			@ already configured
+
+		/* Check the processor type */
+		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
+
+2400:		ldr	\base, =OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
+		str	\base, omap_irq_base
+		b	9998f
+
+3400:		ldr	\base, =OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
+		str	\base, omap_irq_base
+
+		/* Check the pending interrupts */
+9998:		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
 		cmp	\irqnr, #0x0
-		bne	2222f
+		bne	9999f
 		ldr	\irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
 		cmp	\irqnr, #0x0
-		bne	2222f
+		bne	9999f
 		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
 		cmp	\irqnr, #0x0
-2222:
+9999:
 		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
 		and	\irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
 
 		.endm
-#else
+#endif
+
+
+#ifdef CONFIG_ARCH_OMAP4
+
 #define OMAP44XX_VA_GIC_CPU_BASE	OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
 
 		/*


^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot
@ 2010-01-16  1:35   ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16  1:35 UTC (permalink / raw)
  To: linux-arm-kernel

Make get_irqnr_and_base common for mach-omap2 multiboot

Note that this will only work currently for 24xx and 34xx.

The overhead of this should be minimal, it basically adds one
cmp to see if omap_irq_base has been configured already.
If necessary, we can set separate optimized get_irqnr_and_base
for non-multiboot configurations.

Support for 44xx can be added later on for basic multiboot,
and similar patch should be done for mach-omap1/entry-macro.S.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/include/mach/entry-macro.S |   55 ++++++++++++++++--------
 1 files changed, 37 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
index c7f1720..3f75a09 100644
--- a/arch/arm/mach-omap2/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
@@ -17,18 +17,7 @@
 
 #include <plat/omap24xx.h>
 #include <plat/omap34xx.h>
-
-/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
-#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
-#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
-#elif defined(CONFIG_ARCH_OMAP34XX)
-#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
-#endif
-#if defined(CONFIG_ARCH_OMAP4)
 #include <plat/omap44xx.h>
-#endif
-#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
-#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
 
 		.macro	disable_fiq
 		.endm
@@ -39,23 +28,53 @@
 		.macro  arch_ret_to_user, tmp1, tmp2
 		.endm
 
-#ifndef CONFIG_ARCH_OMAP4
+#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
+	defined(CONFIG_ARCH_OMAP34XX)
+
+#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
+#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
+
+omap_irq_base:	.word	0x0
+
 		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
-		ldr	\base, =OMAP2_VA_IC_BASE
-		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
+		ldr	\base, omap_irq_base
+		cmp	\base, #0		@ is irq base configured?
+		bne	9998f			@ already configured
+
+		/* Check the processor type */
+		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
+
+2400:		ldr	\base, =OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
+		str	\base, omap_irq_base
+		b	9998f
+
+3400:		ldr	\base, =OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
+		str	\base, omap_irq_base
+
+		/* Check the pending interrupts */
+9998:		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
 		cmp	\irqnr, #0x0
-		bne	2222f
+		bne	9999f
 		ldr	\irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
 		cmp	\irqnr, #0x0
-		bne	2222f
+		bne	9999f
 		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
 		cmp	\irqnr, #0x0
-2222:
+9999:
 		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
 		and	\irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
 
 		.endm
-#else
+#endif
+
+
+#ifdef CONFIG_ARCH_OMAP4
+
 #define OMAP44XX_VA_GIC_CPU_BASE	OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
 
 		/*

^ permalink raw reply related	[flat|nested] 76+ messages in thread

* RE: [PATCH 1/4] omap: Clean the serial port defines
  2010-01-16  1:35   ` Tony Lindgren
@ 2010-01-16  7:48     ` Shilimkar, Santosh
  -1 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16  7:48 UTC (permalink / raw)
  To: Tony Lindgren, linux-arm-kernel; +Cc: linux-omap

Thanks for the nice cleanup.
<snip>

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org 
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony Lindgren
> Sent: Saturday, January 16, 2010 7:05 AM
> To: linux-arm-kernel@lists.infradead.org
> Cc: linux-omap@vger.kernel.org
> Subject: [PATCH 1/4] omap: Clean the serial port defines
> 
> This way we don't have conflicts with the defines
> with compiling in multiple omaps. Set the addresses
> for uarts in struct omap_globals for the early serial
> init code.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap1/include/mach/debug-macro.S |   16 +++++----
>  arch/arm/mach-omap1/serial.c                   |    6 ++-
>  arch/arm/mach-omap2/include/mach/debug-macro.S |   15 ++++----
>  arch/arm/mach-omap2/serial.c                   |   15 ++++++--
>  arch/arm/plat-omap/common.c                    |   18 ++++++++++
>  arch/arm/plat-omap/include/plat/common.h       |    5 +++
>  arch/arm/plat-omap/include/plat/serial.h       |   44 
> +++++++++++++-----------
>  7 files changed, 77 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S 
> b/arch/arm/mach-omap1/include/mach/debug-macro.S
> index aedb746..23e4724 100644
> --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> @@ -11,6 +11,10 @@
...

> diff --git a/arch/arm/mach-omap2/serial.c 
> b/arch/arm/mach-omap2/serial.c
> index 837b347..21e51c5 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -74,7 +74,6 @@ static LIST_HEAD(uart_list);

...


> diff --git a/arch/arm/plat-omap/include/plat/common.h 
> b/arch/arm/plat-omap/include/plat/common.h
> index 32c2227..a8fa0d7 100644
> --- a/arch/arm/plat-omap/include/plat/common.h
> +++ b/arch/arm/plat-omap/include/plat/common.h
> @@ -47,6 +47,10 @@ struct omap_globals {
>  	void __iomem	*prm;		/* Power and Reset Management */
>  	void __iomem	*cm;		/* Clock Management */
>  	void __iomem	*cm2;
> +	unsigned long	uart1_phys;
> +	unsigned long	uart2_phys;
> +	unsigned long	uart3_phys;
> +	unsigned long	uart4_phys;
Considering they are register base address, can
these be declared as "void __iomem" instead of "unsigned long"

Regards
Santosh

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 1/4] omap: Clean the serial port defines
@ 2010-01-16  7:48     ` Shilimkar, Santosh
  0 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16  7:48 UTC (permalink / raw)
  To: linux-arm-kernel

Thanks for the nice cleanup.
<snip>

> -----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 16, 2010 7:05 AM
> To: linux-arm-kernel at lists.infradead.org
> Cc: linux-omap at vger.kernel.org
> Subject: [PATCH 1/4] omap: Clean the serial port defines
> 
> This way we don't have conflicts with the defines
> with compiling in multiple omaps. Set the addresses
> for uarts in struct omap_globals for the early serial
> init code.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap1/include/mach/debug-macro.S |   16 +++++----
>  arch/arm/mach-omap1/serial.c                   |    6 ++-
>  arch/arm/mach-omap2/include/mach/debug-macro.S |   15 ++++----
>  arch/arm/mach-omap2/serial.c                   |   15 ++++++--
>  arch/arm/plat-omap/common.c                    |   18 ++++++++++
>  arch/arm/plat-omap/include/plat/common.h       |    5 +++
>  arch/arm/plat-omap/include/plat/serial.h       |   44 
> +++++++++++++-----------
>  7 files changed, 77 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S 
> b/arch/arm/mach-omap1/include/mach/debug-macro.S
> index aedb746..23e4724 100644
> --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> @@ -11,6 +11,10 @@
...

> diff --git a/arch/arm/mach-omap2/serial.c 
> b/arch/arm/mach-omap2/serial.c
> index 837b347..21e51c5 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -74,7 +74,6 @@ static LIST_HEAD(uart_list);

...


> diff --git a/arch/arm/plat-omap/include/plat/common.h 
> b/arch/arm/plat-omap/include/plat/common.h
> index 32c2227..a8fa0d7 100644
> --- a/arch/arm/plat-omap/include/plat/common.h
> +++ b/arch/arm/plat-omap/include/plat/common.h
> @@ -47,6 +47,10 @@ struct omap_globals {
>  	void __iomem	*prm;		/* Power and Reset Management */
>  	void __iomem	*cm;		/* Clock Management */
>  	void __iomem	*cm2;
> +	unsigned long	uart1_phys;
> +	unsigned long	uart2_phys;
> +	unsigned long	uart3_phys;
> +	unsigned long	uart4_phys;
Considering they are register base address, can
these be declared as "void __iomem" instead of "unsigned long"

Regards
Santosh

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16  1:35   ` Tony Lindgren
@ 2010-01-16  9:35     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 76+ messages in thread
From: Russell King - ARM Linux @ 2010-01-16  9:35 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> index 23e4724..0174858 100644
> --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> @@ -15,18 +15,71 @@
>  
>  #include <plat/serial.h>
>  
> +omap_uart_phys:	.word	0x0
> +omap_uart_virt:	.word	0x0

I assume that you have no plans for XIP kernel support on OMAP, since
these will be placed in the .text section, and is therefore read-only
on XIP kernels.

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-16  9:35     ` Russell King - ARM Linux
  0 siblings, 0 replies; 76+ messages in thread
From: Russell King - ARM Linux @ 2010-01-16  9:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> index 23e4724..0174858 100644
> --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> @@ -15,18 +15,71 @@
>  
>  #include <plat/serial.h>
>  
> +omap_uart_phys:	.word	0x0
> +omap_uart_virt:	.word	0x0

I assume that you have no plans for XIP kernel support on OMAP, since
these will be placed in the .text section, and is therefore read-only
on XIP kernels.

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16  1:35   ` Tony Lindgren
@ 2010-01-16 11:04     ` Shilimkar, Santosh
  -1 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16 11:04 UTC (permalink / raw)
  To: Tony Lindgren, linux-arm-kernel; +Cc: linux-omap

[-- Attachment #1: Type: text/plain, Size: 4728 bytes --]

<snip>
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org 
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony Lindgren
> Sent: Saturday, January 16, 2010 7:05 AM
> To: linux-arm-kernel@lists.infradead.org
> Cc: linux-omap@vger.kernel.org
> Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL 
> code generic
> 
> Define arch_decomp_setup() the same way as some other
> architectures do. Use arch_id to configure the debug uart
> based on the machine_is by storing it into the uart
> scratchpad register for DEBUG_LL code to use.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap1/include/mach/debug-macro.S |   67 +++++++++-
>  arch/arm/mach-omap1/serial.c                   |   12 ++
>  arch/arm/mach-omap2/include/mach/debug-macro.S |   76 ++++++++---
>  arch/arm/mach-omap2/serial.c                   |   11 ++
>  arch/arm/plat-omap/include/plat/serial.h       |   18 +++
>  arch/arm/plat-omap/include/plat/uncompress.h   |  168 
> +++++++++++++++++-------
>  6 files changed, 276 insertions(+), 76 deletions(-)
> 
....

>  static struct plat_serial8250_port serial_platform_data[] = {
> diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
> b/arch/arm/mach-omap2/include/mach/debug-macro.S
> index 0c96e1c..1b83584 100644
> --- a/arch/arm/mach-omap2/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
> @@ -15,32 +15,66 @@
>  
>  #include <plat/serial.h>
>  
> +omap_uart_phys:	.word	0x0
> +omap_uart_virt:	.word	0x0
> +
> +		/*
> +		 * Note that this code won't work if the 
> bootloader passes
> +		 * a wrong machine ID number in r1. To debug, 
> just hardcode
> +		 * the desired UART phys and virt addresses 
> temporarily into
> +		 * the omap_uart_phys and omap_uart_virt above.
> +		 */
>  		.macro	addruart,rx
> +
> +		/* Use omap_uart_phys/virt if already configured */
> +10:		mrc	p15, 0, \rx, c1, c0
> +		tst	\rx, #1			@ MMU enabled?
> +		ldreq	\rx, omap_uart_phys	@ physical base address
> +		ldrne	\rx, omap_uart_virt	@ virtual base
> +		cmp	\rx, #0			@ is port configured?
> +		bne	99f			@ already configured
> +
> +		/* Check UART1 scratchpad register for uart to use */
>  		mrc	p15, 0, \rx, c1, c0
>  		tst	\rx, #1			@ MMU enabled?
> -#ifdef  CONFIG_ARCH_OMAP2
>  		moveq	\rx, #0x48000000	@ physical base address
>  		movne	\rx, #0xfa000000	@ virtual base
> -		orr	\rx, \rx, #0x0006a000
> -#ifdef CONFIG_OMAP_LL_DEBUG_UART2
> -		add	\rx, \rx, #0x00002000	@ UART 2
> -#endif
> -#ifdef CONFIG_OMAP_LL_DEBUG_UART3
> -		add	\rx, \rx, #0x00004000	@ UART 3
> -#endif
> -
> -#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
> -		moveq	\rx, #0x48000000	@ physical base address
> -		movne	\rx, #0xfa000000	@ virtual base
> -		orr	\rx, \rx, #0x0006a000
> -#ifdef CONFIG_OMAP_LL_DEBUG_UART2
> -		add	\rx, \rx, #0x00002000	@ UART 2
> -#endif
> -#ifdef CONFIG_OMAP_LL_DEBUG_UART3
> -		add	\rx, \rx, #0x00fb0000	@ UART 3
> -		add	\rx, \rx, #0x00006000
> -#endif
> -#endif
> +		orr	\rx, \rx, #0x0006a000	@ uart1 on omap2/3/4
> +		ldrb	\rx, [\rx, #(UART_SCR << 
> OMAP_PORT_SHIFT)] @ scratchpad
> +
> +		/* Select the UART to use based on the UART1 
> scratchpad value */
> +		cmp	\rx, #0			@ no port configured?
> +		beq	21f			@ if none, try 
> to use UART1
> +		cmp	\rx, #OMAP2UART1	@ OMAP2/3/4UART1
> +		beq	21f			@ configure 
> OMAP2/3/4UART1
> +		cmp	\rx, #OMAP2UART2	@ OMAP2/3/4UART2
> +		beq	22f			@ configure 
> OMAP2/3/4UART2
> +		cmp	\rx, #OMAP2UART3	@ only on 24xx
> +		beq	23f			@ configure OMAP2UART3
> +		cmp	\rx, #OMAP3UART3	@ only on 34xx
> +		beq	33f			@ configure OMAP3UART3
Can you please add add OMAP4 UART3 case as well here using 
"OMAP4UART3". 

Attached patch fixes UART3 support for OMAP4 on top of your patches. Tested 
this on OMAP4430 SDP. You can fold this patch if you like

		@ configure OMAP4UART3
> +
> +		/* Configure the UART offset from the phys/virt base */
> +21:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
> +22:		mov	\rx, #0x0006a000
> +		add	\rx, \rx, #0x00002000	@ OMAP2/3/4UART2
> +		b	98f
> +23:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
> +		add	\rx, \rx, #0x00004000	@ OMAP2UART3
> +		b	98f
> +33:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
> +		add	\rx, \rx, #0x00fb0000
> +		add	\rx, \rx, #0x00006000	@ OMAP3UART3
> +
> +		/* Store both phys and virt address for the uart */
> +98:		add	\rx, \rx, #0x48000000	@ phys base
> +		str	\rx, omap_uart_phys
> +		sub	\rx, \rx, #0x48000000	@ phys base
> +		add	\rx, \rx, #0xfa000000	@ virt base
> +		str	\rx, omap_uart_virt
> +		b	10b
> +99:
>  		.endm
>  
>  		.macro	senduart,rd,rx

[-- Attachment #2: 0001-Update-DEBUG_LL-for-OMAP4.patch --]
[-- Type: application/octet-stream, Size: 1271 bytes --]

From 31d5a235df6cac6018b2182f048e38c1a4dbad6d Mon Sep 17 00:00:00 2001
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
Date: Sat, 16 Jan 2010 03:33:00 +0530
Subject: [PATCH] Update DEBUG_LL for OMAP4

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 1b83584..515b163 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -53,6 +53,8 @@ omap_uart_virt:	.word	0x0
 		beq	23f			@ configure OMAP2UART3
 		cmp	\rx, #OMAP3UART3	@ only on 34xx
 		beq	33f			@ configure OMAP3UART3
+		cmp	\rx, #OMAP4UART3	@ only on 44xx
+		beq	44f			@ configure OMAP4UART3
 
 		/* Configure the UART offset from the phys/virt base */
 21:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
@@ -66,6 +68,7 @@ omap_uart_virt:	.word	0x0
 33:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
 		add	\rx, \rx, #0x00fb0000
 		add	\rx, \rx, #0x00006000	@ OMAP3UART3
+44:		mov	\rx, #0x00020000	@ OMAP4UART3
 
 		/* Store both phys and virt address for the uart */
 98:		add	\rx, \rx, #0x48000000	@ phys base
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-16 11:04     ` Shilimkar, Santosh
  0 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16 11:04 UTC (permalink / raw)
  To: linux-arm-kernel

<snip>
> -----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 16, 2010 7:05 AM
> To: linux-arm-kernel at lists.infradead.org
> Cc: linux-omap at vger.kernel.org
> Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL 
> code generic
> 
> Define arch_decomp_setup() the same way as some other
> architectures do. Use arch_id to configure the debug uart
> based on the machine_is by storing it into the uart
> scratchpad register for DEBUG_LL code to use.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap1/include/mach/debug-macro.S |   67 +++++++++-
>  arch/arm/mach-omap1/serial.c                   |   12 ++
>  arch/arm/mach-omap2/include/mach/debug-macro.S |   76 ++++++++---
>  arch/arm/mach-omap2/serial.c                   |   11 ++
>  arch/arm/plat-omap/include/plat/serial.h       |   18 +++
>  arch/arm/plat-omap/include/plat/uncompress.h   |  168 
> +++++++++++++++++-------
>  6 files changed, 276 insertions(+), 76 deletions(-)
> 
....

>  static struct plat_serial8250_port serial_platform_data[] = {
> diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S 
> b/arch/arm/mach-omap2/include/mach/debug-macro.S
> index 0c96e1c..1b83584 100644
> --- a/arch/arm/mach-omap2/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
> @@ -15,32 +15,66 @@
>  
>  #include <plat/serial.h>
>  
> +omap_uart_phys:	.word	0x0
> +omap_uart_virt:	.word	0x0
> +
> +		/*
> +		 * Note that this code won't work if the 
> bootloader passes
> +		 * a wrong machine ID number in r1. To debug, 
> just hardcode
> +		 * the desired UART phys and virt addresses 
> temporarily into
> +		 * the omap_uart_phys and omap_uart_virt above.
> +		 */
>  		.macro	addruart,rx
> +
> +		/* Use omap_uart_phys/virt if already configured */
> +10:		mrc	p15, 0, \rx, c1, c0
> +		tst	\rx, #1			@ MMU enabled?
> +		ldreq	\rx, omap_uart_phys	@ physical base address
> +		ldrne	\rx, omap_uart_virt	@ virtual base
> +		cmp	\rx, #0			@ is port configured?
> +		bne	99f			@ already configured
> +
> +		/* Check UART1 scratchpad register for uart to use */
>  		mrc	p15, 0, \rx, c1, c0
>  		tst	\rx, #1			@ MMU enabled?
> -#ifdef  CONFIG_ARCH_OMAP2
>  		moveq	\rx, #0x48000000	@ physical base address
>  		movne	\rx, #0xfa000000	@ virtual base
> -		orr	\rx, \rx, #0x0006a000
> -#ifdef CONFIG_OMAP_LL_DEBUG_UART2
> -		add	\rx, \rx, #0x00002000	@ UART 2
> -#endif
> -#ifdef CONFIG_OMAP_LL_DEBUG_UART3
> -		add	\rx, \rx, #0x00004000	@ UART 3
> -#endif
> -
> -#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
> -		moveq	\rx, #0x48000000	@ physical base address
> -		movne	\rx, #0xfa000000	@ virtual base
> -		orr	\rx, \rx, #0x0006a000
> -#ifdef CONFIG_OMAP_LL_DEBUG_UART2
> -		add	\rx, \rx, #0x00002000	@ UART 2
> -#endif
> -#ifdef CONFIG_OMAP_LL_DEBUG_UART3
> -		add	\rx, \rx, #0x00fb0000	@ UART 3
> -		add	\rx, \rx, #0x00006000
> -#endif
> -#endif
> +		orr	\rx, \rx, #0x0006a000	@ uart1 on omap2/3/4
> +		ldrb	\rx, [\rx, #(UART_SCR << 
> OMAP_PORT_SHIFT)] @ scratchpad
> +
> +		/* Select the UART to use based on the UART1 
> scratchpad value */
> +		cmp	\rx, #0			@ no port configured?
> +		beq	21f			@ if none, try 
> to use UART1
> +		cmp	\rx, #OMAP2UART1	@ OMAP2/3/4UART1
> +		beq	21f			@ configure 
> OMAP2/3/4UART1
> +		cmp	\rx, #OMAP2UART2	@ OMAP2/3/4UART2
> +		beq	22f			@ configure 
> OMAP2/3/4UART2
> +		cmp	\rx, #OMAP2UART3	@ only on 24xx
> +		beq	23f			@ configure OMAP2UART3
> +		cmp	\rx, #OMAP3UART3	@ only on 34xx
> +		beq	33f			@ configure OMAP3UART3
Can you please add add OMAP4 UART3 case as well here using 
"OMAP4UART3". 

Attached patch fixes UART3 support for OMAP4 on top of your patches. Tested 
this on OMAP4430 SDP. You can fold this patch if you like

		@ configure OMAP4UART3
> +
> +		/* Configure the UART offset from the phys/virt base */
> +21:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
> +22:		mov	\rx, #0x0006a000
> +		add	\rx, \rx, #0x00002000	@ OMAP2/3/4UART2
> +		b	98f
> +23:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
> +		add	\rx, \rx, #0x00004000	@ OMAP2UART3
> +		b	98f
> +33:		mov	\rx, #0x0006a000	@ OMAP2/3/4UART1
> +		add	\rx, \rx, #0x00fb0000
> +		add	\rx, \rx, #0x00006000	@ OMAP3UART3
> +
> +		/* Store both phys and virt address for the uart */
> +98:		add	\rx, \rx, #0x48000000	@ phys base
> +		str	\rx, omap_uart_phys
> +		sub	\rx, \rx, #0x48000000	@ phys base
> +		add	\rx, \rx, #0xfa000000	@ virt base
> +		str	\rx, omap_uart_virt
> +		b	10b
> +99:
>  		.endm
>  
>  		.macro	senduart,rd,rx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Update-DEBUG_LL-for-OMAP4.patch
Type: application/octet-stream
Size: 1271 bytes
Desc: 0001-Update-DEBUG_LL-for-OMAP4.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100116/d90886a2/attachment-0001.obj>

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot
  2010-01-16  1:35   ` Tony Lindgren
@ 2010-01-16 11:24     ` Shilimkar, Santosh
  -1 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16 11:24 UTC (permalink / raw)
  To: Tony Lindgren, linux-arm-kernel; +Cc: linux-omap

This too is nice fix for multiboot.
> -----Original Message-----
> From: linux-arm-kernel-bounces@lists.infradead.org 
> [mailto:linux-arm-kernel-bounces@lists.infradead.org] On 
> Behalf Of Tony Lindgren
> Sent: Saturday, January 16, 2010 7:05 AM
> To: linux-arm-kernel@lists.infradead.org
> Cc: linux-omap@vger.kernel.org
> Subject: [PATCH 4/4] omap: Make get_irqnr_and_base common for 
> mach-omap2 multiboot
> 
> Make get_irqnr_and_base common for mach-omap2 multiboot
> 
> Note that this will only work currently for 24xx and 34xx.
> 
> The overhead of this should be minimal, it basically adds one
> cmp to see if omap_irq_base has been configured already.
> If necessary, we can set separate optimized get_irqnr_and_base
> for non-multiboot configurations.
Well there is an overhead of two instructions for every interrupt,
so probably having two version of "get_irqnr_and_base" would be good.
> 
> Support for 44xx can be added later on for basic multiboot,
> and similar patch should be done for mach-omap1/entry-macro.S.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/include/mach/entry-macro.S |   55 
> ++++++++++++++++--------
>  1 files changed, 37 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S 
> b/arch/arm/mach-omap2/include/mach/entry-macro.S
> index c7f1720..3f75a09 100644
> --- a/arch/arm/mach-omap2/include/mach/entry-macro.S
> +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
> @@ -17,18 +17,7 @@
>  
>  #include <plat/omap24xx.h>
>  #include <plat/omap34xx.h>
> -
> -/* REVISIT: This should be set dynamically if 
> CONFIG_MULTI_OMAP2 is selected */
> -#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
> -#define OMAP2_VA_IC_BASE		
> OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> -#elif defined(CONFIG_ARCH_OMAP34XX)
> -#define OMAP2_VA_IC_BASE		
> OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> -#endif
> -#if defined(CONFIG_ARCH_OMAP4)
>  #include <plat/omap44xx.h>
> -#endif
> -#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* 
> Active interrupt offset */
> -#define	ACTIVEIRQ_MASK		0x7f		/* 
> Active interrupt bits */
>  
>  		.macro	disable_fiq
>  		.endm
> @@ -39,23 +28,53 @@
>  		.macro  arch_ret_to_user, tmp1, tmp2
>  		.endm
>  
> -#ifndef CONFIG_ARCH_OMAP4
> +#if defined(CONFIG_ARCH_OMAP2420) || 
> defined(CONFIG_ARCH_OMAP2430) || \
> +	defined(CONFIG_ARCH_OMAP34XX)
> +
> +#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* 
> Active interrupt offset */
> +#define	ACTIVEIRQ_MASK		0x7f		/* 
> Active interrupt bits */
> +
> +omap_irq_base:	.word	0x0
> +
>  		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> -		ldr	\base, =OMAP2_VA_IC_BASE
> -		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
> +		ldr	\base, omap_irq_base
> +		cmp	\base, #0		@ is irq base 
> configured?
> +		bne	9998f			@ already configured
> +
> +		/* Check the processor type */
> +		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
> +
> +2400:		ldr	\base, 
> =OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> +		str	\base, omap_irq_base
> +		b	9998f
> +
> +3400:		ldr	\base, 
> =OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> +		str	\base, omap_irq_base
> +
> +		/* Check the pending interrupts */
> +9998:		ldr	\irqnr, [\base, #0x98] /* IRQ 
> pending reg 1 */
>  		cmp	\irqnr, #0x0
> -		bne	2222f
> +		bne	9999f
>  		ldr	\irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
>  		cmp	\irqnr, #0x0
> -		bne	2222f
> +		bne	9999f
>  		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
>  		cmp	\irqnr, #0x0
> -2222:
> +9999:
>  		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
>  		and	\irqnr, \irqnr, #ACTIVEIRQ_MASK /* 
> Clear spurious bits */
>  
>  		.endm
> -#else
> +#endif
> +
> +
> +#ifdef CONFIG_ARCH_OMAP4
> +
>  #define OMAP44XX_VA_GIC_CPU_BASE	
> OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
>  
>  		/*
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot
@ 2010-01-16 11:24     ` Shilimkar, Santosh
  0 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16 11:24 UTC (permalink / raw)
  To: linux-arm-kernel

This too is nice fix for multiboot.
> -----Original Message-----
> From: linux-arm-kernel-bounces at lists.infradead.org 
> [mailto:linux-arm-kernel-bounces at lists.infradead.org] On 
> Behalf Of Tony Lindgren
> Sent: Saturday, January 16, 2010 7:05 AM
> To: linux-arm-kernel at lists.infradead.org
> Cc: linux-omap at vger.kernel.org
> Subject: [PATCH 4/4] omap: Make get_irqnr_and_base common for 
> mach-omap2 multiboot
> 
> Make get_irqnr_and_base common for mach-omap2 multiboot
> 
> Note that this will only work currently for 24xx and 34xx.
> 
> The overhead of this should be minimal, it basically adds one
> cmp to see if omap_irq_base has been configured already.
> If necessary, we can set separate optimized get_irqnr_and_base
> for non-multiboot configurations.
Well there is an overhead of two instructions for every interrupt,
so probably having two version of "get_irqnr_and_base" would be good.
> 
> Support for 44xx can be added later on for basic multiboot,
> and similar patch should be done for mach-omap1/entry-macro.S.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/include/mach/entry-macro.S |   55 
> ++++++++++++++++--------
>  1 files changed, 37 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S 
> b/arch/arm/mach-omap2/include/mach/entry-macro.S
> index c7f1720..3f75a09 100644
> --- a/arch/arm/mach-omap2/include/mach/entry-macro.S
> +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
> @@ -17,18 +17,7 @@
>  
>  #include <plat/omap24xx.h>
>  #include <plat/omap34xx.h>
> -
> -/* REVISIT: This should be set dynamically if 
> CONFIG_MULTI_OMAP2 is selected */
> -#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
> -#define OMAP2_VA_IC_BASE		
> OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> -#elif defined(CONFIG_ARCH_OMAP34XX)
> -#define OMAP2_VA_IC_BASE		
> OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> -#endif
> -#if defined(CONFIG_ARCH_OMAP4)
>  #include <plat/omap44xx.h>
> -#endif
> -#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* 
> Active interrupt offset */
> -#define	ACTIVEIRQ_MASK		0x7f		/* 
> Active interrupt bits */
>  
>  		.macro	disable_fiq
>  		.endm
> @@ -39,23 +28,53 @@
>  		.macro  arch_ret_to_user, tmp1, tmp2
>  		.endm
>  
> -#ifndef CONFIG_ARCH_OMAP4
> +#if defined(CONFIG_ARCH_OMAP2420) || 
> defined(CONFIG_ARCH_OMAP2430) || \
> +	defined(CONFIG_ARCH_OMAP34XX)
> +
> +#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* 
> Active interrupt offset */
> +#define	ACTIVEIRQ_MASK		0x7f		/* 
> Active interrupt bits */
> +
> +omap_irq_base:	.word	0x0
> +
>  		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> -		ldr	\base, =OMAP2_VA_IC_BASE
> -		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
> +		ldr	\base, omap_irq_base
> +		cmp	\base, #0		@ is irq base 
> configured?
> +		bne	9998f			@ already configured
> +
> +		/* Check the processor type */
> +		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
> +
> +2400:		ldr	\base, 
> =OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> +		str	\base, omap_irq_base
> +		b	9998f
> +
> +3400:		ldr	\base, 
> =OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> +		str	\base, omap_irq_base
> +
> +		/* Check the pending interrupts */
> +9998:		ldr	\irqnr, [\base, #0x98] /* IRQ 
> pending reg 1 */
>  		cmp	\irqnr, #0x0
> -		bne	2222f
> +		bne	9999f
>  		ldr	\irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
>  		cmp	\irqnr, #0x0
> -		bne	2222f
> +		bne	9999f
>  		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
>  		cmp	\irqnr, #0x0
> -2222:
> +9999:
>  		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
>  		and	\irqnr, \irqnr, #ACTIVEIRQ_MASK /* 
> Clear spurious bits */
>  
>  		.endm
> -#else
> +#endif
> +
> +
> +#ifdef CONFIG_ARCH_OMAP4
> +
>  #define OMAP44XX_VA_GIC_CPU_BASE	
> OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
>  
>  		/*
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot
  2010-01-16  1:35   ` Tony Lindgren
@ 2010-01-16 11:55     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 76+ messages in thread
From: Russell King - ARM Linux @ 2010-01-16 11:55 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

On Fri, Jan 15, 2010 at 05:35:20PM -0800, Tony Lindgren wrote:
> -#ifndef CONFIG_ARCH_OMAP4
> +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> +	defined(CONFIG_ARCH_OMAP34XX)
> +
> +#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> +#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> +
> +omap_irq_base:	.word	0x0

You have no idea where this word will be placed - it could be in the middle
of a read only section, which might really be read only.  It might also be
out of reach of the "ldr \base, [pc, #offset]" instructions you're using
below - which is what an "ldr \base, address" instruction really is.

> +
>  		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> -		ldr	\base, =OMAP2_VA_IC_BASE
> -		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
> +		ldr	\base, omap_irq_base
> +		cmp	\base, #0		@ is irq base configured?
> +		bne	9998f			@ already configured

First thing, why not use get_irqnr_preamble to load the base address?
That means you only do all this computation once per group of IRQs
processed.

Secondly, is this really worth the overhead, or can't you move
omap_irq_base into the data section, and have your IRQ initialization
function set the pointer?

You then don't have to make these two tests every time you check for
an interrupt/enter to process interrupts.

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot
@ 2010-01-16 11:55     ` Russell King - ARM Linux
  0 siblings, 0 replies; 76+ messages in thread
From: Russell King - ARM Linux @ 2010-01-16 11:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 15, 2010 at 05:35:20PM -0800, Tony Lindgren wrote:
> -#ifndef CONFIG_ARCH_OMAP4
> +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> +	defined(CONFIG_ARCH_OMAP34XX)
> +
> +#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> +#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> +
> +omap_irq_base:	.word	0x0

You have no idea where this word will be placed - it could be in the middle
of a read only section, which might really be read only.  It might also be
out of reach of the "ldr \base, [pc, #offset]" instructions you're using
below - which is what an "ldr \base, address" instruction really is.

> +
>  		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> -		ldr	\base, =OMAP2_VA_IC_BASE
> -		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
> +		ldr	\base, omap_irq_base
> +		cmp	\base, #0		@ is irq base configured?
> +		bne	9998f			@ already configured

First thing, why not use get_irqnr_preamble to load the base address?
That means you only do all this computation once per group of IRQs
processed.

Secondly, is this really worth the overhead, or can't you move
omap_irq_base into the data section, and have your IRQ initialization
function set the pointer?

You then don't have to make these two tests every time you check for
an interrupt/enter to process interrupts.

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot
  2010-01-16 11:55     ` Russell King - ARM Linux
@ 2010-01-16 19:12       ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 19:12 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-arm-kernel, linux-omap

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 03:53]:
> On Fri, Jan 15, 2010 at 05:35:20PM -0800, Tony Lindgren wrote:
> > -#ifndef CONFIG_ARCH_OMAP4
> > +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> > +	defined(CONFIG_ARCH_OMAP34XX)
> > +
> > +#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> > +#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> > +
> > +omap_irq_base:	.word	0x0
> 
> You have no idea where this word will be placed - it could be in the middle
> of a read only section, which might really be read only.  It might also be
> out of reach of the "ldr \base, [pc, #offset]" instructions you're using
> below - which is what an "ldr \base, address" instruction really is.

OK
 
> > +
> >  		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> > -		ldr	\base, =OMAP2_VA_IC_BASE
> > -		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
> > +		ldr	\base, omap_irq_base
> > +		cmp	\base, #0		@ is irq base configured?
> > +		bne	9998f			@ already configured
> 
> First thing, why not use get_irqnr_preamble to load the base address?
> That means you only do all this computation once per group of IRQs
> processed.

Thanks for the tip, will do.
 
> Secondly, is this really worth the overhead, or can't you move
> omap_irq_base into the data section, and have your IRQ initialization
> function set the pointer?

Sounds like a good plan. We can have optimized versions for non-multiomap
configurations.
 
> You then don't have to make these two tests every time you check for
> an interrupt/enter to process interrupts.

Great, that will make things much nicer.

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot
@ 2010-01-16 19:12       ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 19:12 UTC (permalink / raw)
  To: linux-arm-kernel

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 03:53]:
> On Fri, Jan 15, 2010 at 05:35:20PM -0800, Tony Lindgren wrote:
> > -#ifndef CONFIG_ARCH_OMAP4
> > +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> > +	defined(CONFIG_ARCH_OMAP34XX)
> > +
> > +#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> > +#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> > +
> > +omap_irq_base:	.word	0x0
> 
> You have no idea where this word will be placed - it could be in the middle
> of a read only section, which might really be read only.  It might also be
> out of reach of the "ldr \base, [pc, #offset]" instructions you're using
> below - which is what an "ldr \base, address" instruction really is.

OK
 
> > +
> >  		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> > -		ldr	\base, =OMAP2_VA_IC_BASE
> > -		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
> > +		ldr	\base, omap_irq_base
> > +		cmp	\base, #0		@ is irq base configured?
> > +		bne	9998f			@ already configured
> 
> First thing, why not use get_irqnr_preamble to load the base address?
> That means you only do all this computation once per group of IRQs
> processed.

Thanks for the tip, will do.
 
> Secondly, is this really worth the overhead, or can't you move
> omap_irq_base into the data section, and have your IRQ initialization
> function set the pointer?

Sounds like a good plan. We can have optimized versions for non-multiomap
configurations.
 
> You then don't have to make these two tests every time you check for
> an interrupt/enter to process interrupts.

Great, that will make things much nicer.

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16  9:35     ` Russell King - ARM Linux
@ 2010-01-16 19:18       ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 19:18 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-arm-kernel, linux-omap

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
> On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > index 23e4724..0174858 100644
> > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > @@ -15,18 +15,71 @@
> >  
> >  #include <plat/serial.h>
> >  
> > +omap_uart_phys:	.word	0x0
> > +omap_uart_virt:	.word	0x0
> 
> I assume that you have no plans for XIP kernel support on OMAP, since
> these will be placed in the .text section, and is therefore read-only
> on XIP kernels.

Did not think of that.. Maybe some addruart_premable solution here would.
Or adding \tmp register for addruart and just do the detection for each
character.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-16 19:18       ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 19:18 UTC (permalink / raw)
  To: linux-arm-kernel

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
> On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > index 23e4724..0174858 100644
> > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > @@ -15,18 +15,71 @@
> >  
> >  #include <plat/serial.h>
> >  
> > +omap_uart_phys:	.word	0x0
> > +omap_uart_virt:	.word	0x0
> 
> I assume that you have no plans for XIP kernel support on OMAP, since
> these will be placed in the .text section, and is therefore read-only
> on XIP kernels.

Did not think of that.. Maybe some addruart_premable solution here would.
Or adding \tmp register for addruart and just do the detection for each
character.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16 11:04     ` Shilimkar, Santosh
@ 2010-01-16 19:20       ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 19:20 UTC (permalink / raw)
  To: Shilimkar, Santosh; +Cc: linux-arm-kernel, linux-omap

* Shilimkar, Santosh <santosh.shilimkar@ti.com> [100116 03:02]:

<snip>

> Can you please add add OMAP4 UART3 case as well here using 
> "OMAP4UART3". 

Sure.
 
> Attached patch fixes UART3 support for OMAP4 on top of your patches. Tested 
> this on OMAP4430 SDP. You can fold this patch if you like

Thanks will test. And thanks for testing. Note that once the
issues Russell pointed out are solved, we should also easily
be able to support the external uart on Zoom boards for
DEBUG_LL.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-16 19:20       ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 19:20 UTC (permalink / raw)
  To: linux-arm-kernel

* Shilimkar, Santosh <santosh.shilimkar@ti.com> [100116 03:02]:

<snip>

> Can you please add add OMAP4 UART3 case as well here using 
> "OMAP4UART3". 

Sure.
 
> Attached patch fixes UART3 support for OMAP4 on top of your patches. Tested 
> this on OMAP4430 SDP. You can fold this patch if you like

Thanks will test. And thanks for testing. Note that once the
issues Russell pointed out are solved, we should also easily
be able to support the external uart on Zoom boards for
DEBUG_LL.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 1/4] omap: Clean the serial port defines
  2010-01-16  7:48     ` Shilimkar, Santosh
@ 2010-01-16 19:25       ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 19:25 UTC (permalink / raw)
  To: Shilimkar, Santosh; +Cc: linux-arm-kernel, linux-omap

* Shilimkar, Santosh <santosh.shilimkar@ti.com> [100115 23:46]:
> Thanks for the nice cleanup.

Thanks for testing :)

> <snip>
> > --- a/arch/arm/plat-omap/include/plat/common.h
> > +++ b/arch/arm/plat-omap/include/plat/common.h
> > @@ -47,6 +47,10 @@ struct omap_globals {
> >  	void __iomem	*prm;		/* Power and Reset Management */
> >  	void __iomem	*cm;		/* Clock Management */
> >  	void __iomem	*cm2;
> > +	unsigned long	uart1_phys;
> > +	unsigned long	uart2_phys;
> > +	unsigned long	uart3_phys;
> > +	unsigned long	uart4_phys;
> Considering they are register base address, can
> these be declared as "void __iomem" instead of "unsigned long"

These are physical addresses instead of virtual addresses.
They get ioremapped in mach-omap[12]/serial.c. So they should
not be void __iomem * in omap_globals.

BTW, we should eventually change everything in omap_globals
to be physical addresses.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 1/4] omap: Clean the serial port defines
@ 2010-01-16 19:25       ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 19:25 UTC (permalink / raw)
  To: linux-arm-kernel

* Shilimkar, Santosh <santosh.shilimkar@ti.com> [100115 23:46]:
> Thanks for the nice cleanup.

Thanks for testing :)

> <snip>
> > --- a/arch/arm/plat-omap/include/plat/common.h
> > +++ b/arch/arm/plat-omap/include/plat/common.h
> > @@ -47,6 +47,10 @@ struct omap_globals {
> >  	void __iomem	*prm;		/* Power and Reset Management */
> >  	void __iomem	*cm;		/* Clock Management */
> >  	void __iomem	*cm2;
> > +	unsigned long	uart1_phys;
> > +	unsigned long	uart2_phys;
> > +	unsigned long	uart3_phys;
> > +	unsigned long	uart4_phys;
> Considering they are register base address, can
> these be declared as "void __iomem" instead of "unsigned long"

These are physical addresses instead of virtual addresses.
They get ioremapped in mach-omap[12]/serial.c. So they should
not be void __iomem * in omap_globals.

BTW, we should eventually change everything in omap_globals
to be physical addresses.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16 19:18       ` Tony Lindgren
@ 2010-01-16 19:33         ` Russell King - ARM Linux
  -1 siblings, 0 replies; 76+ messages in thread
From: Russell King - ARM Linux @ 2010-01-16 19:33 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

On Sat, Jan 16, 2010 at 11:18:20AM -0800, Tony Lindgren wrote:
> * Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
> > On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> > > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > index 23e4724..0174858 100644
> > > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > @@ -15,18 +15,71 @@
> > >  
> > >  #include <plat/serial.h>
> > >  
> > > +omap_uart_phys:	.word	0x0
> > > +omap_uart_virt:	.word	0x0
> > 
> > I assume that you have no plans for XIP kernel support on OMAP, since
> > these will be placed in the .text section, and is therefore read-only
> > on XIP kernels.
> 
> Did not think of that.. Maybe some addruart_premable solution here would.
> Or adding \tmp register for addruart and just do the detection for each
> character.

How does doing it per-character help?  The code is:

ENTRY(printascii)
                addruart r3
                b       2f
1:              waituart r2, r3
                senduart r1, r3
                busyuart r2, r3
                teq     r1, #'\n'
                moveq   r1, #'\r'
                beq     1b
2:              teq     r0, #0
                ldrneb  r1, [r0], #1
                teqne   r1, #0
                bne     1b
                mov     pc, lr

Your wait/send/busy macros are just using the already provided base
address which comes via r3 from addruart.  That much is fine.

I'm at a loss to understand why you think moving the address-getting
functionality out of addruart into the individual wait/send/busy
macros is going to help in any way.

Why not do something like this:

		.pushsection .data
omap_uart_phys:	.word 0
omap_uart_virt:	.word 0
		.popsection

		.macro addruart, rx
...		
+               ldreq   \rx, =omap_uart_phys    @ physical base address
+               ldrne   \rx, =omap_uart_virt    @ virtual base
		ldr	\rx, [\rx]
+               cmp     \rx, #0                 @ is port configured?
+               bne     99f                     @ already configured
...

?

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-16 19:33         ` Russell King - ARM Linux
  0 siblings, 0 replies; 76+ messages in thread
From: Russell King - ARM Linux @ 2010-01-16 19:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 16, 2010 at 11:18:20AM -0800, Tony Lindgren wrote:
> * Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
> > On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> > > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > index 23e4724..0174858 100644
> > > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > @@ -15,18 +15,71 @@
> > >  
> > >  #include <plat/serial.h>
> > >  
> > > +omap_uart_phys:	.word	0x0
> > > +omap_uart_virt:	.word	0x0
> > 
> > I assume that you have no plans for XIP kernel support on OMAP, since
> > these will be placed in the .text section, and is therefore read-only
> > on XIP kernels.
> 
> Did not think of that.. Maybe some addruart_premable solution here would.
> Or adding \tmp register for addruart and just do the detection for each
> character.

How does doing it per-character help?  The code is:

ENTRY(printascii)
                addruart r3
                b       2f
1:              waituart r2, r3
                senduart r1, r3
                busyuart r2, r3
                teq     r1, #'\n'
                moveq   r1, #'\r'
                beq     1b
2:              teq     r0, #0
                ldrneb  r1, [r0], #1
                teqne   r1, #0
                bne     1b
                mov     pc, lr

Your wait/send/busy macros are just using the already provided base
address which comes via r3 from addruart.  That much is fine.

I'm at a loss to understand why you think moving the address-getting
functionality out of addruart into the individual wait/send/busy
macros is going to help in any way.

Why not do something like this:

		.pushsection .data
omap_uart_phys:	.word 0
omap_uart_virt:	.word 0
		.popsection

		.macro addruart, rx
...		
+               ldreq   \rx, =omap_uart_phys    @ physical base address
+               ldrne   \rx, =omap_uart_virt    @ virtual base
		ldr	\rx, [\rx]
+               cmp     \rx, #0                 @ is port configured?
+               bne     99f                     @ already configured
...

?

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 1/4] omap: Clean the serial port defines
  2010-01-16 19:25       ` Tony Lindgren
@ 2010-01-16 19:33         ` Shilimkar, Santosh
  -1 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16 19:33 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

> -----Original Message-----
> From: Tony Lindgren [mailto:tony@atomide.com] 
> Sent: Sunday, January 17, 2010 12:56 AM
> To: Shilimkar, Santosh
> Cc: linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
> Subject: Re: [PATCH 1/4] omap: Clean the serial port defines
> 
> * Shilimkar, Santosh <santosh.shilimkar@ti.com> [100115 23:46]:
> > Thanks for the nice cleanup.
> 
> Thanks for testing :)
> 
> > <snip>
> > > --- a/arch/arm/plat-omap/include/plat/common.h
> > > +++ b/arch/arm/plat-omap/include/plat/common.h
> > > @@ -47,6 +47,10 @@ struct omap_globals {
> > >  	void __iomem	*prm;		/* Power and Reset Management */
> > >  	void __iomem	*cm;		/* Clock Management */
> > >  	void __iomem	*cm2;
> > > +	unsigned long	uart1_phys;
> > > +	unsigned long	uart2_phys;
> > > +	unsigned long	uart3_phys;
> > > +	unsigned long	uart4_phys;
> > Considering they are register base address, can
> > these be declared as "void __iomem" instead of "unsigned long"
> 
> These are physical addresses instead of virtual addresses.
> They get ioremapped in mach-omap[12]/serial.c. So they should
> not be void __iomem * in omap_globals.
Yep. I see your point.  
> BTW, we should eventually change everything in omap_globals
> to be physical addresses.
We did some work for OMAP4 to move most of the things to ioremap
istead of those hardcoded macros. 
Let me know when you want to do this clean up. We can do this together.

Regards
Santosh

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 1/4] omap: Clean the serial port defines
@ 2010-01-16 19:33         ` Shilimkar, Santosh
  0 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16 19:33 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: Tony Lindgren [mailto:tony at atomide.com] 
> Sent: Sunday, January 17, 2010 12:56 AM
> To: Shilimkar, Santosh
> Cc: linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
> Subject: Re: [PATCH 1/4] omap: Clean the serial port defines
> 
> * Shilimkar, Santosh <santosh.shilimkar@ti.com> [100115 23:46]:
> > Thanks for the nice cleanup.
> 
> Thanks for testing :)
> 
> > <snip>
> > > --- a/arch/arm/plat-omap/include/plat/common.h
> > > +++ b/arch/arm/plat-omap/include/plat/common.h
> > > @@ -47,6 +47,10 @@ struct omap_globals {
> > >  	void __iomem	*prm;		/* Power and Reset Management */
> > >  	void __iomem	*cm;		/* Clock Management */
> > >  	void __iomem	*cm2;
> > > +	unsigned long	uart1_phys;
> > > +	unsigned long	uart2_phys;
> > > +	unsigned long	uart3_phys;
> > > +	unsigned long	uart4_phys;
> > Considering they are register base address, can
> > these be declared as "void __iomem" instead of "unsigned long"
> 
> These are physical addresses instead of virtual addresses.
> They get ioremapped in mach-omap[12]/serial.c. So they should
> not be void __iomem * in omap_globals.
Yep. I see your point.  
> BTW, we should eventually change everything in omap_globals
> to be physical addresses.
We did some work for OMAP4 to move most of the things to ioremap
istead of those hardcoded macros. 
Let me know when you want to do this clean up. We can do this together.

Regards
Santosh

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16 19:20       ` Tony Lindgren
@ 2010-01-16 19:34         ` Shilimkar, Santosh
  -1 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16 19:34 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

> -----Original Message-----
> From: Tony Lindgren [mailto:tony@atomide.com] 
> Sent: Sunday, January 17, 2010 12:51 AM
> To: Shilimkar, Santosh
> Cc: linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
> Subject: Re: [PATCH 2/4] omap: Make uncompress code and 
> DEBUG_LL code generic
> 
> * Shilimkar, Santosh <santosh.shilimkar@ti.com> [100116 03:02]:
> 
> <snip>
> 
> > Can you please add add OMAP4 UART3 case as well here using 
> > "OMAP4UART3". 
> 
> Sure.
>  
> > Attached patch fixes UART3 support for OMAP4 on top of your 
> patches. Tested 
> > this on OMAP4430 SDP. You can fold this patch if you like
> 
> Thanks will test. And thanks for testing. Note that once the
> issues Russell pointed out are solved, we should also easily
> be able to support the external uart on Zoom boards for
> DEBUG_LL.
Cool. 

Regards
Santosh

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-16 19:34         ` Shilimkar, Santosh
  0 siblings, 0 replies; 76+ messages in thread
From: Shilimkar, Santosh @ 2010-01-16 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: Tony Lindgren [mailto:tony at atomide.com] 
> Sent: Sunday, January 17, 2010 12:51 AM
> To: Shilimkar, Santosh
> Cc: linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
> Subject: Re: [PATCH 2/4] omap: Make uncompress code and 
> DEBUG_LL code generic
> 
> * Shilimkar, Santosh <santosh.shilimkar@ti.com> [100116 03:02]:
> 
> <snip>
> 
> > Can you please add add OMAP4 UART3 case as well here using 
> > "OMAP4UART3". 
> 
> Sure.
>  
> > Attached patch fixes UART3 support for OMAP4 on top of your 
> patches. Tested 
> > this on OMAP4430 SDP. You can fold this patch if you like
> 
> Thanks will test. And thanks for testing. Note that once the
> issues Russell pointed out are solved, we should also easily
> be able to support the external uart on Zoom boards for
> DEBUG_LL.
Cool. 

Regards
Santosh

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16 19:33         ` Russell King - ARM Linux
@ 2010-01-16 20:00           ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 20:00 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-arm-kernel, linux-omap

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
> On Sat, Jan 16, 2010 at 11:18:20AM -0800, Tony Lindgren wrote:
> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
> > > On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> > > > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > index 23e4724..0174858 100644
> > > > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > @@ -15,18 +15,71 @@
> > > >  
> > > >  #include <plat/serial.h>
> > > >  
> > > > +omap_uart_phys:	.word	0x0
> > > > +omap_uart_virt:	.word	0x0
> > > 
> > > I assume that you have no plans for XIP kernel support on OMAP, since
> > > these will be placed in the .text section, and is therefore read-only
> > > on XIP kernels.
> > 
> > Did not think of that.. Maybe some addruart_premable solution here would.
> > Or adding \tmp register for addruart and just do the detection for each
> > character.
> 
> How does doing it per-character help?  The code is:
> 
> ENTRY(printascii)
>                 addruart r3
>                 b       2f
> 1:              waituart r2, r3
>                 senduart r1, r3
>                 busyuart r2, r3
>                 teq     r1, #'\n'
>                 moveq   r1, #'\r'
>                 beq     1b
> 2:              teq     r0, #0
>                 ldrneb  r1, [r0], #1
>                 teqne   r1, #0
>                 bne     1b
>                 mov     pc, lr
> 
> Your wait/send/busy macros are just using the already provided base
> address which comes via r3 from addruart.  That much is fine.
> 
> I'm at a loss to understand why you think moving the address-getting
> functionality out of addruart into the individual wait/send/busy
> macros is going to help in any way.

Sorry, I meant doing the detection each time addruart is run, not
for each character.
 
> Why not do something like this:
> 
> 		.pushsection .data
> omap_uart_phys:	.word 0
> omap_uart_virt:	.word 0
> 		.popsection
> 
> 		.macro addruart, rx
> ...		
> +               ldreq   \rx, =omap_uart_phys    @ physical base address
> +               ldrne   \rx, =omap_uart_virt    @ virtual base
> 		ldr	\rx, [\rx]
> +               cmp     \rx, #0                 @ is port configured?
> +               bne     99f                     @ already configured
> ...
> 
> ?

Sounds good to me. Will play with them and post refreshed patches.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-16 20:00           ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 20:00 UTC (permalink / raw)
  To: linux-arm-kernel

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
> On Sat, Jan 16, 2010 at 11:18:20AM -0800, Tony Lindgren wrote:
> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
> > > On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> > > > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > index 23e4724..0174858 100644
> > > > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > @@ -15,18 +15,71 @@
> > > >  
> > > >  #include <plat/serial.h>
> > > >  
> > > > +omap_uart_phys:	.word	0x0
> > > > +omap_uart_virt:	.word	0x0
> > > 
> > > I assume that you have no plans for XIP kernel support on OMAP, since
> > > these will be placed in the .text section, and is therefore read-only
> > > on XIP kernels.
> > 
> > Did not think of that.. Maybe some addruart_premable solution here would.
> > Or adding \tmp register for addruart and just do the detection for each
> > character.
> 
> How does doing it per-character help?  The code is:
> 
> ENTRY(printascii)
>                 addruart r3
>                 b       2f
> 1:              waituart r2, r3
>                 senduart r1, r3
>                 busyuart r2, r3
>                 teq     r1, #'\n'
>                 moveq   r1, #'\r'
>                 beq     1b
> 2:              teq     r0, #0
>                 ldrneb  r1, [r0], #1
>                 teqne   r1, #0
>                 bne     1b
>                 mov     pc, lr
> 
> Your wait/send/busy macros are just using the already provided base
> address which comes via r3 from addruart.  That much is fine.
> 
> I'm at a loss to understand why you think moving the address-getting
> functionality out of addruart into the individual wait/send/busy
> macros is going to help in any way.

Sorry, I meant doing the detection each time addruart is run, not
for each character.
 
> Why not do something like this:
> 
> 		.pushsection .data
> omap_uart_phys:	.word 0
> omap_uart_virt:	.word 0
> 		.popsection
> 
> 		.macro addruart, rx
> ...		
> +               ldreq   \rx, =omap_uart_phys    @ physical base address
> +               ldrne   \rx, =omap_uart_virt    @ virtual base
> 		ldr	\rx, [\rx]
> +               cmp     \rx, #0                 @ is port configured?
> +               bne     99f                     @ already configured
> ...
> 
> ?

Sounds good to me. Will play with them and post refreshed patches.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 1/4] omap: Clean the serial port defines
  2010-01-16 19:33         ` Shilimkar, Santosh
@ 2010-01-16 20:03           ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 20:03 UTC (permalink / raw)
  To: Shilimkar, Santosh; +Cc: linux-arm-kernel, linux-omap

* Shilimkar, Santosh <santosh.shilimkar@ti.com> [100116 11:31]:
> > -----Original Message-----
> > From: Tony Lindgren [mailto:tony@atomide.com] 
> > Sent: Sunday, January 17, 2010 12:56 AM
> > To: Shilimkar, Santosh
> > Cc: linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
> > Subject: Re: [PATCH 1/4] omap: Clean the serial port defines
> > 
> > * Shilimkar, Santosh <santosh.shilimkar@ti.com> [100115 23:46]:
> > > Thanks for the nice cleanup.
> > 
> > Thanks for testing :)
> > 
> > > <snip>
> > > > --- a/arch/arm/plat-omap/include/plat/common.h
> > > > +++ b/arch/arm/plat-omap/include/plat/common.h
> > > > @@ -47,6 +47,10 @@ struct omap_globals {
> > > >  	void __iomem	*prm;		/* Power and Reset Management */
> > > >  	void __iomem	*cm;		/* Clock Management */
> > > >  	void __iomem	*cm2;
> > > > +	unsigned long	uart1_phys;
> > > > +	unsigned long	uart2_phys;
> > > > +	unsigned long	uart3_phys;
> > > > +	unsigned long	uart4_phys;
> > > Considering they are register base address, can
> > > these be declared as "void __iomem" instead of "unsigned long"
> > 
> > These are physical addresses instead of virtual addresses.
> > They get ioremapped in mach-omap[12]/serial.c. So they should
> > not be void __iomem * in omap_globals.
> Yep. I see your point.  
> > BTW, we should eventually change everything in omap_globals
> > to be physical addresses.
> We did some work for OMAP4 to move most of the things to ioremap
> istead of those hardcoded macros. 
> Let me know when you want to do this clean up. We can do this together.

Great, let's try get some more of that ready for the upcoming
merge window.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 1/4] omap: Clean the serial port defines
@ 2010-01-16 20:03           ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 20:03 UTC (permalink / raw)
  To: linux-arm-kernel

* Shilimkar, Santosh <santosh.shilimkar@ti.com> [100116 11:31]:
> > -----Original Message-----
> > From: Tony Lindgren [mailto:tony at atomide.com] 
> > Sent: Sunday, January 17, 2010 12:56 AM
> > To: Shilimkar, Santosh
> > Cc: linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
> > Subject: Re: [PATCH 1/4] omap: Clean the serial port defines
> > 
> > * Shilimkar, Santosh <santosh.shilimkar@ti.com> [100115 23:46]:
> > > Thanks for the nice cleanup.
> > 
> > Thanks for testing :)
> > 
> > > <snip>
> > > > --- a/arch/arm/plat-omap/include/plat/common.h
> > > > +++ b/arch/arm/plat-omap/include/plat/common.h
> > > > @@ -47,6 +47,10 @@ struct omap_globals {
> > > >  	void __iomem	*prm;		/* Power and Reset Management */
> > > >  	void __iomem	*cm;		/* Clock Management */
> > > >  	void __iomem	*cm2;
> > > > +	unsigned long	uart1_phys;
> > > > +	unsigned long	uart2_phys;
> > > > +	unsigned long	uart3_phys;
> > > > +	unsigned long	uart4_phys;
> > > Considering they are register base address, can
> > > these be declared as "void __iomem" instead of "unsigned long"
> > 
> > These are physical addresses instead of virtual addresses.
> > They get ioremapped in mach-omap[12]/serial.c. So they should
> > not be void __iomem * in omap_globals.
> Yep. I see your point.  
> > BTW, we should eventually change everything in omap_globals
> > to be physical addresses.
> We did some work for OMAP4 to move most of the things to ioremap
> istead of those hardcoded macros. 
> Let me know when you want to do this clean up. We can do this together.

Great, let's try get some more of that ready for the upcoming
merge window.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 0/4] omap multiboot improvments for merge window after 2.6.34
  2010-01-16  1:35 ` Tony Lindgren
@ 2010-01-16 20:15   ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 20:15 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

* Tony Lindgren <tony@atomide.com> [100115 17:32]:
> Hi all,
> 
> Here are some multiboot improvments for review. These patches
> are intended for the 2.6.34 merge window.
> 
> Comments and testing would be nice, I've tested them so far
> on osk, 770, n800, rx51 and overo.

Attached is also an experimental patch to compile in 2420 and 34xx
and the .config I used.

It still fails early during the boot in dmtimer_init, so it's
just for reference in case anybody wants to play with it.

Note that we still have a problem compiling in 2420 and 2430
because of the different clock bases.

Cheers,

Tony

[-- Attachment #2: multiboot-fixes.patch --]
[-- Type: text/x-diff, Size: 9374 bytes --]

>From 57637b81fbfe43959ebc132250b13fae00da838a Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Fri, 15 Jan 2010 18:05:48 -0800
Subject: [PATCH] omap: Multiboot compile fixes to compile in 24xx and 34xx

Allows compiling in 24xx and 34xx. Not yet ready for merging,
some things need to be done nicer.

Currently booting still fails early in omap_dm_timer_init.

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b32678b..c48b3f4 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -26,6 +26,10 @@ obj-$(CONFIG_ARCH_OMAP2420)		+= sram242x.o
 obj-$(CONFIG_ARCH_OMAP2430)		+= sram243x.o
 obj-$(CONFIG_ARCH_OMAP3)		+= sram34xx.o
 
+AFLAGS_sram242x.o			:=-Wa,-march=armv6
+AFLAGS_sram243x.o			:=-Wa,-march=armv6
+AFLAGS_sram34xx.o			:=-Wa,-march=armv7-a
+
 # Pin multiplexing
 obj-$(CONFIG_ARCH_OMAP3)		+= mux34xx.o
 
@@ -39,6 +43,10 @@ obj-$(CONFIG_ARCH_OMAP2)		+= pm24xx.o
 obj-$(CONFIG_ARCH_OMAP24XX)		+= sleep24xx.o
 obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o cpuidle34xx.o
 obj-$(CONFIG_PM_DEBUG)			+= pm-debug.o
+
+AFLAGS_sleep24xx.o			:=-Wa,-march=armv6
+AFLAGS_sleep34xx.o			:=-Wa,-march=armv7-a
+
 endif
 
 # PRCM
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 759c72a..839aca4 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -1092,3 +1092,29 @@ void omap2_clk_disable_unused(struct clk *clk)
 		pwrdm_clkdm_state_switch(clk->clkdm);
 }
 #endif
+
+int __init omap2_clk_init(void)
+{
+	if (cpu_is_omap24xx())
+		return omap2xxx_clk_init();
+	else if (cpu_is_omap34xx())
+		return omap3_clk_init();
+	else if (cpu_is_omap44xx())
+		return omap4_clk_init();
+	else
+		WARN_ON(1);
+
+	return -ENODEV;
+}
+
+void omap2_clk_prepare_for_reboot(void)
+{
+	if (cpu_is_omap24xx())
+		omap2xxx_clk_prepare_for_reboot();
+	else if (cpu_is_omap34xx())
+		omap3_clk_prepare_for_reboot();
+	else if (cpu_is_omap44xx())
+		omap3_clk_prepare_for_reboot();
+	else
+		BUG();
+}
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 93c48df..61b9c2b 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -48,6 +48,10 @@
 #define DPLL_LOCKED		0x7
 
 int omap2_clk_init(void);
+int omap2xxx_clk_init(void);
+int omap3_clk_init(void);
+int omap4_clk_init(void);
+
 int omap2_clk_enable(struct clk *clk);
 void omap2_clk_disable(struct clk *clk);
 long omap2_clk_round_rate(struct clk *clk, unsigned long rate);
@@ -84,7 +88,12 @@ int omap2_clksel_set_rate(struct clk *clk, unsigned long rate);
 u32 omap2_get_dpll_rate(struct clk *clk);
 void omap2_init_dpll_parent(struct clk *clk);
 int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name);
+
 void omap2_clk_prepare_for_reboot(void);
+void omap2xxx_clk_prepare_for_reboot(void);
+void omap3_clk_prepare_for_reboot(void);
+void omap4_clk_prepare_for_reboot(void);
+
 int omap2_dflt_clk_enable(struct clk *clk);
 void omap2_dflt_clk_disable(struct clk *clk);
 void omap2_clk_dflt_find_companion(struct clk *clk, void __iomem **other_reg,
@@ -97,7 +106,10 @@ extern u8 cpu_mask;
 extern const struct clkops clkops_omap2_dflt_wait;
 extern const struct clkops clkops_omap2_dflt;
 
-extern struct clk_functions omap2_clk_functions;
+extern struct clk_functions omap2xxx_clk_functions;
+extern struct clk_functions omap3_clk_functions;
+extern struct clk_functions omap4_clk_functions;
+
 extern struct clk *vclk, *sclk;
 
 extern const struct clksel_rate gpt_32k_rates[];
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c
index 5420356..43e7404 100644
--- a/arch/arm/mach-omap2/clock2xxx.c
+++ b/arch/arm/mach-omap2/clock2xxx.c
@@ -523,7 +523,7 @@ void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
 
 #endif
 
-struct clk_functions omap2_clk_functions = {
+struct clk_functions omap2xxx_clk_functions = {
 	.clk_enable		= omap2_clk_enable,
 	.clk_disable		= omap2_clk_disable,
 	.clk_round_rate		= omap2_clk_round_rate,
@@ -578,7 +578,7 @@ unsigned long omap2_sys_clk_recalc(struct clk *clk)
 /*
  * Set clocks for bypass mode for reboot to work.
  */
-void omap2_clk_prepare_for_reboot(void)
+void omap2xxx_clk_prepare_for_reboot(void)
 {
 	u32 rate;
 
diff --git a/arch/arm/mach-omap2/clock2xxx_data.c b/arch/arm/mach-omap2/clock2xxx_data.c
index 97dc7cf..21da56e 100644
--- a/arch/arm/mach-omap2/clock2xxx_data.c
+++ b/arch/arm/mach-omap2/clock2xxx_data.c
@@ -2238,7 +2238,7 @@ static struct omap_clk omap24xx_clks[] = {
  * init code
  */
 
-int __init omap2_clk_init(void)
+int __init omap2xxx_clk_init(void)
 {
 	const struct prcm_config *prcm;
 	struct omap_clk *c;
@@ -2257,7 +2257,7 @@ int __init omap2_clk_init(void)
 		rate_table = omap2430_rate_table;
 	}
 
-	clk_init(&omap2_clk_functions);
+	clk_init(&omap2xxx_clk_functions);
 
 	for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
 		clk_preinit(c->lk.clk);
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index d4217b9..f485a89 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -258,7 +258,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
  */
 #if defined(CONFIG_ARCH_OMAP3)
 
-struct clk_functions omap2_clk_functions = {
+struct clk_functions omap3_clk_functions = {
 	.clk_enable		= omap2_clk_enable,
 	.clk_disable		= omap2_clk_disable,
 	.clk_round_rate		= omap2_clk_round_rate,
@@ -270,7 +270,7 @@ struct clk_functions omap2_clk_functions = {
 /*
  * Set clocks for bypass mode for reboot to work.
  */
-void omap2_clk_prepare_for_reboot(void)
+void omap3_clk_prepare_for_reboot(void)
 {
 	/* REVISIT: Not ready for 343x */
 #if 0
diff --git a/arch/arm/mach-omap2/clock34xx_data.c b/arch/arm/mach-omap2/clock34xx_data.c
index c6031d7..d1fe99b 100644
--- a/arch/arm/mach-omap2/clock34xx_data.c
+++ b/arch/arm/mach-omap2/clock34xx_data.c
@@ -3215,7 +3215,7 @@ static struct omap_clk omap34xx_clks[] = {
 };
 
 
-int __init omap2_clk_init(void)
+int __init omap3_clk_init(void)
 {
 	/* struct prcm_config *prcm; */
 	struct omap_clk *c;
@@ -3239,7 +3239,7 @@ int __init omap2_clk_init(void)
 		}
 	}
 
-	clk_init(&omap2_clk_functions);
+	clk_init(&omap3_clk_functions);
 
 	for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++)
 		clk_preinit(c->lk.clk);
diff --git a/arch/arm/mach-omap2/clock44xx.c b/arch/arm/mach-omap2/clock44xx.c
index e370868..ea28a8f 100644
--- a/arch/arm/mach-omap2/clock44xx.c
+++ b/arch/arm/mach-omap2/clock44xx.c
@@ -13,7 +13,7 @@
 #include <linux/errno.h>
 #include "clock.h"
 
-struct clk_functions omap2_clk_functions = {
+struct clk_functions omap4_clk_functions = {
 	.clk_enable		= omap2_clk_enable,
 	.clk_disable		= omap2_clk_disable,
 	.clk_round_rate		= omap2_clk_round_rate,
@@ -27,7 +27,7 @@ const struct clkops clkops_noncore_dpll_ops = {
 	.disable	= &omap3_noncore_dpll_disable,
 };
 
-void omap2_clk_prepare_for_reboot(void)
+void omap4_clk_prepare_for_reboot(void)
 {
 	return;
 }
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 2210e22..956810d 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -2726,7 +2726,7 @@ static struct omap_clk omap44xx_clks[] = {
 	CLK(NULL,	"utmi_p2_gfclk_ck",		&utmi_p2_gfclk_ck,	CK_443X),
 };
 
-int __init omap2_clk_init(void)
+int __init omap4_clk_init(void)
 {
 	/* struct prcm_config *prcm; */
 	struct omap_clk *c;
@@ -2738,7 +2738,7 @@ int __init omap2_clk_init(void)
 		cpu_clkflg = CK_443X;
 	}
 
-	clk_init(&omap2_clk_functions);
+	clk_init(&omap4_clk_functions);
 
 	for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks);
 									  c++)
diff --git a/arch/arm/mach-omap2/opp2xxx.h b/arch/arm/mach-omap2/opp2xxx.h
index ed6df04..38b7305 100644
--- a/arch/arm/mach-omap2/opp2xxx.h
+++ b/arch/arm/mach-omap2/opp2xxx.h
@@ -417,7 +417,12 @@ struct prcm_config {
 
 
 extern const struct prcm_config omap2420_rate_table[];
+
+#ifdef CONFIG_ARCH_OMAP2430
 extern const struct prcm_config omap2430_rate_table[];
+#else
+#define omap2430_rate_table	NULL
+#endif
 extern const struct prcm_config *rate_table;
 extern const struct prcm_config *curr_prcm_set;
 
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 484d6a9..ae951a9 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -5,6 +5,9 @@ menu "TI OMAP Implementations"
 config ARCH_OMAP_OTG
 	bool
 
+config ARCH_OMAP3
+	bool
+
 choice
 	prompt "OMAP System Type"
 	default ARCH_OMAP1
@@ -14,13 +17,10 @@ config ARCH_OMAP1
 	select COMMON_CLKDEV
 
 config ARCH_OMAP2
-	bool "TI OMAP2"
+	bool "TI OMAP2 and OMAP3"
 	select CPU_V6
-	select COMMON_CLKDEV
-
-config ARCH_OMAP3
-	bool "TI OMAP3"
 	select CPU_V7
+	select ARCH_OMAP3
 	select COMMON_CLKDEV
 
 config ARCH_OMAP4
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index d17620c..14b1907 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1630,7 +1630,7 @@ static int gpio_2irq(struct gpio_chip *chip, unsigned offset)
 /*---------------------------------------------------------------------*/
 
 static int initialized;
-#if !(defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4))
+#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2)
 static struct clk * gpio_ick;
 #endif
 

[-- Attachment #3: config-omap-multiboot --]
[-- Type: text/plain, Size: 55036 bytes --]

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.33-rc4
# Fri Jan 15 18:04:18 2010
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_ARCH_HAS_CPUFREQ=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_OPROFILE_ARMV6=y
CONFIG_OPROFILE_ARM11_CORE=y
CONFIG_OPROFILE_ARMV7=y
CONFIG_VECTORS_BASE=0xffff0000
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
# CONFIG_POSIX_MQUEUE is not set
CONFIG_BSD_PROCESS_ACCT=y
# CONFIG_BSD_PROCESS_ACCT_V3 is not set
# CONFIG_TASKSTATS is not set
# CONFIG_AUDIT is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_TREE_PREEMPT_RCU is not set
# CONFIG_TINY_RCU is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_FANOUT=32
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_USER_SCHED=y
# CONFIG_CGROUP_SCHED is not set
# CONFIG_CGROUPS is not set
# CONFIG_SYSFS_DEPRECATED_V2 is not set
# CONFIG_RELAY is not set
# CONFIG_NAMESPACES is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_LZO is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_EMBEDDED=y
CONFIG_UID16=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
# CONFIG_ELF_CORE is not set
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y

#
# Kernel Performance Events And Counters
#
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_OPROFILE=y
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_CLK=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
# CONFIG_SLOW_WORK is not set
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_BLOCK=y
CONFIG_LBDAF=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_BLK_DEV_INTEGRITY is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
# CONFIG_INLINE_SPIN_TRYLOCK is not set
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK is not set
# CONFIG_INLINE_SPIN_LOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
# CONFIG_INLINE_SPIN_UNLOCK is not set
# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_READ_TRYLOCK is not set
# CONFIG_INLINE_READ_LOCK is not set
# CONFIG_INLINE_READ_LOCK_BH is not set
# CONFIG_INLINE_READ_LOCK_IRQ is not set
# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
# CONFIG_INLINE_READ_UNLOCK is not set
# CONFIG_INLINE_READ_UNLOCK_BH is not set
# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_WRITE_TRYLOCK is not set
# CONFIG_INLINE_WRITE_LOCK is not set
# CONFIG_INLINE_WRITE_LOCK_BH is not set
# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
# CONFIG_INLINE_WRITE_UNLOCK is not set
# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
# CONFIG_MUTEX_SPIN_ON_OWNER is not set
CONFIG_FREEZER=y

#
# System Type
#
CONFIG_MMU=y
# CONFIG_ARCH_AAEC2000 is not set
# CONFIG_ARCH_INTEGRATOR is not set
# CONFIG_ARCH_REALVIEW is not set
# CONFIG_ARCH_VERSATILE is not set
# CONFIG_ARCH_AT91 is not set
# CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_GEMINI is not set
# CONFIG_ARCH_EBSA110 is not set
# CONFIG_ARCH_EP93XX is not set
# CONFIG_ARCH_FOOTBRIDGE is not set
# CONFIG_ARCH_MXC is not set
# CONFIG_ARCH_STMP3XXX is not set
# CONFIG_ARCH_NETX is not set
# CONFIG_ARCH_H720X is not set
# CONFIG_ARCH_NOMADIK is not set
# CONFIG_ARCH_IOP13XX is not set
# CONFIG_ARCH_IOP32X is not set
# CONFIG_ARCH_IOP33X is not set
# CONFIG_ARCH_IXP23XX is not set
# CONFIG_ARCH_IXP2000 is not set
# CONFIG_ARCH_IXP4XX is not set
# CONFIG_ARCH_L7200 is not set
# CONFIG_ARCH_DOVE is not set
# CONFIG_ARCH_KIRKWOOD is not set
# CONFIG_ARCH_LOKI is not set
# CONFIG_ARCH_MV78XX0 is not set
# CONFIG_ARCH_ORION5X is not set
# CONFIG_ARCH_MMP is not set
# CONFIG_ARCH_KS8695 is not set
# CONFIG_ARCH_NS9XXX is not set
# CONFIG_ARCH_W90X900 is not set
# CONFIG_ARCH_PNX4008 is not set
# CONFIG_ARCH_PXA is not set
# CONFIG_ARCH_MSM is not set
# CONFIG_ARCH_RPC is not set
# CONFIG_ARCH_SA1100 is not set
# CONFIG_ARCH_S3C2410 is not set
# CONFIG_ARCH_S3C64XX is not set
# CONFIG_ARCH_S5PC1XX is not set
# CONFIG_ARCH_SHARK is not set
# CONFIG_ARCH_LH7A40X is not set
# CONFIG_ARCH_U300 is not set
# CONFIG_ARCH_DAVINCI is not set
CONFIG_ARCH_OMAP=y
# CONFIG_ARCH_BCMRING is not set
# CONFIG_ARCH_U8500 is not set

#
# TI OMAP Implementations
#
CONFIG_ARCH_OMAP_OTG=y
CONFIG_ARCH_OMAP3=y
# CONFIG_ARCH_OMAP1 is not set
CONFIG_ARCH_OMAP2=y
# CONFIG_ARCH_OMAP4 is not set

#
# OMAP Feature Selections
#
CONFIG_OMAP_RESET_CLOCKS=y
CONFIG_OMAP_MUX=y
CONFIG_OMAP_MUX_DEBUG=y
CONFIG_OMAP_MUX_WARNINGS=y
CONFIG_OMAP_MCBSP=y
# CONFIG_OMAP_MBOX_FWK is not set
# CONFIG_OMAP_MPU_TIMER is not set
CONFIG_OMAP_32K_TIMER=y
CONFIG_OMAP_32K_TIMER_HZ=128
CONFIG_OMAP_DM_TIMER=y
# CONFIG_OMAP_PM_NONE is not set
CONFIG_OMAP_PM_NOOP=y
# CONFIG_MACH_OMAP_GENERIC is not set

#
# OMAP Core Type
#
CONFIG_ARCH_OMAP24XX=y
CONFIG_ARCH_OMAP2420=y
# CONFIG_ARCH_OMAP2430 is not set
CONFIG_ARCH_OMAP34XX=y
CONFIG_ARCH_OMAP3430=y
CONFIG_OMAP_PACKAGE_CBB=y
CONFIG_OMAP_PACKAGE_CBP=y

#
# OMAP Board Type
#
CONFIG_MACH_OMAP2_TUSB6010=y
# CONFIG_MACH_OMAP_H4 is not set
# CONFIG_MACH_OMAP_APOLLON is not set
# CONFIG_MACH_OMAP_2430SDP is not set
CONFIG_MACH_OMAP3_BEAGLE=y
CONFIG_MACH_OMAP_LDP=y
CONFIG_MACH_OVERO=y
# CONFIG_MACH_OMAP3EVM is not set
# CONFIG_MACH_OMAP3517EVM is not set
CONFIG_MACH_OMAP3_PANDORA=y
# CONFIG_MACH_OMAP3_TOUCHBOOK is not set
CONFIG_MACH_OMAP_3430SDP=y
CONFIG_MACH_NOKIA_N800=y
CONFIG_MACH_NOKIA_N810=y
CONFIG_MACH_NOKIA_N810_WIMAX=y
CONFIG_MACH_NOKIA_N8X0=y
CONFIG_MACH_NOKIA_RX51=y
# CONFIG_MACH_OMAP_ZOOM2 is not set
CONFIG_MACH_OMAP_ZOOM3=y
# CONFIG_MACH_CM_T35 is not set
# CONFIG_MACH_IGEP0020 is not set
# CONFIG_MACH_OMAP_3630SDP is not set
# CONFIG_OMAP3_EMU is not set
# CONFIG_OMAP3_SDRC_AC_TIMING is not set

#
# Processor Type
#
CONFIG_CPU_V6=y
CONFIG_CPU_32v6K=y
CONFIG_CPU_V7=y
CONFIG_CPU_32v6=y
CONFIG_CPU_32v7=y
CONFIG_CPU_ABRT_EV6=y
CONFIG_CPU_ABRT_EV7=y
CONFIG_CPU_PABRT_V6=y
CONFIG_CPU_PABRT_V7=y
CONFIG_CPU_CACHE_V6=y
CONFIG_CPU_CACHE_V7=y
CONFIG_CPU_CACHE_VIPT=y
CONFIG_CPU_COPY_V6=y
CONFIG_CPU_TLB_V6=y
CONFIG_CPU_TLB_V7=y
CONFIG_CPU_HAS_ASID=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y

#
# Processor Features
#
CONFIG_ARM_THUMB=y
CONFIG_ARM_THUMBEE=y
# CONFIG_CPU_ICACHE_DISABLE is not set
# CONFIG_CPU_DCACHE_DISABLE is not set
# CONFIG_CPU_BPREDICT_DISABLE is not set
CONFIG_HAS_TLS_REG=y
CONFIG_ARM_L1_CACHE_SHIFT=6
# CONFIG_ARM_ERRATA_411920 is not set
# CONFIG_ARM_ERRATA_430973 is not set
# CONFIG_ARM_ERRATA_458693 is not set
# CONFIG_ARM_ERRATA_460075 is not set
CONFIG_COMMON_CLKDEV=y

#
# Bus support
#
# CONFIG_PCI_SYSCALL is not set
# CONFIG_ARCH_SUPPORTS_MSI is not set
# CONFIG_PCCARD is not set

#
# Kernel Features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_VMSPLIT_3G=y
# CONFIG_VMSPLIT_2G is not set
# CONFIG_VMSPLIT_1G is not set
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
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
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=999999
# CONFIG_PHYS_ADDR_T_64BIT is not set
CONFIG_ZONE_DMA_FLAG=0
CONFIG_VIRT_TO_BUS=y
# CONFIG_KSM is not set
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_LEDS=y
CONFIG_ALIGNMENT_TRAP=y
# CONFIG_UACCESS_WITH_MEMCPY is not set

#
# Boot options
#
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_CMDLINE="console=tty0 console=ttyS2,115200 root=/dev/mmcblk0p4 rootwait debug earlyprintk"
# CONFIG_XIP_KERNEL is not set
CONFIG_KEXEC=y
CONFIG_ATAGS_PROC=y

#
# CPU Power Management
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y

#
# Floating point emulation
#

#
# At least one emulation must be selected
#
CONFIG_FPE_NWFPE=y
# CONFIG_FPE_NWFPE_XP is not set
# CONFIG_FPE_FASTFPE is not set
CONFIG_VFP=y
CONFIG_VFPv3=y
CONFIG_NEON=y

#
# Userspace binary formats
#
CONFIG_BINFMT_ELF=y
CONFIG_HAVE_AOUT=y
CONFIG_BINFMT_AOUT=m
CONFIG_BINFMT_MISC=y

#
# Power management options
#
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
# CONFIG_APM_EMULATION is not set
# CONFIG_PM_RUNTIME is not set
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_UNIX=y
CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
# CONFIG_XFRM_STATISTICS is not set
CONFIG_NET_KEY=y
# CONFIG_NET_KEY_MIGRATE is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_FIB_HASH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
CONFIG_INET_TUNNEL=m
CONFIG_INET_XFRM_MODE_TRANSPORT=y
CONFIG_INET_XFRM_MODE_TUNNEL=y
CONFIG_INET_XFRM_MODE_BEET=y
# CONFIG_INET_LRO is not set
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
CONFIG_IPV6=m
# CONFIG_IPV6_PRIVACY is not set
# CONFIG_IPV6_ROUTER_PREF is not set
# CONFIG_IPV6_OPTIMISTIC_DAD is not set
# CONFIG_INET6_AH is not set
# CONFIG_INET6_ESP is not set
# CONFIG_INET6_IPCOMP is not set
# CONFIG_IPV6_MIP6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set
CONFIG_INET6_XFRM_MODE_TRANSPORT=m
CONFIG_INET6_XFRM_MODE_TUNNEL=m
CONFIG_INET6_XFRM_MODE_BEET=m
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
CONFIG_IPV6_SIT=m
# CONFIG_IPV6_SIT_6RD is not set
CONFIG_IPV6_NDISC_NODETYPE=y
# CONFIG_IPV6_TUNNEL is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set
# CONFIG_IPV6_MROUTE is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_NET_DSA is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NET_DROP_MONITOR is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
CONFIG_BT=y
CONFIG_BT_L2CAP=y
CONFIG_BT_SCO=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y

#
# Bluetooth device drivers
#
# CONFIG_BT_HCIBTUSB is not set
# CONFIG_BT_HCIBTSDIO is not set
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
# CONFIG_BT_HCIUART_LL is not set
CONFIG_BT_HCIBCM203X=y
CONFIG_BT_HCIBPA10X=y
# CONFIG_BT_HCIBFUSB is not set
# CONFIG_BT_HCIVHCI is not set
# CONFIG_BT_MRVL is not set
# CONFIG_AF_RXRPC is not set
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
CONFIG_CFG80211=y
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_DEBUGFS is not set
CONFIG_WIRELESS_OLD_REGULATORY=y
CONFIG_CFG80211_WEXT=y
CONFIG_WIRELESS_EXT_SYSFS=y
CONFIG_LIB80211=y
CONFIG_LIB80211_CRYPT_WEP=m
CONFIG_LIB80211_CRYPT_CCMP=m
CONFIG_LIB80211_CRYPT_TKIP=m
# CONFIG_LIB80211_DEBUG is not set
CONFIG_MAC80211=y
CONFIG_MAC80211_RC_PID=y
# CONFIG_MAC80211_RC_MINSTREL is not set
CONFIG_MAC80211_RC_DEFAULT_PID=y
# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
CONFIG_MAC80211_RC_DEFAULT="pid"
# CONFIG_MAC80211_MESH is not set
CONFIG_MAC80211_LEDS=y
# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
# CONFIG_DEVTMPFS is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_CONNECTOR is not set
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_TESTS is not set
CONFIG_MTD_CONCAT=y
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
# CONFIG_MTD_AFS_PARTS is not set
# CONFIG_MTD_AR7_PARTS is not set

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
# CONFIG_MTD_OOPS is not set

#
# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PLATRAM is not set

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_DATAFLASH is not set
# CONFIG_MTD_M25P80 is not set
# CONFIG_MTD_SST25L is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
CONFIG_MTD_NAND=y
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
# CONFIG_MTD_NAND_ECC_SMC is not set
# CONFIG_MTD_NAND_MUSEUM_IDS is not set
# CONFIG_MTD_NAND_GPIO is not set
# CONFIG_MTD_NAND_OMAP2 is not set
CONFIG_MTD_NAND_IDS=y
# CONFIG_MTD_NAND_DISKONCHIP is not set
# CONFIG_MTD_NAND_NANDSIM is not set
# CONFIG_MTD_NAND_PLATFORM is not set
# CONFIG_MTD_ALAUDA is not set
CONFIG_MTD_ONENAND=y
# CONFIG_MTD_ONENAND_VERIFY_WRITE is not set
# CONFIG_MTD_ONENAND_GENERIC is not set
CONFIG_MTD_ONENAND_OMAP2=y
# CONFIG_MTD_ONENAND_OTP is not set
# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
# CONFIG_MTD_ONENAND_SIM is not set

#
# LPDDR flash memory drivers
#
# CONFIG_MTD_LPDDR is not set

#
# UBI - Unsorted block images
#
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_RESERVE=1
# CONFIG_MTD_UBI_GLUEBI is not set

#
# UBI debugging options
#
# CONFIG_MTD_UBI_DEBUG is not set
# CONFIG_PARPORT is not set
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_CRYPTOLOOP=m

#
# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
#
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=16384
# CONFIG_BLK_DEV_XIP is not set
CONFIG_CDROM_PKTCDVD=m
CONFIG_CDROM_PKTCDVD_BUFFERS=8
# CONFIG_CDROM_PKTCDVD_WCACHE is not set
# CONFIG_ATA_OVER_ETH is not set
# CONFIG_MG_DISK is not set
CONFIG_MISC_DEVICES=y
# CONFIG_AD525X_DPOT is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_ISL29003 is not set
# CONFIG_DS1682 is not set
# CONFIG_TI_DAC7512 is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_LEGACY is not set
# CONFIG_EEPROM_MAX6875 is not set
CONFIG_EEPROM_93CX6=m
# CONFIG_IWMC3200TOP is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set

#
# SCSI device support
#
CONFIG_RAID_ATTRS=m
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
CONFIG_CHR_DEV_SG=m
# CONFIG_CHR_DEV_SCH is not set
CONFIG_SCSI_MULTI_LUN=y
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set
# CONFIG_SCSI_SCAN_ASYNC is not set
CONFIG_SCSI_WAIT_SCAN=m

#
# SCSI Transports
#
# CONFIG_SCSI_SPI_ATTRS is not set
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
# CONFIG_SCSI_SRP_ATTRS is not set
CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_LIBFC is not set
# CONFIG_LIBFCOE is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_DH is not set
# CONFIG_SCSI_OSD_INITIATOR is not set
# CONFIG_ATA is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=m
CONFIG_MD_LINEAR=m
CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m
CONFIG_MD_RAID10=m
CONFIG_MD_RAID456=m
CONFIG_MD_RAID6_PQ=m
# CONFIG_ASYNC_RAID6_TEST is not set
CONFIG_MD_MULTIPATH=m
CONFIG_MD_FAULTY=m
CONFIG_BLK_DEV_DM=m
# CONFIG_DM_DEBUG is not set
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
CONFIG_DM_MIRROR=m
# CONFIG_DM_LOG_USERSPACE is not set
CONFIG_DM_ZERO=m
CONFIG_DM_MULTIPATH=m
# CONFIG_DM_MULTIPATH_QL is not set
# CONFIG_DM_MULTIPATH_ST is not set
CONFIG_DM_DELAY=m
# CONFIG_DM_UEVENT is not set
CONFIG_NETDEVICES=y
CONFIG_DUMMY=m
# CONFIG_BONDING is not set
# CONFIG_MACVLAN is not set
# CONFIG_EQUALIZER is not set
CONFIG_TUN=m
# CONFIG_VETH is not set
CONFIG_PHYLIB=y

#
# MII PHY device drivers
#
# CONFIG_MARVELL_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_QSEMI_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_VITESSE_PHY is not set
CONFIG_SMSC_PHY=y
# CONFIG_BROADCOM_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_REALTEK_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_STE10XP is not set
# CONFIG_LSI_ET1011C_PHY is not set
# CONFIG_FIXED_PHY is not set
# CONFIG_MDIO_BITBANG is not set
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
# CONFIG_AX88796 is not set
CONFIG_SMC91X=y
# CONFIG_DM9000 is not set
# CONFIG_ENC28J60 is not set
# CONFIG_ETHOC is not set
CONFIG_SMC911X=m
CONFIG_SMSC911X=m
# CONFIG_DNET is not set
# CONFIG_IBM_NEW_EMAC_ZMII is not set
# CONFIG_IBM_NEW_EMAC_RGMII is not set
# CONFIG_IBM_NEW_EMAC_TAH is not set
# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
# CONFIG_B44 is not set
# CONFIG_KS8842 is not set
# CONFIG_KS8851 is not set
# CONFIG_KS8851_MLL is not set
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
CONFIG_WLAN=y
# CONFIG_LIBERTAS_THINFIRM is not set
# CONFIG_AT76C50X_USB is not set
CONFIG_USB_ZD1201=m
# CONFIG_USB_NET_RNDIS_WLAN is not set
CONFIG_RTL8187=m
CONFIG_RTL8187_LEDS=y
# CONFIG_MAC80211_HWSIM is not set
# CONFIG_ATH_COMMON is not set
# CONFIG_B43 is not set
# CONFIG_B43LEGACY is not set
CONFIG_HOSTAP=m
CONFIG_HOSTAP_FIRMWARE=y
CONFIG_HOSTAP_FIRMWARE_NVRAM=y
# CONFIG_IWM is not set
CONFIG_LIBERTAS=y
CONFIG_LIBERTAS_USB=y
CONFIG_LIBERTAS_SDIO=y
# CONFIG_LIBERTAS_SPI is not set
CONFIG_LIBERTAS_DEBUG=y
CONFIG_P54_COMMON=m
CONFIG_P54_USB=m
# CONFIG_P54_SPI is not set
CONFIG_P54_LEDS=y
# CONFIG_RT2X00 is not set
CONFIG_WL12XX=y
CONFIG_WL1251=y
CONFIG_WL1251_SPI=y
# CONFIG_WL1251_SDIO is not set
# CONFIG_WL1271 is not set
# CONFIG_ZD1211RW is not set

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#

#
# USB Network Adapters
#
CONFIG_USB_CATC=m
CONFIG_USB_KAWETH=m
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_CDCETHER=y
# CONFIG_USB_NET_CDC_EEM is not set
CONFIG_USB_NET_DM9601=m
# CONFIG_USB_NET_SMSC95XX is not set
CONFIG_USB_NET_GL620A=m
CONFIG_USB_NET_NET1080=m
CONFIG_USB_NET_PLUSB=m
CONFIG_USB_NET_MCS7830=m
CONFIG_USB_NET_RNDIS_HOST=m
CONFIG_USB_NET_CDC_SUBSET=m
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=m
# CONFIG_USB_NET_INT51X1 is not set
# CONFIG_WAN is not set
CONFIG_PPP=m
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_MPPE=m
CONFIG_PPPOE=m
# CONFIG_PPPOL2TP is not set
# CONFIG_SLIP is not set
CONFIG_SLHC=m
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_ISDN is not set
# CONFIG_PHONE is not set

#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
# CONFIG_INPUT_POLLDEV is not set
# CONFIG_INPUT_SPARSEKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADP5588 is not set
# CONFIG_KEYBOARD_ATKBD is not set
# CONFIG_QT2160 is not set
# CONFIG_KEYBOARD_LKKBD is not set
CONFIG_KEYBOARD_GPIO=y
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_OMAP is not set
CONFIG_KEYBOARD_TWL4030=y
# CONFIG_KEYBOARD_XTKBD is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
# CONFIG_MOUSE_PS2_ELANTECH is not set
# CONFIG_MOUSE_PS2_SENTELIC is not set
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_APPLETOUCH is not set
# CONFIG_MOUSE_BCM5974 is not set
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_MOUSE_GPIO is not set
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_SERPORT=y
CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_DEVKMEM=y
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_MAX3100 is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
CONFIG_HW_RANDOM_OMAP=y
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_HELPER_AUTO=y

#
# I2C Hardware Bus support
#

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_DESIGNWARE is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
CONFIG_I2C_OMAP=y
# CONFIG_I2C_SIMTEC is not set

#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_TAOS_EVM is not set
# CONFIG_I2C_TINY_USB is not set

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_STUB is not set

#
# Miscellaneous I2C Chip support
#
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# CONFIG_I2C_DEBUG_CHIP is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_GPIO is not set
CONFIG_SPI_OMAP24XX=y
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_TLE62X0 is not set

#
# PPS support
#
# CONFIG_PPS is not set
CONFIG_ARCH_REQUIRE_GPIOLIB=y
CONFIG_GPIOLIB=y
CONFIG_DEBUG_GPIO=y
CONFIG_GPIO_SYSFS=y

#
# Memory mapped GPIO expanders:
#

#
# I2C GPIO expanders:
#
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCF857X is not set
CONFIG_GPIO_TWL4030=y
# CONFIG_GPIO_ADP5588 is not set

#
# PCI GPIO expanders:
#

#
# SPI GPIO expanders:
#
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MCP23S08 is not set
# CONFIG_GPIO_MC33880 is not set

#
# AC97 GPIO expanders:
#
# CONFIG_W1 is not set
CONFIG_POWER_SUPPLY=m
# CONFIG_POWER_SUPPLY_DEBUG is not set
# CONFIG_PDA_POWER is not set
# CONFIG_BATTERY_DS2760 is not set
# CONFIG_BATTERY_DS2782 is not set
# CONFIG_BATTERY_BQ27x00 is not set
# CONFIG_BATTERY_MAX17040 is not set
CONFIG_HWMON=y
# CONFIG_HWMON_VID is not set
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
# CONFIG_SENSORS_AD7414 is not set
# CONFIG_SENSORS_AD7418 is not set
# CONFIG_SENSORS_ADCXX is not set
# CONFIG_SENSORS_ADM1021 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1029 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7462 is not set
# CONFIG_SENSORS_ADT7470 is not set
# CONFIG_SENSORS_ADT7473 is not set
# CONFIG_SENSORS_ADT7475 is not set
# CONFIG_SENSORS_ATXP1 is not set
# CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_F71882FG is not set
# CONFIG_SENSORS_F75375S is not set
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM70 is not set
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
# CONFIG_SENSORS_LTC4215 is not set
# CONFIG_SENSORS_LTC4245 is not set
# CONFIG_SENSORS_LM95241 is not set
# CONFIG_SENSORS_MAX1111 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_SENSORS_SHT15 is not set
# CONFIG_SENSORS_DME1737 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_VT1211 is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_SENSORS_LIS3_SPI is not set
# CONFIG_SENSORS_LIS3_I2C is not set
# CONFIG_THERMAL is not set
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_NOWAYOUT=y

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_OMAP_WATCHDOG is not set
# CONFIG_TWL4030_WATCHDOG is not set

#
# USB-based Watchdog Cards
#
# CONFIG_USBPCWATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_ASIC3 is not set
# CONFIG_HTC_EGPIO is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_TPS65010 is not set
# CONFIG_MENELAUS is not set
CONFIG_TWL4030_CORE=y
CONFIG_TWL4030_POWER=y
CONFIG_TWL4030_CODEC=y
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_T7L66XB is not set
# CONFIG_MFD_TC6387XB is not set
# CONFIG_MFD_TC6393XB is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_MFD_WM8400 is not set
# CONFIG_MFD_WM831X is not set
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_PCF50633 is not set
# CONFIG_MFD_MC13783 is not set
# CONFIG_AB3100_CORE is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_MFD_88PM8607 is not set
# CONFIG_AB4500_CORE is not set
CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_BQ24022 is not set
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_MAX8660 is not set
CONFIG_REGULATOR_TWL4030=y
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_MEDIA_SUPPORT is not set

#
# Graphics support
#
# CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
CONFIG_FB=y
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB_DDC is not set
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
# CONFIG_FB_SYS_FILLRECT is not set
# CONFIG_FB_SYS_COPYAREA is not set
# CONFIG_FB_SYS_IMAGEBLIT is not set
# CONFIG_FB_FOREIGN_ENDIAN is not set
# CONFIG_FB_SYS_FOPS is not set
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
# CONFIG_FB_MODE_HELPERS is not set
# CONFIG_FB_TILEBLITTING is not set

#
# Frame buffer hardware drivers
#
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_TMIO is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_BROADSHEET is not set
# CONFIG_FB_OMAP_LCD_VGA is not set
CONFIG_FB_OMAP_BOOTLOADER_INIT=y
CONFIG_OMAP2_VRAM=y
CONFIG_OMAP2_VRFB=y
CONFIG_OMAP2_DSS=y
CONFIG_OMAP2_VRAM_SIZE=0
# CONFIG_OMAP2_DSS_DEBUG_SUPPORT is not set
# CONFIG_OMAP2_DSS_RFBI is not set
CONFIG_OMAP2_DSS_VENC=y
CONFIG_OMAP2_DSS_SDI=y
# CONFIG_OMAP2_DSS_DSI is not set
# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
CONFIG_FB_OMAP2=y
# CONFIG_FB_OMAP2_DEBUG_SUPPORT is not set
# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
CONFIG_FB_OMAP2_NUM_FBS=3

#
# OMAP2/3 Display Device Drivers
#
# CONFIG_PANEL_GENERIC is not set
# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set

#
# Display device support
#
CONFIG_DISPLAY_SUPPORT=y

#
# Display hardware drivers
#

#
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
# CONFIG_FONT_8x16 is not set
# CONFIG_FONT_6x11 is not set
# CONFIG_FONT_7x14 is not set
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
# CONFIG_FONT_MINI_4x6 is not set
# CONFIG_FONT_SUN8x16 is not set
# CONFIG_FONT_SUN12x22 is not set
# CONFIG_FONT_10x18 is not set
CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y
CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_HWDEP=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_JACK=y
CONFIG_SND_SEQUENCER=m
# CONFIG_SND_SEQ_DUMMY is not set
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
# CONFIG_SND_HRTIMER is not set
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_DEBUG=y
# CONFIG_SND_DEBUG_VERBOSE is not set
# CONFIG_SND_PCM_XRUN_DEBUG is not set
CONFIG_SND_RAWMIDI_SEQ=m
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_VIRMIDI is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
CONFIG_SND_ARM=y
CONFIG_SND_SPI=y
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_USB_CAIAQ=m
CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_SOC=y
CONFIG_SND_OMAP_SOC=y
CONFIG_SND_OMAP_SOC_MCBSP=y
# CONFIG_SND_OMAP_SOC_N810 is not set
# CONFIG_SND_OMAP_SOC_OVERO is not set
# CONFIG_SND_OMAP_SOC_SDP3430 is not set
CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=y
# CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE is not set
CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_ALL_CODECS is not set
CONFIG_SND_SOC_TWL4030=y
# CONFIG_SOUND_PRIME is not set
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
# CONFIG_HIDRAW is not set

#
# USB Input Devices
#
CONFIG_USB_HID=y
# CONFIG_HID_PID is not set
# CONFIG_USB_HIDDEV is not set

#
# Special HID drivers
#
CONFIG_HID_A4TECH=y
CONFIG_HID_APPLE=y
CONFIG_HID_BELKIN=y
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
CONFIG_HID_CYPRESS=y
# CONFIG_HID_DRAGONRISE is not set
CONFIG_HID_EZKEY=y
# CONFIG_HID_KYE is not set
CONFIG_HID_GYRATION=y
# CONFIG_HID_TWINHAN is not set
# CONFIG_HID_KENSINGTON is not set
CONFIG_HID_LOGITECH=y
# CONFIG_LOGITECH_FF is not set
# CONFIG_LOGIRUMBLEPAD2_FF is not set
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
# CONFIG_HID_NTRIG is not set
CONFIG_HID_PANTHERLORD=y
# CONFIG_PANTHERLORD_FF is not set
CONFIG_HID_PETALYNX=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SONY=y
CONFIG_HID_SUNPLUS=y
# CONFIG_HID_GREENASIA is not set
# CONFIG_HID_SMARTJOYPLUS is not set
# CONFIG_HID_TOPSEED is not set
# CONFIG_HID_THRUSTMASTER is not set
# CONFIG_HID_WACOM is not set
# CONFIG_HID_ZEROPLUS is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
CONFIG_USB_DEBUG=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_SUSPEND=y
CONFIG_USB_OTG=y
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_MON=y
# CONFIG_USB_WUSB is not set
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
# CONFIG_USB_EHCI_HCD is not set
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1760_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
# CONFIG_USB_HWA_HCD is not set
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_SOC=y

#
# OMAP 343x high speed USB support
#
# CONFIG_USB_MUSB_HOST is not set
# CONFIG_USB_MUSB_PERIPHERAL is not set
CONFIG_USB_MUSB_OTG=y
CONFIG_USB_GADGET_MUSB_HDRC=y
CONFIG_USB_MUSB_HDRC_HCD=y
CONFIG_MUSB_PIO_ONLY=y
# CONFIG_USB_MUSB_DEBUG is not set

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
CONFIG_USB_PRINTER=y
CONFIG_USB_WDM=y
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_DEBUG is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
# CONFIG_USB_STORAGE_ISD200 is not set
# CONFIG_USB_STORAGE_USBAT is not set
# CONFIG_USB_STORAGE_SDDR09 is not set
# CONFIG_USB_STORAGE_SDDR55 is not set
# CONFIG_USB_STORAGE_JUMPSHOT is not set
# CONFIG_USB_STORAGE_ALAUDA is not set
# CONFIG_USB_STORAGE_ONETOUCH is not set
# CONFIG_USB_STORAGE_KARMA is not set
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
# CONFIG_USB_LIBUSUAL is not set

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set

#
# USB port drivers
#
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_BERRY_CHARGE is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYPRESS_CY7C63 is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_FTDI_ELAN is not set
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_VST is not set
CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG is not set
# CONFIG_USB_GADGET_DEBUG_FILES is not set
# CONFIG_USB_GADGET_DEBUG_FS is not set
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_SELECTED=y
# CONFIG_USB_GADGET_AT91 is not set
# CONFIG_USB_GADGET_ATMEL_USBA is not set
# CONFIG_USB_GADGET_FSL_USB2 is not set
# CONFIG_USB_GADGET_LH7A40X is not set
# CONFIG_USB_GADGET_OMAP is not set
# CONFIG_USB_GADGET_PXA25X is not set
# CONFIG_USB_GADGET_R8A66597 is not set
# CONFIG_USB_GADGET_PXA27X is not set
# CONFIG_USB_GADGET_S3C_HSOTG is not set
# CONFIG_USB_GADGET_IMX is not set
# CONFIG_USB_GADGET_S3C2410 is not set
# CONFIG_USB_GADGET_M66592 is not set
# CONFIG_USB_GADGET_AMD5536UDC is not set
# CONFIG_USB_GADGET_FSL_QE is not set
# CONFIG_USB_GADGET_CI13XXX is not set
# CONFIG_USB_GADGET_NET2280 is not set
# CONFIG_USB_GADGET_GOKU is not set
# CONFIG_USB_GADGET_LANGWELL is not set
# CONFIG_USB_GADGET_DUMMY_HCD is not set
CONFIG_USB_GADGET_DUALSPEED=y
# CONFIG_USB_ZERO is not set
# CONFIG_USB_AUDIO is not set
CONFIG_USB_ETH=m
CONFIG_USB_ETH_RNDIS=y
# CONFIG_USB_ETH_EEM is not set
# CONFIG_USB_GADGETFS is not set
# CONFIG_USB_FILE_STORAGE is not set
# CONFIG_USB_MASS_STORAGE is not set
# CONFIG_USB_G_SERIAL is not set
# CONFIG_USB_MIDI_GADGET is not set
# CONFIG_USB_G_PRINTER is not set
# CONFIG_USB_CDC_COMPOSITE is not set
# CONFIG_USB_G_MULTI is not set

#
# OTG and related infrastructure
#
CONFIG_USB_OTG_UTILS=y
# CONFIG_USB_GPIO_VBUS is not set
# CONFIG_ISP1301_OMAP is not set
# CONFIG_USB_ULPI is not set
CONFIG_TWL4030_USB=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_UNSAFE_RESUME=y

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_SDIO_UART=y
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_OMAP is not set
CONFIG_MMC_OMAP_HS=y
# CONFIG_MMC_AT91 is not set
# CONFIG_MMC_ATMELMCI is not set
# CONFIG_MMC_SPI is not set
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y

#
# LED drivers
#
# CONFIG_LEDS_PCA9532 is not set
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_GPIO_PLATFORM=y
# CONFIG_LEDS_LP3944 is not set
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_REGULATOR is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_LT3593 is not set

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
# CONFIG_LEDS_TRIGGER_GPIO is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_ACCESSIBILITY is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
CONFIG_RTC_DRV_TWL4030=y
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_DS3234 is not set
# CONFIG_RTC_DRV_PCF2123 is not set

#
# Platform RTC drivers
#
# CONFIG_RTC_DRV_CMOS is not set
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set

#
# on-CPU RTC drivers
#
# CONFIG_DMADEVICES is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set

#
# TI VLYNQ
#
# CONFIG_STAGING is not set

#
# CBUS support
#
# CONFIG_CBUS is not set

#
# File systems
#
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
# CONFIG_EXT3_FS_XATTR is not set
# CONFIG_EXT4_FS is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_XFS_FS=m
# CONFIG_XFS_QUOTA is not set
# CONFIG_XFS_POSIX_ACL is not set
# CONFIG_XFS_RT is not set
# CONFIG_XFS_DEBUG is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_QUOTA=y
# CONFIG_QUOTA_NETLINK_INTERFACE is not set
CONFIG_PRINT_QUOTA_WARNING=y
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
CONFIG_FUSE_FS=m
# CONFIG_CUSE is not set

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y

#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_CONFIGFS_FS is not set
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_FS_POSIX_ACL=y
CONFIG_JFFS2_FS_SECURITY=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RTIME=y
CONFIG_JFFS2_RUBIN=y
# CONFIG_JFFS2_CMODE_NONE is not set
CONFIG_JFFS2_CMODE_PRIORITY=y
# CONFIG_JFFS2_CMODE_SIZE is not set
# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
CONFIG_UBIFS_FS=y
# CONFIG_UBIFS_FS_XATTR is not set
# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
# CONFIG_UBIFS_FS_DEBUG is not set
# CONFIG_CRAMFS is not set
# CONFIG_SQUASHFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_OMFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
CONFIG_NFS_V4=y
# CONFIG_NFS_V4_1 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=m
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_RPCSEC_GSS_SPKM3 is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
# CONFIG_ACORN_PARTITION is not set
# CONFIG_OSF_PARTITION is not set
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
# CONFIG_MAC_PARTITION is not set
CONFIG_MSDOS_PARTITION=y
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_MINIX_SUBPARTITION is not set
# CONFIG_SOLARIS_X86_PARTITION is not set
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
# CONFIG_ULTRIX_PARTITION is not set
# CONFIG_SUN_PARTITION is not set
# CONFIG_KARMA_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
# CONFIG_SYSV68_PARTITION is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set
# CONFIG_DLM is not set

#
# Kernel hacking
#
# CONFIG_PRINTK_TIME is not set
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=1024
CONFIG_MAGIC_SYSRQ=y
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
CONFIG_DETECT_SOFTLOCKUP=y
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
CONFIG_SCHED_DEBUG=y
CONFIG_SCHEDSTATS=y
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_DEBUG_ON is not set
# CONFIG_SLUB_STATS is not set
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_SPINLOCK_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
# CONFIG_SYSCTL_SYSCALL_CHECK is not set
# CONFIG_PAGE_POISONING is not set
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y
CONFIG_TRACING=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_ENABLE_DEFAULT_TRACERS is not set
# CONFIG_BOOT_TRACER is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
# CONFIG_PROFILE_ALL_BRANCHES is not set
# CONFIG_STACK_TRACER is not set
# CONFIG_KMEMTRACE is not set
# CONFIG_WORKQUEUE_TRACER is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_DYNAMIC_DEBUG is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_ARM_UNWIND=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_ERRORS is not set
# CONFIG_DEBUG_STACK_USAGE is not set
CONFIG_DEBUG_LL=y
CONFIG_EARLY_PRINTK=y
# CONFIG_DEBUG_ICEDCC is not set
# CONFIG_OC_ETM is not set

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set
# CONFIG_SECURITYFS is not set
# CONFIG_DEFAULT_SECURITY_SELINUX is not set
# CONFIG_DEFAULT_SECURITY_SMACK is not set
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_XOR_BLOCKS=m
CONFIG_ASYNC_CORE=m
CONFIG_ASYNC_MEMCPY=m
CONFIG_ASYNC_XOR=m
CONFIG_ASYNC_PQ=m
CONFIG_ASYNC_RAID6_RECOV=m
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=m
# CONFIG_CRYPTO_AUTHENC is not set
CONFIG_CRYPTO_TEST=m

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
# CONFIG_CRYPTO_SEQIV is not set

#
# Block modes
#
CONFIG_CRYPTO_CBC=y
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_CTS is not set
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m
# CONFIG_CRYPTO_XTS is not set

#
# Hash modes
#
CONFIG_CRYPTO_HMAC=m
CONFIG_CRYPTO_XCBC=m
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_GHASH is not set
CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=y
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
CONFIG_CRYPTO_SHA1=m
CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_TGR192=m
CONFIG_CRYPTO_WP512=m

#
# Ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_FCRYPT=m
CONFIG_CRYPTO_KHAZAD=m
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_SEED is not set
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_TEA=m
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_TWOFISH_COMMON=m

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=y
# CONFIG_CRYPTO_ZLIB is not set
CONFIG_CRYPTO_LZO=y

#
# Random Number Generation
#
# CONFIG_CRYPTO_ANSI_CPRNG is not set
CONFIG_CRYPTO_HW=y
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_LAST_BIT=y
CONFIG_CRC_CCITT=y
CONFIG_CRC16=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC32=y
CONFIG_CRC7=y
CONFIG_LIBCRC32C=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_DECOMPRESS_GZIP=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_NLATTR=y

^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 0/4] omap multiboot improvments for merge window after 2.6.34
@ 2010-01-16 20:15   ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-16 20:15 UTC (permalink / raw)
  To: linux-arm-kernel

* Tony Lindgren <tony@atomide.com> [100115 17:32]:
> Hi all,
> 
> Here are some multiboot improvments for review. These patches
> are intended for the 2.6.34 merge window.
> 
> Comments and testing would be nice, I've tested them so far
> on osk, 770, n800, rx51 and overo.

Attached is also an experimental patch to compile in 2420 and 34xx
and the .config I used.

It still fails early during the boot in dmtimer_init, so it's
just for reference in case anybody wants to play with it.

Note that we still have a problem compiling in 2420 and 2430
because of the different clock bases.

Cheers,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 1/4] omap: Clean the serial port defines
  2010-01-16  1:35   ` Tony Lindgren
@ 2010-01-19  0:39     ` Pandita, Vikram
  -1 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-19  0:39 UTC (permalink / raw)
  To: Tony Lindgren, linux-arm-kernel; +Cc: linux-omap



>-----Original Message-----
>From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony
>Lindgren
>Sent: Friday, January 15, 2010 7:35 PM
>To: linux-arm-kernel@lists.infradead.org
>Cc: linux-omap@vger.kernel.org
>Subject: [PATCH 1/4] omap: Clean the serial port defines
>
>This way we don't have conflicts with the defines
>with compiling in multiple omaps. Set the addresses
>for uarts in struct omap_globals for the early serial
>init code.

Nice and much needed cleanup. 

>
>Signed-off-by: Tony Lindgren <tony@atomide.com>
<snip>
>diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
>index 6e5207c..349de90 100644
>--- a/arch/arm/mach-omap1/serial.c
>+++ b/arch/arm/mach-omap1/serial.c
>@@ -64,7 +64,7 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
>
> static struct plat_serial8250_port serial_platform_data[] = {
> 	{
>-		.mapbase	= OMAP_UART1_BASE,
>+		.mapbase	= OMAP1_UART1_BASE,

Is it possible to use the same approach as mach-omap2/ for physical address assignments?
I like that approach.
Refer this part from mach-omap2:
	+	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;	

> 		.irq		= INT_UART1,
> 		.flags		= UPF_BOOT_AUTOCONF,
> 		.iotype		= UPIO_MEM,
<snip>
>diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-
>macro.S
>index e9f255d..0c96e1c 100644
>--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
>+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
>@@ -11,6 +11,10 @@
>  *
> */
>
>+#include <linux/serial_reg.h>
>+
>+#include <plat/serial.h>
>+
> 		.macro	addruart,rx
> 		mrc	p15, 0, \rx, c1, c0
> 		tst	\rx, #1			@ MMU enabled?
>@@ -44,15 +48,10 @@
> 		.endm
>
> 		.macro	busyuart,rd,rx
>-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
>-		and	\rd, \rd, #0x60
>-		teq	\rd, #0x60
>-		beq	1002f
>-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
>-		and	\rd, \rd, #0x60
>-		teq	\rd, #0x60
>+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]

Zoom2/3 kind of boards have external debug Serial port.
For those boards and maybe others, the shift value is 1 and not OMAP_PORT_SHIFT(2).

This solution is not extensible to zoom2/3 boards with external debug board uarts.
How do we address that? 


>+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
>+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
> 		bne	1001b
>-1002:
> 		.endm
>
> 		.macro	waituart,rd,rx
<snip>
>diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
<snip>
>@@ -269,11 +278,15 @@ static struct omap_globals omap343x_globals = {
> 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
> 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
> 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
>+	.uart1_phys	= OMAP3_UART1_BASE,
>+	.uart2_phys	= OMAP3_UART2_BASE,
>+	.uart3_phys	= OMAP3_UART3_BASE,

OMAP3630 also has 4 UARTS and this same global is getting used for both 34xx and 36xx.
This is not right.

For 3630 uart4_phys = 0x49042000

> };
>
> void __init omap2_set_globals_343x(void)
> {
> 	__omap2_set_globals(&omap343x_globals);
>+	omap2_set_globals_uart(&omap343x_globals);
> }
> #endif
>
>@@ -285,6 +298,10 @@ static struct omap_globals omap4_globals = {
> 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
> 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
> 	.cm2	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
>+	.uart1_phys	= OMAP4_UART1_BASE,
>+	.uart2_phys	= OMAP4_UART2_BASE,
>+	.uart3_phys	= OMAP4_UART3_BASE,
>+	.uart4_phys	= OMAP4_UART4_BASE,
> };
>
> void __init omap2_set_globals_443x(void)
>@@ -292,6 +309,7 @@ void __init omap2_set_globals_443x(void)
> 	omap2_set_globals_tap(&omap4_globals);
> 	omap2_set_globals_control(&omap4_globals);
> 	omap2_set_globals_prcm(&omap4_globals);
>+	omap2_set_globals_uart(&omap4_globals);
> }
> #endif
>
>diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
>index 32c2227..a8fa0d7 100644
>--- a/arch/arm/plat-omap/include/plat/common.h
>+++ b/arch/arm/plat-omap/include/plat/common.h
>@@ -47,6 +47,10 @@ struct omap_globals {
> 	void __iomem	*prm;		/* Power and Reset Management */
> 	void __iomem	*cm;		/* Clock Management */
> 	void __iomem	*cm2;
>+	unsigned long	uart1_phys;
>+	unsigned long	uart2_phys;
>+	unsigned long	uart3_phys;
>+	unsigned long	uart4_phys;
> };
>
> void omap2_set_globals_242x(void);
>@@ -59,6 +63,7 @@ void omap2_set_globals_tap(struct omap_globals *);
> void omap2_set_globals_sdrc(struct omap_globals *);
> void omap2_set_globals_control(struct omap_globals *);
> void omap2_set_globals_prcm(struct omap_globals *);
>+void omap2_set_globals_uart(struct omap_globals *);
>
> /**
>  * omap_test_timeout - busy-loop, testing a condition
>diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
>index f5a4a92..c7e2b85 100644
>--- a/arch/arm/plat-omap/include/plat/serial.h
>+++ b/arch/arm/plat-omap/include/plat/serial.h
>@@ -15,37 +15,39 @@
>
> #include <linux/init.h>
>
>-#if defined(CONFIG_ARCH_OMAP1)
> /* OMAP1 serial ports */
>-#define OMAP_UART1_BASE		0xfffb0000
>-#define OMAP_UART2_BASE		0xfffb0800
>-#define OMAP_UART3_BASE		0xfffb9800
>-#elif defined(CONFIG_ARCH_OMAP2)
>+#define OMAP1_UART1_BASE	0xfffb0000
>+#define OMAP1_UART2_BASE	0xfffb0800
>+#define OMAP1_UART3_BASE	0xfffb9800
>+
> /* OMAP2 serial ports */
>-#define OMAP_UART1_BASE		0x4806a000
>-#define OMAP_UART2_BASE		0x4806c000
>-#define OMAP_UART3_BASE		0x4806e000
>-#elif defined(CONFIG_ARCH_OMAP3)
>+#define OMAP2_UART1_BASE	0x4806a000
>+#define OMAP2_UART2_BASE	0x4806c000
>+#define OMAP2_UART3_BASE	0x4806e000
>+
> /* OMAP3 serial ports */
>-#define OMAP_UART1_BASE		0x4806a000
>-#define OMAP_UART2_BASE		0x4806c000
>-#define OMAP_UART3_BASE		0x49020000

Need to add 0x4904 2000 for 3630 UART4

>-#elif defined(CONFIG_ARCH_OMAP4)
>+#define OMAP3_UART1_BASE	0x4806a000
>+#define OMAP3_UART2_BASE	0x4806c000
>+#define OMAP3_UART3_BASE	0x49020000
>+
> /* OMAP4 serial ports */
>-#define OMAP_UART1_BASE		0x4806a000
>-#define OMAP_UART2_BASE		0x4806c000
>-#define OMAP_UART3_BASE		0x48020000
>-#define OMAP_UART4_BASE		0x4806e000
>-#endif
>+#define OMAP4_UART1_BASE	0x4806a000
>+#define OMAP4_UART2_BASE	0x4806c000
>+#define OMAP4_UART3_BASE	0x48020000
>+#define OMAP4_UART4_BASE	0x4806e000
>+
>+#define OMAP_PORT_SHIFT		2
>+#define OMAP7XX_PORT_SHIFT	0
>
> #define OMAP1510_BASE_BAUD	(12000000/16)
> #define OMAP16XX_BASE_BAUD	(48000000/16)
> #define OMAP24XX_BASE_BAUD	(48000000/16)
>
>+/* This is only used by 8250.c for omap1510 */
> #define is_omap_port(pt)	({int __ret = 0;			\
>-			if ((pt)->port.mapbase == OMAP_UART1_BASE ||	\
>-			    (pt)->port.mapbase == OMAP_UART2_BASE ||	\
>-			    (pt)->port.mapbase == OMAP_UART3_BASE)	\
>+			if ((pt)->port.mapbase == OMAP1_UART1_BASE ||	\
>+			    (pt)->port.mapbase == OMAP1_UART2_BASE ||	\
>+			    (pt)->port.mapbase == OMAP1_UART3_BASE)	\
> 				__ret = 1;				\
> 			__ret;						\
> 			})
>
>--
>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] 76+ messages in thread

* [PATCH 1/4] omap: Clean the serial port defines
@ 2010-01-19  0:39     ` Pandita, Vikram
  0 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-19  0:39 UTC (permalink / raw)
  To: linux-arm-kernel



>-----Original Message-----
From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Tony
>Lindgren
>Sent: Friday, January 15, 2010 7:35 PM
>To: linux-arm-kernel at lists.infradead.org
>Cc: linux-omap at vger.kernel.org
>Subject: [PATCH 1/4] omap: Clean the serial port defines
>
>This way we don't have conflicts with the defines
>with compiling in multiple omaps. Set the addresses
>for uarts in struct omap_globals for the early serial
>init code.

Nice and much needed cleanup. 

>
>Signed-off-by: Tony Lindgren <tony@atomide.com>
<snip>
>diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
>index 6e5207c..349de90 100644
>--- a/arch/arm/mach-omap1/serial.c
>+++ b/arch/arm/mach-omap1/serial.c
>@@ -64,7 +64,7 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
>
> static struct plat_serial8250_port serial_platform_data[] = {
> 	{
>-		.mapbase	= OMAP_UART1_BASE,
>+		.mapbase	= OMAP1_UART1_BASE,

Is it possible to use the same approach as mach-omap2/ for physical address assignments?
I like that approach.
Refer this part from mach-omap2:
	+	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;	

> 		.irq		= INT_UART1,
> 		.flags		= UPF_BOOT_AUTOCONF,
> 		.iotype		= UPIO_MEM,
<snip>
>diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-
>macro.S
>index e9f255d..0c96e1c 100644
>--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
>+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
>@@ -11,6 +11,10 @@
>  *
> */
>
>+#include <linux/serial_reg.h>
>+
>+#include <plat/serial.h>
>+
> 		.macro	addruart,rx
> 		mrc	p15, 0, \rx, c1, c0
> 		tst	\rx, #1			@ MMU enabled?
>@@ -44,15 +48,10 @@
> 		.endm
>
> 		.macro	busyuart,rd,rx
>-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
>-		and	\rd, \rd, #0x60
>-		teq	\rd, #0x60
>-		beq	1002f
>-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
>-		and	\rd, \rd, #0x60
>-		teq	\rd, #0x60
>+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]

Zoom2/3 kind of boards have external debug Serial port.
For those boards and maybe others, the shift value is 1 and not OMAP_PORT_SHIFT(2).

This solution is not extensible to zoom2/3 boards with external debug board uarts.
How do we address that? 


>+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
>+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
> 		bne	1001b
>-1002:
> 		.endm
>
> 		.macro	waituart,rd,rx
<snip>
>diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
<snip>
>@@ -269,11 +278,15 @@ static struct omap_globals omap343x_globals = {
> 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
> 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
> 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
>+	.uart1_phys	= OMAP3_UART1_BASE,
>+	.uart2_phys	= OMAP3_UART2_BASE,
>+	.uart3_phys	= OMAP3_UART3_BASE,

OMAP3630 also has 4 UARTS and this same global is getting used for both 34xx and 36xx.
This is not right.

For 3630 uart4_phys = 0x49042000

> };
>
> void __init omap2_set_globals_343x(void)
> {
> 	__omap2_set_globals(&omap343x_globals);
>+	omap2_set_globals_uart(&omap343x_globals);
> }
> #endif
>
>@@ -285,6 +298,10 @@ static struct omap_globals omap4_globals = {
> 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
> 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
> 	.cm2	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
>+	.uart1_phys	= OMAP4_UART1_BASE,
>+	.uart2_phys	= OMAP4_UART2_BASE,
>+	.uart3_phys	= OMAP4_UART3_BASE,
>+	.uart4_phys	= OMAP4_UART4_BASE,
> };
>
> void __init omap2_set_globals_443x(void)
>@@ -292,6 +309,7 @@ void __init omap2_set_globals_443x(void)
> 	omap2_set_globals_tap(&omap4_globals);
> 	omap2_set_globals_control(&omap4_globals);
> 	omap2_set_globals_prcm(&omap4_globals);
>+	omap2_set_globals_uart(&omap4_globals);
> }
> #endif
>
>diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
>index 32c2227..a8fa0d7 100644
>--- a/arch/arm/plat-omap/include/plat/common.h
>+++ b/arch/arm/plat-omap/include/plat/common.h
>@@ -47,6 +47,10 @@ struct omap_globals {
> 	void __iomem	*prm;		/* Power and Reset Management */
> 	void __iomem	*cm;		/* Clock Management */
> 	void __iomem	*cm2;
>+	unsigned long	uart1_phys;
>+	unsigned long	uart2_phys;
>+	unsigned long	uart3_phys;
>+	unsigned long	uart4_phys;
> };
>
> void omap2_set_globals_242x(void);
>@@ -59,6 +63,7 @@ void omap2_set_globals_tap(struct omap_globals *);
> void omap2_set_globals_sdrc(struct omap_globals *);
> void omap2_set_globals_control(struct omap_globals *);
> void omap2_set_globals_prcm(struct omap_globals *);
>+void omap2_set_globals_uart(struct omap_globals *);
>
> /**
>  * omap_test_timeout - busy-loop, testing a condition
>diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
>index f5a4a92..c7e2b85 100644
>--- a/arch/arm/plat-omap/include/plat/serial.h
>+++ b/arch/arm/plat-omap/include/plat/serial.h
>@@ -15,37 +15,39 @@
>
> #include <linux/init.h>
>
>-#if defined(CONFIG_ARCH_OMAP1)
> /* OMAP1 serial ports */
>-#define OMAP_UART1_BASE		0xfffb0000
>-#define OMAP_UART2_BASE		0xfffb0800
>-#define OMAP_UART3_BASE		0xfffb9800
>-#elif defined(CONFIG_ARCH_OMAP2)
>+#define OMAP1_UART1_BASE	0xfffb0000
>+#define OMAP1_UART2_BASE	0xfffb0800
>+#define OMAP1_UART3_BASE	0xfffb9800
>+
> /* OMAP2 serial ports */
>-#define OMAP_UART1_BASE		0x4806a000
>-#define OMAP_UART2_BASE		0x4806c000
>-#define OMAP_UART3_BASE		0x4806e000
>-#elif defined(CONFIG_ARCH_OMAP3)
>+#define OMAP2_UART1_BASE	0x4806a000
>+#define OMAP2_UART2_BASE	0x4806c000
>+#define OMAP2_UART3_BASE	0x4806e000
>+
> /* OMAP3 serial ports */
>-#define OMAP_UART1_BASE		0x4806a000
>-#define OMAP_UART2_BASE		0x4806c000
>-#define OMAP_UART3_BASE		0x49020000

Need to add 0x4904 2000 for 3630 UART4

>-#elif defined(CONFIG_ARCH_OMAP4)
>+#define OMAP3_UART1_BASE	0x4806a000
>+#define OMAP3_UART2_BASE	0x4806c000
>+#define OMAP3_UART3_BASE	0x49020000
>+
> /* OMAP4 serial ports */
>-#define OMAP_UART1_BASE		0x4806a000
>-#define OMAP_UART2_BASE		0x4806c000
>-#define OMAP_UART3_BASE		0x48020000
>-#define OMAP_UART4_BASE		0x4806e000
>-#endif
>+#define OMAP4_UART1_BASE	0x4806a000
>+#define OMAP4_UART2_BASE	0x4806c000
>+#define OMAP4_UART3_BASE	0x48020000
>+#define OMAP4_UART4_BASE	0x4806e000
>+
>+#define OMAP_PORT_SHIFT		2
>+#define OMAP7XX_PORT_SHIFT	0
>
> #define OMAP1510_BASE_BAUD	(12000000/16)
> #define OMAP16XX_BASE_BAUD	(48000000/16)
> #define OMAP24XX_BASE_BAUD	(48000000/16)
>
>+/* This is only used by 8250.c for omap1510 */
> #define is_omap_port(pt)	({int __ret = 0;			\
>-			if ((pt)->port.mapbase == OMAP_UART1_BASE ||	\
>-			    (pt)->port.mapbase == OMAP_UART2_BASE ||	\
>-			    (pt)->port.mapbase == OMAP_UART3_BASE)	\
>+			if ((pt)->port.mapbase == OMAP1_UART1_BASE ||	\
>+			    (pt)->port.mapbase == OMAP1_UART2_BASE ||	\
>+			    (pt)->port.mapbase == OMAP1_UART3_BASE)	\
> 				__ret = 1;				\
> 			__ret;						\
> 			})
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>the body of a message to majordomo at vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16  1:35   ` Tony Lindgren
@ 2010-01-19  1:26     ` Pandita, Vikram
  -1 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-19  1:26 UTC (permalink / raw)
  To: Tony Lindgren, linux-arm-kernel; +Cc: linux-omap



>-----Original Message-----
>From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony
>Lindgren
>Sent: Friday, January 15, 2010 7:35 PM
>To: linux-arm-kernel@lists.infradead.org
>Cc: linux-omap@vger.kernel.org
>Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic

UART_SCR 		-> this is the scratchpad register 
UART_OMAP_SCR	-> This is TI-only Supplementary control register

You probably confused the two (as rightly so since SCR is same name).
So there is no need to save/restore the UART_SCR register as you have done, see inlined -- 

>
>Define arch_decomp_setup() the same way as some other
>architectures do. Use arch_id to configure the debug uart
>based on the machine_is by storing it into the uart
>scratchpad register for DEBUG_LL code to use.
>
>Signed-off-by: Tony Lindgren <tony@atomide.com>
<snip>
>--- a/arch/arm/mach-omap2/serial.c
>+++ b/arch/arm/mach-omap2/serial.c
>@@ -161,11 +161,22 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
> static inline void __init omap_uart_reset(struct omap_uart_state *uart)
> {
> 	struct plat_serial8250_port *p = uart->p;
>+	u8 scratchpad = 0;
>+
>+	/*
>+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
>+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
>+	 */
>+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
>+		scratchpad = serial_read_reg(p, UART_SCR);

No need to save and restore the UART_SCR register. 
This never gets used in this function.

What gets used is UART_OMAP_SCR which is OMAP specific supplimantry control register 
and not scratchpad.

>
> 	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
> 	serial_write_reg(p, UART_OMAP_SCR, 0x08);
> 	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
> 	serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
>+
>+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
>+		serial_write_reg(p, UART_SCR, scratchpad);

Remove this as well. No need. 


<snip>
>diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-
>omap/include/plat/uncompress.h
>index 13c305d..479bac8 100644
>--- a/arch/arm/plat-omap/include/plat/uncompress.h
>+++ b/arch/arm/plat-omap/include/plat/uncompress.h
>@@ -19,62 +19,36 @@
>
> #include <linux/types.h>
> #include <linux/serial_reg.h>
>+
>+#include <asm/mach-types.h>
>+
> #include <plat/serial.h>
>
>-unsigned int system_rev;
>+static volatile u8 *uart1_base;
>+static volatile u8 *uart_base;
>+static volatile int uart_shift;

Just like uart_base is stored in scratchpad,
Somehow the uart_shift also needs to be stored so that boards with different uart_shift requirements can be addressed. Where can we store this another variable? 

<snip>

> /*
>+ * Macros to configure UART1 and debug UART
>+ */
>+#define _DEBUG_LL_ENTRY(mach, uart1, dbg_uart, shift, dbg_id, reset_fn)	\
>+	if (machine_is_##mach()) {					\
>+		uart1_base = (volatile u8 *)(uart1);			\
>+		uart_base = (volatile u8 *)(dbg_uart);			\
>+		uart_shift = (shift);					\
>+		port = (dbg_id);					\
>+		reset_fn;						\
>+		break;							\
>+	}

Nice Idea... you are the man !!

<snip>

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-19  1:26     ` Pandita, Vikram
  0 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-19  1:26 UTC (permalink / raw)
  To: linux-arm-kernel



>-----Original Message-----
From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Tony
>Lindgren
>Sent: Friday, January 15, 2010 7:35 PM
>To: linux-arm-kernel at lists.infradead.org
>Cc: linux-omap at vger.kernel.org
>Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic

UART_SCR 		-> this is the scratchpad register 
UART_OMAP_SCR	-> This is TI-only Supplementary control register

You probably confused the two (as rightly so since SCR is same name).
So there is no need to save/restore the UART_SCR register as you have done, see inlined -- 

>
>Define arch_decomp_setup() the same way as some other
>architectures do. Use arch_id to configure the debug uart
>based on the machine_is by storing it into the uart
>scratchpad register for DEBUG_LL code to use.
>
>Signed-off-by: Tony Lindgren <tony@atomide.com>
<snip>
>--- a/arch/arm/mach-omap2/serial.c
>+++ b/arch/arm/mach-omap2/serial.c
>@@ -161,11 +161,22 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
> static inline void __init omap_uart_reset(struct omap_uart_state *uart)
> {
> 	struct plat_serial8250_port *p = uart->p;
>+	u8 scratchpad = 0;
>+
>+	/*
>+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
>+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
>+	 */
>+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
>+		scratchpad = serial_read_reg(p, UART_SCR);

No need to save and restore the UART_SCR register. 
This never gets used in this function.

What gets used is UART_OMAP_SCR which is OMAP specific supplimantry control register 
and not scratchpad.

>
> 	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
> 	serial_write_reg(p, UART_OMAP_SCR, 0x08);
> 	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
> 	serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
>+
>+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
>+		serial_write_reg(p, UART_SCR, scratchpad);

Remove this as well. No need. 


<snip>
>diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-
>omap/include/plat/uncompress.h
>index 13c305d..479bac8 100644
>--- a/arch/arm/plat-omap/include/plat/uncompress.h
>+++ b/arch/arm/plat-omap/include/plat/uncompress.h
>@@ -19,62 +19,36 @@
>
> #include <linux/types.h>
> #include <linux/serial_reg.h>
>+
>+#include <asm/mach-types.h>
>+
> #include <plat/serial.h>
>
>-unsigned int system_rev;
>+static volatile u8 *uart1_base;
>+static volatile u8 *uart_base;
>+static volatile int uart_shift;

Just like uart_base is stored in scratchpad,
Somehow the uart_shift also needs to be stored so that boards with different uart_shift requirements can be addressed. Where can we store this another variable? 

<snip>

> /*
>+ * Macros to configure UART1 and debug UART
>+ */
>+#define _DEBUG_LL_ENTRY(mach, uart1, dbg_uart, shift, dbg_id, reset_fn)	\
>+	if (machine_is_##mach()) {					\
>+		uart1_base = (volatile u8 *)(uart1);			\
>+		uart_base = (volatile u8 *)(dbg_uart);			\
>+		uart_shift = (shift);					\
>+		port = (dbg_id);					\
>+		reset_fn;						\
>+		break;							\
>+	}

Nice Idea... you are the man !!

<snip>

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16 20:00           ` Tony Lindgren
@ 2010-01-19  1:50             ` Pandita, Vikram
  -1 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-19  1:50 UTC (permalink / raw)
  To: Tony Lindgren, Russell King - ARM Linux; +Cc: linux-arm-kernel, linux-omap



>-----Original Message-----
>From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony
>Lindgren
>Sent: Saturday, January 16, 2010 2:00 PM
>To: Russell King - ARM Linux
>Cc: linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
>Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
>
>* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
>> On Sat, Jan 16, 2010 at 11:18:20AM -0800, Tony Lindgren wrote:
>> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
>> > > On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
>> > > > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-
>omap1/include/mach/debug-macro.S
>> > > > index 23e4724..0174858 100644
>> > > > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
>> > > > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
>> > > > @@ -15,18 +15,71 @@
>> > > >
>> > > >  #include <plat/serial.h>
>> > > >
>> > > > +omap_uart_phys:	.word	0x0
>> > > > +omap_uart_virt:	.word	0x0
>> > >
>> > > I assume that you have no plans for XIP kernel support on OMAP, since
>> > > these will be placed in the .text section, and is therefore read-only
>> > > on XIP kernels.
>> >
>> > Did not think of that.. Maybe some addruart_premable solution here would.
>> > Or adding \tmp register for addruart and just do the detection for each
>> > character.
>>
>> How does doing it per-character help?  The code is:
>>
>> ENTRY(printascii)
>>                 addruart r3
>>                 b       2f
>> 1:              waituart r2, r3
>>                 senduart r1, r3
>>                 busyuart r2, r3
>>                 teq     r1, #'\n'
>>                 moveq   r1, #'\r'
>>                 beq     1b
>> 2:              teq     r0, #0
>>                 ldrneb  r1, [r0], #1
>>                 teqne   r1, #0
>>                 bne     1b
>>                 mov     pc, lr
>>
>> Your wait/send/busy macros are just using the already provided base
>> address which comes via r3 from addruart.  That much is fine.
>>
>> I'm at a loss to understand why you think moving the address-getting
>> functionality out of addruart into the individual wait/send/busy
>> macros is going to help in any way.
>
>Sorry, I meant doing the detection each time addruart is run, not
>for each character.
>
>> Why not do something like this:
>>
>> 		.pushsection .data
>> omap_uart_phys:	.word 0
>> omap_uart_virt:	.word 0

Also We may need a:
	 omap_uart_shift: .word 0 
Since shift also varies depending on different omap boards (external debug board shift=1, internal omap has shift=2)

Bingo..I think this was the key solution to the problem.
I had posted long ago similar kind of implementation [1] 
and I wish rmk had given this nice idea then :)

[1] http://marc.info/?l=linux-omap&m=125269221820632&w=2
	See this part: 
	+		.align
	+		.type   __phy_uart_addr, #object
	+__phy_uart_addr:       .word   0xFF
	+		.type   __virt_uart_addr, #object
	+__virt_uart_addr:       .word   0xFF


>> 		.popsection
>>
>> 		.macro addruart, rx
>> ...
>> +               ldreq   \rx, =omap_uart_phys    @ physical base address
>> +               ldrne   \rx, =omap_uart_virt    @ virtual base
>> 		ldr	\rx, [\rx]
>> +               cmp     \rx, #0                 @ is port configured?
>> +               bne     99f                     @ already configured
>> ...
>>
>> ?
>
>Sounds good to me. Will play with them and post refreshed patches.
>
>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] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-19  1:50             ` Pandita, Vikram
  0 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-19  1:50 UTC (permalink / raw)
  To: linux-arm-kernel



>-----Original Message-----
From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Tony
>Lindgren
>Sent: Saturday, January 16, 2010 2:00 PM
>To: Russell King - ARM Linux
>Cc: linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
>Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
>
>* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
>> On Sat, Jan 16, 2010 at 11:18:20AM -0800, Tony Lindgren wrote:
>> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
>> > > On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
>> > > > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-
>omap1/include/mach/debug-macro.S
>> > > > index 23e4724..0174858 100644
>> > > > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
>> > > > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
>> > > > @@ -15,18 +15,71 @@
>> > > >
>> > > >  #include <plat/serial.h>
>> > > >
>> > > > +omap_uart_phys:	.word	0x0
>> > > > +omap_uart_virt:	.word	0x0
>> > >
>> > > I assume that you have no plans for XIP kernel support on OMAP, since
>> > > these will be placed in the .text section, and is therefore read-only
>> > > on XIP kernels.
>> >
>> > Did not think of that.. Maybe some addruart_premable solution here would.
>> > Or adding \tmp register for addruart and just do the detection for each
>> > character.
>>
>> How does doing it per-character help?  The code is:
>>
>> ENTRY(printascii)
>>                 addruart r3
>>                 b       2f
>> 1:              waituart r2, r3
>>                 senduart r1, r3
>>                 busyuart r2, r3
>>                 teq     r1, #'\n'
>>                 moveq   r1, #'\r'
>>                 beq     1b
>> 2:              teq     r0, #0
>>                 ldrneb  r1, [r0], #1
>>                 teqne   r1, #0
>>                 bne     1b
>>                 mov     pc, lr
>>
>> Your wait/send/busy macros are just using the already provided base
>> address which comes via r3 from addruart.  That much is fine.
>>
>> I'm at a loss to understand why you think moving the address-getting
>> functionality out of addruart into the individual wait/send/busy
>> macros is going to help in any way.
>
>Sorry, I meant doing the detection each time addruart is run, not
>for each character.
>
>> Why not do something like this:
>>
>> 		.pushsection .data
>> omap_uart_phys:	.word 0
>> omap_uart_virt:	.word 0

Also We may need a:
	 omap_uart_shift: .word 0 
Since shift also varies depending on different omap boards (external debug board shift=1, internal omap has shift=2)

Bingo..I think this was the key solution to the problem.
I had posted long ago similar kind of implementation [1] 
and I wish rmk had given this nice idea then :)

[1] http://marc.info/?l=linux-omap&m=125269221820632&w=2
	See this part: 
	+		.align
	+		.type   __phy_uart_addr, #object
	+__phy_uart_addr:       .word   0xFF
	+		.type   __virt_uart_addr, #object
	+__virt_uart_addr:       .word   0xFF


>> 		.popsection
>>
>> 		.macro addruart, rx
>> ...
>> +               ldreq   \rx, =omap_uart_phys    @ physical base address
>> +               ldrne   \rx, =omap_uart_virt    @ virtual base
>> 		ldr	\rx, [\rx]
>> +               cmp     \rx, #0                 @ is port configured?
>> +               bne     99f                     @ already configured
>> ...
>>
>> ?
>
>Sounds good to me. Will play with them and post refreshed patches.
>
>Regards,
>
>Tony
>--
>To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>the body of a message to majordomo at vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-19  1:26     ` Pandita, Vikram
@ 2010-01-19 17:19       ` Kevin Hilman
  -1 siblings, 0 replies; 76+ messages in thread
From: Kevin Hilman @ 2010-01-19 17:19 UTC (permalink / raw)
  To: Pandita, Vikram; +Cc: Tony Lindgren, linux-arm-kernel, linux-omap

On Tue, 2010-01-19 at 06:56 +0530, Pandita, Vikram wrote:
> 
> >-----Original Message-----
> >From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony
> >Lindgren
> >Sent: Friday, January 15, 2010 7:35 PM
> >To: linux-arm-kernel@lists.infradead.org
> >Cc: linux-omap@vger.kernel.org
> >Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
> 
> UART_SCR 		-> this is the scratchpad register 
> UART_OMAP_SCR	-> This is TI-only Supplementary control register
> 
> You probably confused the two (as rightly so since SCR is same name).
> So there is no need to save/restore the UART_SCR register as you have done, see inlined -- 
> 
> >
> >Define arch_decomp_setup() the same way as some other
> >architectures do. Use arch_id to configure the debug uart
> >based on the machine_is by storing it into the uart
> >scratchpad register for DEBUG_LL code to use.
> >
> >Signed-off-by: Tony Lindgren <tony@atomide.com>
> <snip>
> >--- a/arch/arm/mach-omap2/serial.c
> >+++ b/arch/arm/mach-omap2/serial.c
> >@@ -161,11 +161,22 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
> > static inline void __init omap_uart_reset(struct omap_uart_state *uart)
> > {
> > 	struct plat_serial8250_port *p = uart->p;
> >+	u8 scratchpad = 0;
> >+
> >+	/*
> >+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
> >+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
> >+	 */
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		scratchpad = serial_read_reg(p, UART_SCR);
> 
> No need to save and restore the UART_SCR register. 
> This never gets used in this function.
> 
> What gets used is UART_OMAP_SCR which is OMAP specific supplimantry control register 
> and not scratchpad.
> 
> >
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
> > 	serial_write_reg(p, UART_OMAP_SCR, 0x08);
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
> > 	serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
> >+
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		serial_write_reg(p, UART_SCR, scratchpad);
> 
> Remove this as well. No need. 
> 
> 
> <snip>
> >diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-
> >omap/include/plat/uncompress.h
> >index 13c305d..479bac8 100644
> >--- a/arch/arm/plat-omap/include/plat/uncompress.h
> >+++ b/arch/arm/plat-omap/include/plat/uncompress.h
> >@@ -19,62 +19,36 @@
> >
> > #include <linux/types.h>
> > #include <linux/serial_reg.h>
> >+
> >+#include <asm/mach-types.h>
> >+
> > #include <plat/serial.h>
> >
> >-unsigned int system_rev;
> >+static volatile u8 *uart1_base;
> >+static volatile u8 *uart_base;
> >+static volatile int uart_shift;
> 
> Just like uart_base is stored in scratchpad,
> Somehow the uart_shift also needs to be stored so that boards with different uart_shift requirements can be addressed. Where can we store this another variable? 

Since the base addresses are aligned, how about store the shift in the
least-significant 2 bits, and the rest is the base address.

Kevin

> <snip>
> 
> > /*
> >+ * Macros to configure UART1 and debug UART
> >+ */
> >+#define _DEBUG_LL_ENTRY(mach, uart1, dbg_uart, shift, dbg_id, reset_fn)	\
> >+	if (machine_is_##mach()) {					\
> >+		uart1_base = (volatile u8 *)(uart1);			\
> >+		uart_base = (volatile u8 *)(dbg_uart);			\
> >+		uart_shift = (shift);					\
> >+		port = (dbg_id);					\
> >+		reset_fn;						\
> >+		break;							\
> >+	}
> 
> Nice Idea... you are the man !!
> 
> <snip>
> NrybXǧv^)޺{.n+{f{ay\x1dʇڙ,j\afhz\x1ew\fj:+vwjm\azZ+ݢj"!


--
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] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-19 17:19       ` Kevin Hilman
  0 siblings, 0 replies; 76+ messages in thread
From: Kevin Hilman @ 2010-01-19 17:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2010-01-19 at 06:56 +0530, Pandita, Vikram wrote:
> 
> >-----Original Message-----
> >From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Tony
> >Lindgren
> >Sent: Friday, January 15, 2010 7:35 PM
> >To: linux-arm-kernel at lists.infradead.org
> >Cc: linux-omap at vger.kernel.org
> >Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
> 
> UART_SCR 		-> this is the scratchpad register 
> UART_OMAP_SCR	-> This is TI-only Supplementary control register
> 
> You probably confused the two (as rightly so since SCR is same name).
> So there is no need to save/restore the UART_SCR register as you have done, see inlined -- 
> 
> >
> >Define arch_decomp_setup() the same way as some other
> >architectures do. Use arch_id to configure the debug uart
> >based on the machine_is by storing it into the uart
> >scratchpad register for DEBUG_LL code to use.
> >
> >Signed-off-by: Tony Lindgren <tony@atomide.com>
> <snip>
> >--- a/arch/arm/mach-omap2/serial.c
> >+++ b/arch/arm/mach-omap2/serial.c
> >@@ -161,11 +161,22 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
> > static inline void __init omap_uart_reset(struct omap_uart_state *uart)
> > {
> > 	struct plat_serial8250_port *p = uart->p;
> >+	u8 scratchpad = 0;
> >+
> >+	/*
> >+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
> >+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
> >+	 */
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		scratchpad = serial_read_reg(p, UART_SCR);
> 
> No need to save and restore the UART_SCR register. 
> This never gets used in this function.
> 
> What gets used is UART_OMAP_SCR which is OMAP specific supplimantry control register 
> and not scratchpad.
> 
> >
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
> > 	serial_write_reg(p, UART_OMAP_SCR, 0x08);
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
> > 	serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
> >+
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		serial_write_reg(p, UART_SCR, scratchpad);
> 
> Remove this as well. No need. 
> 
> 
> <snip>
> >diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-
> >omap/include/plat/uncompress.h
> >index 13c305d..479bac8 100644
> >--- a/arch/arm/plat-omap/include/plat/uncompress.h
> >+++ b/arch/arm/plat-omap/include/plat/uncompress.h
> >@@ -19,62 +19,36 @@
> >
> > #include <linux/types.h>
> > #include <linux/serial_reg.h>
> >+
> >+#include <asm/mach-types.h>
> >+
> > #include <plat/serial.h>
> >
> >-unsigned int system_rev;
> >+static volatile u8 *uart1_base;
> >+static volatile u8 *uart_base;
> >+static volatile int uart_shift;
> 
> Just like uart_base is stored in scratchpad,
> Somehow the uart_shift also needs to be stored so that boards with different uart_shift requirements can be addressed. Where can we store this another variable? 

Since the base addresses are aligned, how about store the shift in the
least-significant 2 bits, and the rest is the base address.

Kevin

> <snip>
> 
> > /*
> >+ * Macros to configure UART1 and debug UART
> >+ */
> >+#define _DEBUG_LL_ENTRY(mach, uart1, dbg_uart, shift, dbg_id, reset_fn)	\
> >+	if (machine_is_##mach()) {					\
> >+		uart1_base = (volatile u8 *)(uart1);			\
> >+		uart_base = (volatile u8 *)(dbg_uart);			\
> >+		uart_shift = (shift);					\
> >+		port = (dbg_id);					\
> >+		reset_fn;						\
> >+		break;							\
> >+	}
> 
> Nice Idea... you are the man !!
> 
> <snip>
> NrybX?v^)?{.n+{f{ay
??,j\afhz
w\f
j:+vwjm\azZ+?j"!

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 1/4] omap: Clean the serial port defines
  2010-01-19  0:39     ` Pandita, Vikram
@ 2010-01-20 23:10       ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-20 23:10 UTC (permalink / raw)
  To: Pandita, Vikram; +Cc: linux-arm-kernel, linux-omap

[-- Attachment #1: Type: text/plain, Size: 2326 bytes --]

Hi,

* Pandita, Vikram <vikram.pandita@ti.com> [100118 16:37]:

<snip>

> Is it possible to use the same approach as mach-omap2/ for physical address assignments?
> I like that approach.
> Refer this part from mach-omap2:
> 	+	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;	
> 
> > 		.irq		= INT_UART1,
> > 		.flags		= UPF_BOOT_AUTOCONF,
> > 		.iotype		= UPIO_MEM,

It would be possible if we had omap1_globals. But we don't have it as
the address space is so similar across all omap1 processors.

> > 		.macro	busyuart,rd,rx
> >-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
> >-		and	\rd, \rd, #0x60
> >-		teq	\rd, #0x60
> >-		beq	1002f
> >-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
> >-		and	\rd, \rd, #0x60
> >-		teq	\rd, #0x60
> >+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
> 
> Zoom2/3 kind of boards have external debug Serial port.
> For those boards and maybe others, the shift value is 1 and not OMAP_PORT_SHIFT(2).

OK, thanks for pointing that out. Let's add the shift as a variable
in debug-macro.S, see the next patch in the series.
 
> This solution is not extensible to zoom2/3 boards with external debug board uarts.
> How do we address that? 
 
It should be doable, we need to initialize zoom external uart physical
and virtual address in uncompress.h, and also initialize the shift for
it.
 
> >diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
> <snip>
> >@@ -269,11 +278,15 @@ static struct omap_globals omap343x_globals = {
> > 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
> > 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
> >+	.uart1_phys	= OMAP3_UART1_BASE,
> >+	.uart2_phys	= OMAP3_UART2_BASE,
> >+	.uart3_phys	= OMAP3_UART3_BASE,
> 
> OMAP3630 also has 4 UARTS and this same global is getting used for both 34xx and 36xx.
> This is not right.
> 
> For 3630 uart4_phys = 0x49042000

OK, updated.

> >+#define OMAP3_UART1_BASE	0x4806a000
> >+#define OMAP3_UART2_BASE	0x4806c000
> >+#define OMAP3_UART3_BASE	0x49020000
> 
> Need to add 0x4904 2000 for 3630 UART4

OK, added now. Care to look and ack the attached updated patch?

Regards,

Tony


[-- Attachment #2: serial-port-defines-v2.patch --]
[-- Type: text/x-diff, Size: 12847 bytes --]

>From ecfb8e2561eb91a76797fdf38204bfa70f1d062b Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Wed, 20 Jan 2010 14:11:59 -0800
Subject: [PATCH] omap: Clean the serial port defines

This way we don't have conflicts with the defines
with compiling in multiple omaps. Set the addresses
for uarts in struct omap_globals for the early serial
init code.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index aedb746..23e4724 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -11,6 +11,10 @@
  *
 */
 
+#include <linux/serial_reg.h>
+
+#include <plat/serial.h>
+
 		.macro	addruart,rx
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
@@ -30,13 +34,13 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		beq	1002f
-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
+		ldrb	\rd, [\rx, #(UART_LSR << OMAP7XX_PORT_SHIFT)]
+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		bne	1001b
 1002:
 		.endm
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 6e5207c..349de90 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -64,7 +64,7 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
 
 static struct plat_serial8250_port serial_platform_data[] = {
 	{
-		.mapbase	= OMAP_UART1_BASE,
+		.mapbase	= OMAP1_UART1_BASE,
 		.irq		= INT_UART1,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -72,7 +72,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.uartclk	= OMAP16XX_BASE_BAUD * 16,
 	},
 	{
-		.mapbase	= OMAP_UART2_BASE,
+		.mapbase	= OMAP1_UART2_BASE,
 		.irq		= INT_UART2,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -80,7 +80,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.uartclk	= OMAP16XX_BASE_BAUD * 16,
 	},
 	{
-		.mapbase	= OMAP_UART3_BASE,
+		.mapbase	= OMAP1_UART3_BASE,
 		.irq		= INT_UART3,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 7390596..c178e68 100755
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -68,7 +68,7 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
 static void __init omap_sdp_map_io(void)
 {
-	omap2_set_globals_343x();
+	omap2_set_globals_36xx();
 	omap2_map_common_io();
 }
 
diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom3.c
index 6512b21..bb1bb8f 100644
--- a/arch/arm/mach-omap2/board-zoom3.c
+++ b/arch/arm/mach-omap2/board-zoom3.c
@@ -27,7 +27,7 @@
 
 static void __init omap_zoom_map_io(void)
 {
-	omap2_set_globals_343x();
+	omap2_set_globals_36xx();
 	omap2_map_common_io();
 }
 
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index e9f255d..0c96e1c 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -11,6 +11,10 @@
  *
 */
 
+#include <linux/serial_reg.h>
+
+#include <plat/serial.h>
+
 		.macro	addruart,rx
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
@@ -44,15 +48,10 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
-		beq	1002f
-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
+		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		bne	1001b
-1002:
 		.endm
 
 		.macro	waituart,rd,rx
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 837b347..21e51c5 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -74,7 +74,6 @@ static LIST_HEAD(uart_list);
 
 static struct plat_serial8250_port serial_platform_data0[] = {
 	{
-		.mapbase	= OMAP_UART1_BASE,
 		.irq		= 72,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -87,7 +86,6 @@ static struct plat_serial8250_port serial_platform_data0[] = {
 
 static struct plat_serial8250_port serial_platform_data1[] = {
 	{
-		.mapbase	= OMAP_UART2_BASE,
 		.irq		= 73,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -100,7 +98,6 @@ static struct plat_serial8250_port serial_platform_data1[] = {
 
 static struct plat_serial8250_port serial_platform_data2[] = {
 	{
-		.mapbase	= OMAP_UART3_BASE,
 		.irq		= 74,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -114,7 +111,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
 #ifdef CONFIG_ARCH_OMAP4
 static struct plat_serial8250_port serial_platform_data3[] = {
 	{
-		.mapbase	= OMAP_UART4_BASE,
 		.irq		= 70,
 		.flags		= UPF_BOOT_AUTOCONF,
 		.iotype		= UPIO_MEM,
@@ -125,6 +121,17 @@ static struct plat_serial8250_port serial_platform_data3[] = {
 	}
 };
 #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;
+#ifdef CONFIG_ARCH_OMAP4
+	serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;
+#endif
+}
+
 static inline unsigned int __serial_read_reg(struct uart_port *up,
 					   int offset)
 {
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index bf1eaf3..dddce03 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -34,6 +34,7 @@
 #include <plat/control.h>
 #include <plat/mux.h>
 #include <plat/fpga.h>
+#include <plat/serial.h>
 
 #include <plat/clock.h>
 
@@ -219,6 +220,7 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
 	omap2_set_globals_sdrc(omap2_globals);
 	omap2_set_globals_control(omap2_globals);
 	omap2_set_globals_prcm(omap2_globals);
+	omap2_set_globals_uart(omap2_globals);
 }
 
 #endif
@@ -233,6 +235,9 @@ static struct omap_globals omap242x_globals = {
 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP2420_CTRL_BASE),
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),
+	.uart1_phys	= OMAP2_UART1_BASE,
+	.uart2_phys	= OMAP2_UART2_BASE,
+	.uart3_phys	= OMAP2_UART3_BASE,
 };
 
 void __init omap2_set_globals_242x(void)
@@ -251,6 +256,9 @@ static struct omap_globals omap243x_globals = {
 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),
+	.uart1_phys	= OMAP2_UART1_BASE,
+	.uart2_phys	= OMAP2_UART2_BASE,
+	.uart3_phys	= OMAP2_UART3_BASE,
 };
 
 void __init omap2_set_globals_243x(void)
@@ -259,9 +267,9 @@ void __init omap2_set_globals_243x(void)
 }
 #endif
 
-#if defined(CONFIG_ARCH_OMAP3430)
+#if defined(CONFIG_ARCH_OMAP3)
 
-static struct omap_globals omap343x_globals = {
+static struct omap_globals omap3_globals = {
 	.class	= OMAP343X_CLASS,
 	.tap	= OMAP2_L4_IO_ADDRESS(0x4830A000),
 	.sdrc	= OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
@@ -269,11 +277,21 @@ static struct omap_globals omap343x_globals = {
 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
+	.uart1_phys	= OMAP3_UART1_BASE,
+	.uart2_phys	= OMAP3_UART2_BASE,
+	.uart3_phys	= OMAP3_UART3_BASE,
 };
 
 void __init omap2_set_globals_343x(void)
 {
-	__omap2_set_globals(&omap343x_globals);
+	__omap2_set_globals(&omap3_globals);
+}
+
+void __init omap2_set_globals_36xx(void)
+{
+	omap3_globals.uart4_phys = OMAP3_UART4_BASE;
+
+	__omap2_set_globals(&omap3_globals);
 }
 #endif
 
@@ -285,6 +303,10 @@ static struct omap_globals omap4_globals = {
 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
 	.cm2	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
+	.uart1_phys	= OMAP4_UART1_BASE,
+	.uart2_phys	= OMAP4_UART2_BASE,
+	.uart3_phys	= OMAP4_UART3_BASE,
+	.uart4_phys	= OMAP4_UART4_BASE,
 };
 
 void __init omap2_set_globals_443x(void)
@@ -292,6 +314,7 @@ void __init omap2_set_globals_443x(void)
 	omap2_set_globals_tap(&omap4_globals);
 	omap2_set_globals_control(&omap4_globals);
 	omap2_set_globals_prcm(&omap4_globals);
+	omap2_set_globals_uart(&omap4_globals);
 }
 #endif
 
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 32c2227..e04a58e 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -47,11 +47,16 @@ struct omap_globals {
 	void __iomem	*prm;		/* Power and Reset Management */
 	void __iomem	*cm;		/* Clock Management */
 	void __iomem	*cm2;
+	unsigned long	uart1_phys;
+	unsigned long	uart2_phys;
+	unsigned long	uart3_phys;
+	unsigned long	uart4_phys;
 };
 
 void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_343x(void);
+void omap2_set_globals_36xx(void);
 void omap2_set_globals_443x(void);
 
 /* These get called from omap2_set_globals_xxxx(), do not call these */
@@ -59,6 +64,7 @@ void omap2_set_globals_tap(struct omap_globals *);
 void omap2_set_globals_sdrc(struct omap_globals *);
 void omap2_set_globals_control(struct omap_globals *);
 void omap2_set_globals_prcm(struct omap_globals *);
+void omap2_set_globals_uart(struct omap_globals *);
 
 /**
  * omap_test_timeout - busy-loop, testing a condition
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index f5a4a92..7f5a7a8 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -15,37 +15,40 @@
 
 #include <linux/init.h>
 
-#if defined(CONFIG_ARCH_OMAP1)
 /* OMAP1 serial ports */
-#define OMAP_UART1_BASE		0xfffb0000
-#define OMAP_UART2_BASE		0xfffb0800
-#define OMAP_UART3_BASE		0xfffb9800
-#elif defined(CONFIG_ARCH_OMAP2)
+#define OMAP1_UART1_BASE	0xfffb0000
+#define OMAP1_UART2_BASE	0xfffb0800
+#define OMAP1_UART3_BASE	0xfffb9800
+
 /* OMAP2 serial ports */
-#define OMAP_UART1_BASE		0x4806a000
-#define OMAP_UART2_BASE		0x4806c000
-#define OMAP_UART3_BASE		0x4806e000
-#elif defined(CONFIG_ARCH_OMAP3)
+#define OMAP2_UART1_BASE	0x4806a000
+#define OMAP2_UART2_BASE	0x4806c000
+#define OMAP2_UART3_BASE	0x4806e000
+
 /* OMAP3 serial ports */
-#define OMAP_UART1_BASE		0x4806a000
-#define OMAP_UART2_BASE		0x4806c000
-#define OMAP_UART3_BASE		0x49020000
-#elif defined(CONFIG_ARCH_OMAP4)
+#define OMAP3_UART1_BASE	0x4806a000
+#define OMAP3_UART2_BASE	0x4806c000
+#define OMAP3_UART3_BASE	0x49020000
+#define OMAP3_UART4_BASE	0x49042000	/* Only on 36xx */
+
 /* OMAP4 serial ports */
-#define OMAP_UART1_BASE		0x4806a000
-#define OMAP_UART2_BASE		0x4806c000
-#define OMAP_UART3_BASE		0x48020000
-#define OMAP_UART4_BASE		0x4806e000
-#endif
+#define OMAP4_UART1_BASE	0x4806a000
+#define OMAP4_UART2_BASE	0x4806c000
+#define OMAP4_UART3_BASE	0x48020000
+#define OMAP4_UART4_BASE	0x4806e000
+
+#define OMAP_PORT_SHIFT		2
+#define OMAP7XX_PORT_SHIFT	0
 
 #define OMAP1510_BASE_BAUD	(12000000/16)
 #define OMAP16XX_BASE_BAUD	(48000000/16)
 #define OMAP24XX_BASE_BAUD	(48000000/16)
 
+/* This is only used by 8250.c for omap1510 */
 #define is_omap_port(pt)	({int __ret = 0;			\
-			if ((pt)->port.mapbase == OMAP_UART1_BASE ||	\
-			    (pt)->port.mapbase == OMAP_UART2_BASE ||	\
-			    (pt)->port.mapbase == OMAP_UART3_BASE)	\
+			if ((pt)->port.mapbase == OMAP1_UART1_BASE ||	\
+			    (pt)->port.mapbase == OMAP1_UART2_BASE ||	\
+			    (pt)->port.mapbase == OMAP1_UART3_BASE)	\
 				__ret = 1;				\
 			__ret;						\
 			})
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index 13c305d..e5723c3 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -40,12 +40,13 @@ static void putc(int c)
 #endif
 
 #ifdef CONFIG_ARCH_OMAP
+	/* Will get removed in the next patch, set to OMAP3 to compile */
 #ifdef	CONFIG_OMAP_LL_DEBUG_UART3
-	uart = (volatile u8 *)(OMAP_UART3_BASE);
+	uart = (volatile u8 *)(OMAP3_UART3_BASE);
 #elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
-	uart = (volatile u8 *)(OMAP_UART2_BASE);
+	uart = (volatile u8 *)(OMAP3_UART2_BASE);
 #elif defined(CONFIG_OMAP_LL_DEBUG_UART1)
-	uart = (volatile u8 *)(OMAP_UART1_BASE);
+	uart = (volatile u8 *)(OMAP3_UART1_BASE);
 #elif defined(CONFIG_OMAP_LL_DEBUG_NONE)
 	return;
 #else

^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 1/4] omap: Clean the serial port defines
@ 2010-01-20 23:10       ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-20 23:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

* Pandita, Vikram <vikram.pandita@ti.com> [100118 16:37]:

<snip>

> Is it possible to use the same approach as mach-omap2/ for physical address assignments?
> I like that approach.
> Refer this part from mach-omap2:
> 	+	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;	
> 
> > 		.irq		= INT_UART1,
> > 		.flags		= UPF_BOOT_AUTOCONF,
> > 		.iotype		= UPIO_MEM,

It would be possible if we had omap1_globals. But we don't have it as
the address space is so similar across all omap1 processors.

> > 		.macro	busyuart,rd,rx
> >-1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
> >-		and	\rd, \rd, #0x60
> >-		teq	\rd, #0x60
> >-		beq	1002f
> >-		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
> >-		and	\rd, \rd, #0x60
> >-		teq	\rd, #0x60
> >+1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
> 
> Zoom2/3 kind of boards have external debug Serial port.
> For those boards and maybe others, the shift value is 1 and not OMAP_PORT_SHIFT(2).

OK, thanks for pointing that out. Let's add the shift as a variable
in debug-macro.S, see the next patch in the series.
 
> This solution is not extensible to zoom2/3 boards with external debug board uarts.
> How do we address that? 
 
It should be doable, we need to initialize zoom external uart physical
and virtual address in uncompress.h, and also initialize the shift for
it.
 
> >diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
> <snip>
> >@@ -269,11 +278,15 @@ static struct omap_globals omap343x_globals = {
> > 	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
> > 	.prm	= OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
> > 	.cm	= OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
> >+	.uart1_phys	= OMAP3_UART1_BASE,
> >+	.uart2_phys	= OMAP3_UART2_BASE,
> >+	.uart3_phys	= OMAP3_UART3_BASE,
> 
> OMAP3630 also has 4 UARTS and this same global is getting used for both 34xx and 36xx.
> This is not right.
> 
> For 3630 uart4_phys = 0x49042000

OK, updated.

> >+#define OMAP3_UART1_BASE	0x4806a000
> >+#define OMAP3_UART2_BASE	0x4806c000
> >+#define OMAP3_UART3_BASE	0x49020000
> 
> Need to add 0x4904 2000 for 3630 UART4

OK, added now. Care to look and ack the attached updated patch?

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-16 19:33         ` Russell King - ARM Linux
@ 2010-01-21 19:03           ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-21 19:03 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-arm-kernel, linux-omap

[-- Attachment #1: Type: text/plain, Size: 2091 bytes --]

Hi,

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
> On Sat, Jan 16, 2010 at 11:18:20AM -0800, Tony Lindgren wrote:
> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
> > > On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> > > > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > index 23e4724..0174858 100644
> > > > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > @@ -15,18 +15,71 @@
> > > >  
> > > >  #include <plat/serial.h>
> > > >  
> > > > +omap_uart_phys:	.word	0x0
> > > > +omap_uart_virt:	.word	0x0
> > > 
> > > I assume that you have no plans for XIP kernel support on OMAP, since
> > > these will be placed in the .text section, and is therefore read-only
> > > on XIP kernels.
> > 
> > Did not think of that.. Maybe some addruart_premable solution here would.
> > Or adding \tmp register for addruart and just do the detection for each
> > character.

<snip>
 
> Why not do something like this:
> 
> 		.pushsection .data
> omap_uart_phys:	.word 0
> omap_uart_virt:	.word 0
> 		.popsection
> 
> 		.macro addruart, rx
> ...		
> +               ldreq   \rx, =omap_uart_phys    @ physical base address
> +               ldrne   \rx, =omap_uart_virt    @ virtual base
> 		ldr	\rx, [\rx]
> +               cmp     \rx, #0                 @ is port configured?
> +               bne     99f                     @ already configured
> ...
> 
> ?

Works fine, but it add one issue. Looks like we need to add tmp register
into addruart to initially save the omap_uart_phys and omap_uart_virt:

+		/* Store both phys and virt address for the uart */
+98:		add	\rx, \rx, #0x48000000	@ phys base
+		ldr	\tmp, =omap_uart_phys
+		str	\rx, [\tmp, #0]
+		sub	\rx, \rx, #0x48000000	@ phys base
+		add	\rx, \rx, #0xfa000000	@ virt base
+		ldr	\tmp, =omap_uart_virt
+		str	\rx, [\tmp, #0]

Does the following patch look OK to you, or do you have some other way
in mind for doing it?

Regards,

Tony

[-- Attachment #2: arm-addruart-extra-reg.patch --]
[-- Type: text/x-diff, Size: 3503 bytes --]

>From fae696043ad94ce83709ae72564623f42e66488c Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Wed, 20 Jan 2010 18:26:32 -0800
Subject: [PATCH] arm: Add \tmp register for addruart and loadsp

Otherwise more complicated uart configuration won't be possible.
We can use r1 for tmp register for both head.S and debug.S.

NOTE: This patch depends on another patch to add the the \tmp register
into all debug-macro.S files. That can be done with:

$ find arch/arm -name debug-macro.S | xargs -n1 -i sed -i \
-e "s/addruart,rx\|addruart, rx/addruart, rx, tmp/" {}

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 4fddc50..99b75aa 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -22,13 +22,13 @@
 #if defined(CONFIG_DEBUG_ICEDCC)
 
 #ifdef CONFIG_CPU_V6
-		.macro	loadsp, rb
+		.macro	loadsp, rb, tmp
 		.endm
 		.macro	writeb, ch, rb
 		mcr	p14, 0, \ch, c0, c5, 0
 		.endm
 #elif defined(CONFIG_CPU_V7)
-		.macro	loadsp, rb
+		.macro	loadsp, rb, tmp
 		.endm
 		.macro	writeb, ch, rb
 wait:		mrc	p14, 0, pc, c0, c1, 0
@@ -36,13 +36,13 @@ wait:		mrc	p14, 0, pc, c0, c1, 0
 		mcr	p14, 0, \ch, c0, c5, 0
 		.endm
 #elif defined(CONFIG_CPU_XSCALE)
-		.macro	loadsp, rb
+		.macro	loadsp, rb, tmp
 		.endm
 		.macro	writeb, ch, rb
 		mcr	p14, 0, \ch, c8, c0, 0
 		.endm
 #else
-		.macro	loadsp, rb
+		.macro	loadsp, rb, tmp
 		.endm
 		.macro	writeb, ch, rb
 		mcr	p14, 0, \ch, c1, c0, 0
@@ -58,7 +58,7 @@ wait:		mrc	p14, 0, pc, c0, c1, 0
 		.endm
 
 #if defined(CONFIG_ARCH_SA1100)
-		.macro	loadsp, rb
+		.macro	loadsp, rb, tmp
 		mov	\rb, #0x80000000	@ physical base address
 #ifdef CONFIG_DEBUG_LL_SER3
 		add	\rb, \rb, #0x00050000	@ Ser3
@@ -67,13 +67,13 @@ wait:		mrc	p14, 0, pc, c0, c1, 0
 #endif
 		.endm
 #elif defined(CONFIG_ARCH_S3C2410)
-		.macro loadsp, rb
+		.macro loadsp, rb, tmp
 		mov	\rb, #0x50000000
 		add	\rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT
 		.endm
 #else
-		.macro	loadsp,	rb
-		addruart \rb
+		.macro	loadsp,	rb, tmp
+		addruart \rb, \tmp
 		.endm
 #endif
 #endif
@@ -1025,7 +1025,7 @@ phex:		adr	r3, phexbuf
 		strb	r2, [r3, r1]
 		b	1b
 
-puts:		loadsp	r3
+puts:		loadsp	r3, r1
 1:		ldrb	r2, [r0], #1
 		teq	r2, #0
 		moveq	pc, lr
@@ -1042,7 +1042,7 @@ puts:		loadsp	r3
 putc:
 		mov	r2, r0
 		mov	r0, #0
-		loadsp	r3
+		loadsp	r3, r1
 		b	2b
 
 memdump:	mov	r12, r0
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index 5c91add..a38b487 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -24,7 +24,7 @@
 
 #if defined(CONFIG_CPU_V6)
 
-		.macro	addruart, rx
+		.macro	addruart, rx, tmp
 		.endm
 
 		.macro	senduart, rd, rx
@@ -51,7 +51,7 @@
 
 #elif defined(CONFIG_CPU_V7)
 
-		.macro	addruart, rx
+		.macro	addruart, rx, tmp
 		.endm
 
 		.macro	senduart, rd, rx
@@ -71,7 +71,7 @@ wait:		mrc	p14, 0, pc, c0, c1, 0
 
 #elif defined(CONFIG_CPU_XSCALE)
 
-		.macro	addruart, rx
+		.macro	addruart, rx, tmp
 		.endm
 
 		.macro	senduart, rd, rx
@@ -98,7 +98,7 @@ wait:		mrc	p14, 0, pc, c0, c1, 0
 
 #else
 
-		.macro	addruart, rx
+		.macro	addruart, rx, tmp
 		.endm
 
 		.macro	senduart, rd, rx
@@ -164,7 +164,7 @@ ENDPROC(printhex2)
 		.ltorg
 
 ENTRY(printascii)
-		addruart r3
+		addruart r3, r1
 		b	2f
 1:		waituart r2, r3
 		senduart r1, r3
@@ -180,7 +180,7 @@ ENTRY(printascii)
 ENDPROC(printascii)
 
 ENTRY(printch)
-		addruart r3
+		addruart r3, r1
 		mov	r1, r0
 		mov	r0, #0
 		b	1b

^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-21 19:03           ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-21 19:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
> On Sat, Jan 16, 2010 at 11:18:20AM -0800, Tony Lindgren wrote:
> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 01:33]:
> > > On Fri, Jan 15, 2010 at 05:35:15PM -0800, Tony Lindgren wrote:
> > > > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > index 23e4724..0174858 100644
> > > > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > > > @@ -15,18 +15,71 @@
> > > >  
> > > >  #include <plat/serial.h>
> > > >  
> > > > +omap_uart_phys:	.word	0x0
> > > > +omap_uart_virt:	.word	0x0
> > > 
> > > I assume that you have no plans for XIP kernel support on OMAP, since
> > > these will be placed in the .text section, and is therefore read-only
> > > on XIP kernels.
> > 
> > Did not think of that.. Maybe some addruart_premable solution here would.
> > Or adding \tmp register for addruart and just do the detection for each
> > character.

<snip>
 
> Why not do something like this:
> 
> 		.pushsection .data
> omap_uart_phys:	.word 0
> omap_uart_virt:	.word 0
> 		.popsection
> 
> 		.macro addruart, rx
> ...		
> +               ldreq   \rx, =omap_uart_phys    @ physical base address
> +               ldrne   \rx, =omap_uart_virt    @ virtual base
> 		ldr	\rx, [\rx]
> +               cmp     \rx, #0                 @ is port configured?
> +               bne     99f                     @ already configured
> ...
> 
> ?

Works fine, but it add one issue. Looks like we need to add tmp register
into addruart to initially save the omap_uart_phys and omap_uart_virt:

+		/* Store both phys and virt address for the uart */
+98:		add	\rx, \rx, #0x48000000	@ phys base
+		ldr	\tmp, =omap_uart_phys
+		str	\rx, [\tmp, #0]
+		sub	\rx, \rx, #0x48000000	@ phys base
+		add	\rx, \rx, #0xfa000000	@ virt base
+		ldr	\tmp, =omap_uart_virt
+		str	\rx, [\tmp, #0]

Does the following patch look OK to you, or do you have some other way
in mind for doing it?

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
  2010-01-19  1:50             ` Pandita, Vikram
@ 2010-01-22  3:07               ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22  3:07 UTC (permalink / raw)
  To: Pandita, Vikram; +Cc: Russell King - ARM Linux, linux-arm-kernel, linux-omap

[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]

* Pandita, Vikram <vikram.pandita@ti.com> [100118 17:48]:
>
> >* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
> >
> >> Why not do something like this:
> >>
> >> 		.pushsection .data
> >> omap_uart_phys:	.word 0
> >> omap_uart_virt:	.word 0
> >> 		.popsection

Updated patch below using .data. This assumes getting an additional
tmp register passed to addruart as in the patch I posted earlier.
 
> Also We may need a:
> 	 omap_uart_shift: .word 0 
> Since shift also varies depending on different omap boards
> (external debug board shift=1, internal omap has shift=2)

OK, I've added that too, but for mach-omap2 only. I've also
added an experimental zoom2/3 support.

Care to take try it out and see what happens on a zoom?
 
> Bingo..I think this was the key solution to the problem.
> I had posted long ago similar kind of implementation [1] 
> and I wish rmk had given this nice idea then :)
> 
> [1] http://marc.info/?l=linux-omap&m=125269221820632&w=2
> 	See this part: 
> 	+		.align
> 	+		.type   __phy_uart_addr, #object
> 	+__phy_uart_addr:       .word   0xFF
> 	+		.type   __virt_uart_addr, #object
> 	+__virt_uart_addr:       .word   0xFF

Yeah hopefully we're pretty close to better DEBUG_LL support
for omaps now :)

BTW, I've also pushed these patches into a temporary multi-omap
branch in the linux-omap tree:

http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=shortlog;h=refs/heads/multi-omap

I'll update also the entry-macro.S tomorrow.

Regards,

Tony

[-- Attachment #2: multi-omap-common-debug-v2.patch --]
[-- Type: text/x-diff, Size: 15715 bytes --]

>From 94e3a455b9fb6bdfa1c6b3594d85fee313546e85 Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Thu, 21 Jan 2010 18:53:30 -0800
Subject: [PATCH] omap: Make uncompress code and DEBUG_LL code generic

Define arch_decomp_setup() the same way as some other
architectures do. Use arch_id to configure the debug uart
based on the machine_is by storing it into the uart
scratchpad register for DEBUG_LL code to use.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index 9ea12f2..b6d9584 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -15,18 +15,76 @@
 
 #include <plat/serial.h>
 
+		.pushsection .data
+omap_uart_phys:	.word	0x0
+omap_uart_virt:	.word	0x0
+		.popsection
+
+		/*
+		 * Note that this code won't work if the bootloader passes
+		 * a wrong machine ID number in r1. To debug, just hardcode
+		 * the desired UART phys and virt addresses temporarily into
+		 * the omap_uart_phys and omap_uart_virt above.
+		 */
 		.macro	addruart, rx, tmp
+
+		/* Use omap_uart_phys/virt if already configured */
+9:		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		ldreq	\rx, =omap_uart_phys	@ physical base address
+		ldrne	\rx, =omap_uart_virt	@ virtual base
+		ldr	\rx, [\rx, #0]
+		cmp	\rx, #0			@ is port configured?
+		bne	99f			@ already configured
+
+		/* Check 7XX UART1 scratchpad register for uart to use */
+		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		moveq	\rx, #0xff000000	@ physical base address
+		movne	\rx, #0xfe000000	@ virtual base
+		orr	\rx, \rx, #0x00fb0000	@ OMAP1UART1
+		ldrb	\rx, [\rx, #(UART_SCR << OMAP7XX_PORT_SHIFT)]
+		cmp	\rx, #0			@ anything in 7XX scratchpad?
+		bne	10f			@ found 7XX uart
+
+		/* Check 15xx/16xx UART1 scratchpad register for uart to use */
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
 		moveq	\rx, #0xff000000	@ physical base address
 		movne	\rx, #0xfe000000	@ virtual base
-		orr	\rx, \rx, #0x00fb0000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		orr	\rx, \rx, #0x00009000	@ UART 3
-#endif
-#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
-		orr	\rx, \rx, #0x00000800	@ UART 2 & 3
-#endif
+		orr	\rx, \rx, #0x00fb0000	@ OMAP1UART1
+		ldrb	\rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)]
+
+		/* Select the UART to use based on the UART1 scratchpad value */
+10:		cmp	\rx, #0			@ no port configured?
+		beq	11f			@ if none, try to use UART1
+		cmp	\rx, #OMAP1UART1
+		beq	11f			@ configure OMAP1UART1
+		cmp	\rx, #OMAP1UART2
+		beq	12f			@ configure OMAP1UART2
+		cmp	\rx, #OMAP1UART3
+		beq	13f			@ configure OMAP2UART3
+
+		/* Configure the UART offset from the phys/virt base */
+11:		mov	\rx, #0x00fb0000	@ OMAP1UART1
+		b	98f
+12:		mov	\rx, #0x00fb0000	@ OMAP1UART1
+		orr	\rx, \rx, #0x00000800	@ OMAP1UART2
+		b	98f
+13:		mov	\rx, #0x00fb0000	@ OMAP1UART1
+		orr	\rx, \rx, #0x00000800	@ OMAP1UART2
+		orr	\rx, \rx, #0x00009000	@ OMAP1UART3
+
+		/* Store both phys and virt address for the uart */
+98:		add	\rx, \rx, #0xff000000	@ phys base
+		ldr	\tmp, =omap_uart_phys
+		str	\rx, [\tmp, #0]
+		sub	\rx, \rx, #0xff000000	@ phys base
+		add	\rx, \rx, #0xfe000000	@ virt base
+		ldr	\tmp, =omap_uart_virt
+		str	\rx, [\tmp, #0]
+		b	9b
+99:
 		.endm
 
 		.macro	senduart,rd,rx
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 8d6da9a..4a63a2e 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -15,32 +15,103 @@
 
 #include <plat/serial.h>
 
+#define UART_OFFSET(addr)	((addr) & 0x00ffffff)
+
+		.pushsection .data
+omap_uart_phys:	.word	0
+omap_uart_virt:	.word	0
+omap_uart_lsr:	.word	0
+		.popsection
+
+		/*
+		 * Note that this code won't work if the bootloader passes
+		 * a wrong machine ID number in r1. To debug, just hardcode
+		 * the desired UART phys and virt addresses temporarily into
+		 * the omap_uart_phys and omap_uart_virt above.
+		 */
 		.macro	addruart, rx, tmp
+
+		/* Use omap_uart_phys/virt if already configured */
+10:		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		ldreq	\rx, =omap_uart_phys	@ physical base address
+		ldrne	\rx, =omap_uart_virt	@ virtual base address
+		ldr	\rx, [\rx, #0]
+		cmp	\rx, #0			@ is port configured?
+		bne	99f			@ already configured
+
+		/* Check UART1 scratchpad register for uart to use */
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
-#ifdef  CONFIG_ARCH_OMAP2
 		moveq	\rx, #0x48000000	@ physical base address
 		movne	\rx, #0xfa000000	@ virtual base
-		orr	\rx, \rx, #0x0006a000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
-		add	\rx, \rx, #0x00002000	@ UART 2
-#endif
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		add	\rx, \rx, #0x00004000	@ UART 3
-#endif
-
-#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
-		moveq	\rx, #0x48000000	@ physical base address
-		movne	\rx, #0xfa000000	@ virtual base
-		orr	\rx, \rx, #0x0006a000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
-		add	\rx, \rx, #0x00002000	@ UART 2
-#endif
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-		add	\rx, \rx, #0x00fb0000	@ UART 3
-		add	\rx, \rx, #0x00006000
-#endif
-#endif
+		orr	\rx, \rx, #0x0006a000	@ uart1 on omap2/3/4
+		ldrb	\rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)] @ scratchpad
+
+		/* Select the UART to use based on the UART1 scratchpad value */
+		cmp	\rx, #0			@ no port configured?
+		beq	21f			@ if none, try to use UART1
+		cmp	\rx, #OMAP2UART1	@ OMAP2/3/4UART1
+		beq	21f			@ configure OMAP2/3/4UART1
+		cmp	\rx, #OMAP2UART2	@ OMAP2/3/4UART2
+		beq	22f			@ configure OMAP2/3/4UART2
+		cmp	\rx, #OMAP2UART3	@ only on 24xx
+		beq	23f			@ configure OMAP2UART3
+		cmp	\rx, #OMAP3UART3	@ only on 34xx
+		beq	33f			@ configure OMAP3UART3
+		cmp	\rx, #OMAP4UART3	@ only on 44xx
+		beq	43f			@ configure OMAP4UART3
+		cmp	\rx, #OMAP3UART4	@ only on 36xx
+		beq	34f			@ configure OMAP3UART4
+		cmp	\rx, #OMAP4UART4	@ only on 44xx
+		beq	44f			@ configure OMAP4UART4
+		cmp	\rx, #ZOOM_UART		@ only on zoom2/3
+		beq	95f			@ configure ZOOM_UART
+
+		/* Configure the UART offset from the phys/virt base */
+21:		mov	\rx, #UART_OFFSET(OMAP2_UART1_BASE)	@ omap2/3/4
+		b	98f
+22:		mov	\rx, #UART_OFFSET(OMAP2_UART2_BASE)	@ omap2/3/4
+		b	98f
+23:		mov	\rx, #UART_OFFSET(OMAP2_UART3_BASE)
+		b	98f
+33:		mov	\rx, #UART_OFFSET(OMAP3_UART1_BASE)
+		add	\rx, \rx, #0x00fb0000
+		add	\rx, \rx, #0x00006000		@ OMAP3_UART3_BASE
+		b	98f
+34:		mov	\rx, #UART_OFFSET(OMAP3_UART1_BASE)
+		add	\rx, \rx, #0x00fb0000
+		add	\rx, \rx, #0x00028000		@ OMAP3_UART4_BASE
+		b	98f
+43:		mov	\rx, #UART_OFFSET(OMAP4_UART3_BASE)
+		b	98f
+44:		mov	\rx, #UART_OFFSET(OMAP4_UART4_BASE)
+		b	98f
+95:		mov	\rx, #ZOOM_UART_BASE
+		ldr	\tmp, =omap_uart_phys
+		str	\rx, [\tmp, #0]
+		mov	\rx, #ZOOM_UART_VIRT
+		ldr	\tmp, =omap_uart_virt
+		str	\rx, [\tmp, #0]
+		mov	\rx, #(UART_LSR << ZOOM_PORT_SHIFT)
+		ldr	\tmp, =omap_uart_lsr
+		str	\rx, [\tmp, #0]
+		b	10b
+
+		/* Store both phys and virt address for the uart */
+98:		add	\rx, \rx, #0x48000000	@ phys base
+		ldr	\tmp, =omap_uart_phys
+		str	\rx, [\tmp, #0]
+		sub	\rx, \rx, #0x48000000	@ phys base
+		add	\rx, \rx, #0xfa000000	@ virt base
+		ldr	\tmp, =omap_uart_virt
+		str	\rx, [\tmp, #0]
+		mov	\rx, #(UART_LSR << OMAP_PORT_SHIFT)
+		ldr	\tmp, =omap_uart_lsr
+		str	\rx, [\tmp, #0]
+
+		b	10b
+99:
 		.endm
 
 		.macro	senduart,rd,rx
@@ -48,7 +119,9 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-1001:		ldrb	\rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
+1001:		ldr	\rd, =omap_uart_lsr
+		ldr	\rd, [\rd, #0]
+		ldrb	\rd, [\rx, \rd]
 		and	\rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		teq	\rd, #(UART_LSR_TEMT | UART_LSR_THRE)
 		bne	1001b
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index 7f5a7a8..67ffa08 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -26,24 +26,49 @@
 #define OMAP2_UART3_BASE	0x4806e000
 
 /* OMAP3 serial ports */
-#define OMAP3_UART1_BASE	0x4806a000
-#define OMAP3_UART2_BASE	0x4806c000
+#define OMAP3_UART1_BASE	OMAP2_UART1_BASE
+#define OMAP3_UART2_BASE	OMAP2_UART2_BASE
 #define OMAP3_UART3_BASE	0x49020000
 #define OMAP3_UART4_BASE	0x49042000	/* Only on 36xx */
 
 /* OMAP4 serial ports */
-#define OMAP4_UART1_BASE	0x4806a000
-#define OMAP4_UART2_BASE	0x4806c000
+#define OMAP4_UART1_BASE	OMAP2_UART1_BASE
+#define OMAP4_UART2_BASE	OMAP2_UART1_BASE
 #define OMAP4_UART3_BASE	0x48020000
 #define OMAP4_UART4_BASE	0x4806e000
 
+/* External port on Zoom2/3 */
+#define ZOOM_UART_BASE		0x10000000
+#define ZOOM_UART_VIRT		0xfb000000
+
 #define OMAP_PORT_SHIFT		2
 #define OMAP7XX_PORT_SHIFT	0
+#define ZOOM_PORT_SHIFT		1
 
 #define OMAP1510_BASE_BAUD	(12000000/16)
 #define OMAP16XX_BASE_BAUD	(48000000/16)
 #define OMAP24XX_BASE_BAUD	(48000000/16)
 
+/*
+ * DEBUG_LL port encoding stored into the UART1 scratchpad register by
+ * decomp_setup in uncompress.h
+ */
+#define OMAP1UART1		11
+#define OMAP1UART2		12
+#define OMAP1UART3		13
+#define OMAP2UART1		21
+#define OMAP2UART2		22
+#define OMAP2UART3		23
+#define OMAP3UART1		OMAP2UART1
+#define OMAP3UART2		OMAP2UART2
+#define OMAP3UART3		33
+#define OMAP3UART4		34		/* Only on 36xx */
+#define OMAP4UART1		OMAP2UART1
+#define OMAP4UART2		OMAP2UART2
+#define OMAP4UART3		43
+#define OMAP4UART4		44
+#define ZOOM_UART		95		/* Only on zoom2/3 */
+
 /* This is only used by 8250.c for omap1510 */
 #define is_omap_port(pt)	({int __ret = 0;			\
 			if ((pt)->port.mapbase == OMAP1_UART1_BASE ||	\
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index e5723c3..f426d68 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -19,63 +19,38 @@
 
 #include <linux/types.h>
 #include <linux/serial_reg.h>
+
+#include <asm/mach-types.h>
+
 #include <plat/serial.h>
 
-unsigned int system_rev;
+static volatile u8 *uart1_base;
+static volatile int uart1_shift;
 
-#define UART_OMAP_MDR1		0x08	/* mode definition register */
-#define OMAP_ID_730		0x355F
-#define OMAP_ID_850		0x362C
-#define ID_MASK			0x7fff
-#define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
-#define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK
+static volatile u8 *uart_base;
+static volatile int uart_shift;
 
-static void putc(int c)
+/*
+ * Store the DEBUG_LL uart number into UART1 scratchpad register.
+ * See also debug-macro.S, and serial.c for related code.
+ *
+ * Please note that we currently assume that:
+ * - UART1 clocks are enabled for register access
+ * - UART1 scratchpad register can be used
+ */
+static void set_uart1_scratchpad(unsigned char port)
 {
-	volatile u8 * uart = 0;
-	int shift = 2;
-
-#ifdef CONFIG_MACH_OMAP_PALMTE
-	return;
-#endif
-
-#ifdef CONFIG_ARCH_OMAP
-	/* Will get removed in the next patch, set to OMAP3 to compile */
-#ifdef	CONFIG_OMAP_LL_DEBUG_UART3
-	uart = (volatile u8 *)(OMAP3_UART3_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
-	uart = (volatile u8 *)(OMAP3_UART2_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_UART1)
-	uart = (volatile u8 *)(OMAP3_UART1_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_NONE)
-	return;
-#else
-	return;
-#endif
-
-#ifdef CONFIG_ARCH_OMAP1
-	/* Determine which serial port to use */
-	do {
-		/* MMU is not on, so cpu_is_omapXXXX() won't work here */
-		unsigned int omap_id = omap_get_id();
-
-		if (omap_id == OMAP_ID_730 || omap_id == OMAP_ID_850)
-			shift = 0;
+	uart1_base[UART_SCR << uart1_shift] = port;
+}
 
-		if (check_port(uart, shift))
-			break;
-		/* Silent boot if no serial ports are enabled. */
+static void putc(int c)
+{
+	if (!uart_base)
 		return;
-	} while (0);
-#endif /* CONFIG_ARCH_OMAP1 */
-#endif
 
-	/*
-	 * Now, xmit each character
-	 */
-	while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
+	while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
 		barrier();
-	uart[UART_TX << shift] = c;
+	uart_base[UART_TX << uart_shift] = c;
 }
 
 static inline void flush(void)
@@ -83,7 +58,116 @@ static inline void flush(void)
 }
 
 /*
+ * Macros to configure UART1 and debug UART
+ */
+#define _DEBUG_LL_ENTRY(mach, uart1_phys, uart1_shft,			\
+			dbg_uart, dbg_shft, dbg_id)			\
+	if (machine_is_##mach()) {					\
+		uart1_base = (volatile u8 *)(uart1_phys);		\
+		uart1_shift = (uart1_shft);				\
+		uart_base = (volatile u8 *)(dbg_uart);			\
+		uart_shift = (dbg_shft);				\
+		port = (dbg_id);					\
+		set_uart1_scratchpad(port);				\
+		break;							\
+	}
+
+#define DEBUG_LL_OMAP7XX(p, mach)					\
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART1_BASE, OMAP7XX_PORT_SHIFT,	\
+		OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, OMAP1UART##p)
+
+#define DEBUG_LL_OMAP1(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART1_BASE, OMAP_PORT_SHIFT,	\
+		OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, OMAP1UART##p)
+
+#define DEBUG_LL_OMAP2(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP2_UART1_BASE, OMAP_PORT_SHIFT,	\
+		OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, OMAP2UART##p)
+
+#define DEBUG_LL_OMAP3(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP3_UART1_BASE, OMAP_PORT_SHIFT,	\
+		OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, OMAP3UART##p)
+
+#define DEBUG_LL_OMAP4(p, mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP4_UART1_BASE, OMAP_PORT_SHIFT,	\
+		OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, OMAP4UART##p)
+
+/* Zoom2/3 shift is different for UART1 and external port */
+#define DEBUG_LL_ZOOM(mach)						\
+	_DEBUG_LL_ENTRY(mach, OMAP2_UART1_BASE, OMAP_PORT_SHIFT,	\
+		ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
+
+static inline void __arch_decomp_setup(unsigned long arch_id)
+{
+	int port = 0;
+
+	/*
+	 * Initialize the port based on the machine ID from the bootloader.
+	 * Note that we're using macros here instead of switch statement
+	 * as machine_is functions are optimized out for the boards that
+	 * are not selected.
+	 */
+	do {
+		/* omap7xx/8xx based boards using UART1 with shift 0 */
+		DEBUG_LL_OMAP7XX(1, herald);
+		DEBUG_LL_OMAP7XX(1, omap_perseus2);
+
+		/* omap15xx/16xx based boards using UART1 */
+		DEBUG_LL_OMAP1(1, ams_delta);
+		DEBUG_LL_OMAP1(1, nokia770);
+		DEBUG_LL_OMAP1(1, omap_h2);
+		DEBUG_LL_OMAP1(1, omap_h3);
+		DEBUG_LL_OMAP1(1, omap_innovator);
+		DEBUG_LL_OMAP1(1, omap_osk);
+		DEBUG_LL_OMAP1(1, omap_palmte);
+		DEBUG_LL_OMAP1(1, omap_palmz71);
+
+		/* omap15xx/16xx based boards using UART2 */
+		DEBUG_LL_OMAP1(2, omap_palmtt);
+
+		/* omap15xx/16xx based boards using UART3 */
+		DEBUG_LL_OMAP1(3, sx1);
+
+		/* omap2 based boards using UART1 */
+		DEBUG_LL_OMAP2(1, omap2evm);
+		DEBUG_LL_OMAP2(1, omap_2430sdp);
+		DEBUG_LL_OMAP2(1, omap_apollon);
+		DEBUG_LL_OMAP2(1, omap_h4);
+
+		/* omap2 based boards using UART3 */
+		DEBUG_LL_OMAP2(3, nokia_n800);
+		DEBUG_LL_OMAP2(3, nokia_n810);
+		DEBUG_LL_OMAP2(3, nokia_n810_wimax);
+
+		/* omap3 based boards using UART1 */
+		DEBUG_LL_OMAP2(1, omap3evm);
+		DEBUG_LL_OMAP3(1, omap_3430sdp);
+		DEBUG_LL_OMAP3(1, omap_3630sdp);
+
+		/* omap3 based boards using UART3 */
+		DEBUG_LL_OMAP3(3, cm_t35);
+		DEBUG_LL_OMAP3(3, igep0020);
+		DEBUG_LL_OMAP3(3, nokia_rx51);
+		DEBUG_LL_OMAP3(3, omap3517evm);
+		DEBUG_LL_OMAP3(3, omap3_beagle);
+		DEBUG_LL_OMAP3(3, omap3_pandora);
+		DEBUG_LL_OMAP3(3, omap_ldp);
+		DEBUG_LL_OMAP3(3, overo);
+		DEBUG_LL_OMAP3(3, touchbook);
+
+		/* omap4 based boards using UART3 */
+		DEBUG_LL_OMAP4(3, omap_4430sdp);
+
+		/* zoom2/3 external uart */
+		DEBUG_LL_ZOOM(omap_zoom2);
+		DEBUG_LL_ZOOM(omap_zoom3);
+
+	} while (0);
+}
+
+#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
+
+/*
  * nothing to do
  */
-#define arch_decomp_setup()
 #define arch_decomp_wdog()

^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
@ 2010-01-22  3:07               ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22  3:07 UTC (permalink / raw)
  To: linux-arm-kernel

* Pandita, Vikram <vikram.pandita@ti.com> [100118 17:48]:
>
> >* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
> >
> >> Why not do something like this:
> >>
> >> 		.pushsection .data
> >> omap_uart_phys:	.word 0
> >> omap_uart_virt:	.word 0
> >> 		.popsection

Updated patch below using .data. This assumes getting an additional
tmp register passed to addruart as in the patch I posted earlier.
 
> Also We may need a:
> 	 omap_uart_shift: .word 0 
> Since shift also varies depending on different omap boards
> (external debug board shift=1, internal omap has shift=2)

OK, I've added that too, but for mach-omap2 only. I've also
added an experimental zoom2/3 support.

Care to take try it out and see what happens on a zoom?
 
> Bingo..I think this was the key solution to the problem.
> I had posted long ago similar kind of implementation [1] 
> and I wish rmk had given this nice idea then :)
> 
> [1] http://marc.info/?l=linux-omap&m=125269221820632&w=2
> 	See this part: 
> 	+		.align
> 	+		.type   __phy_uart_addr, #object
> 	+__phy_uart_addr:       .word   0xFF
> 	+		.type   __virt_uart_addr, #object
> 	+__virt_uart_addr:       .word   0xFF

Yeah hopefully we're pretty close to better DEBUG_LL support
for omaps now :)

BTW, I've also pushed these patches into a temporary multi-omap
branch in the linux-omap tree:

http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=shortlog;h=refs/heads/multi-omap

I'll update also the entry-macro.S tomorrow.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
  2010-01-22  3:07               ` Tony Lindgren
@ 2010-01-22 14:48                 ` Pandita, Vikram
  -1 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-22 14:48 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Russell King - ARM Linux, linux-arm-kernel, linux-omap



>-----Original Message-----
>From: Tony Lindgren [mailto:tony@atomide.com]
>Sent: Thursday, January 21, 2010 9:07 PM
>To: Pandita, Vikram
>Cc: Russell King - ARM Linux; linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
>Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
>
>* Pandita, Vikram <vikram.pandita@ti.com> [100118 17:48]:
>>
>> >* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
>> >
>> >> Why not do something like this:
>> >>
>> >> 		.pushsection .data
>> >> omap_uart_phys:	.word 0
>> >> omap_uart_virt:	.word 0
>> >> 		.popsection
>
>Updated patch below using .data. This assumes getting an additional
>tmp register passed to addruart as in the patch I posted earlier.
>
>> Also We may need a:
>> 	 omap_uart_shift: .word 0
>> Since shift also varies depending on different omap boards
>> (external debug board shift=1, internal omap has shift=2)
>
>OK, I've added that too, but for mach-omap2 only. I've also
>added an experimental zoom2/3 support.
>
>Care to take try it out and see what happens on a zoom?

Test on zoom3 failed with multi-omap branch.
Debugging the same, should have a zoom correction patch out today.

>

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
@ 2010-01-22 14:48                 ` Pandita, Vikram
  0 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-22 14:48 UTC (permalink / raw)
  To: linux-arm-kernel



>-----Original Message-----
>From: Tony Lindgren [mailto:tony at atomide.com]
>Sent: Thursday, January 21, 2010 9:07 PM
>To: Pandita, Vikram
>Cc: Russell King - ARM Linux; linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
>Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
>
>* Pandita, Vikram <vikram.pandita@ti.com> [100118 17:48]:
>>
>> >* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 11:31]:
>> >
>> >> Why not do something like this:
>> >>
>> >> 		.pushsection .data
>> >> omap_uart_phys:	.word 0
>> >> omap_uart_virt:	.word 0
>> >> 		.popsection
>
>Updated patch below using .data. This assumes getting an additional
>tmp register passed to addruart as in the patch I posted earlier.
>
>> Also We may need a:
>> 	 omap_uart_shift: .word 0
>> Since shift also varies depending on different omap boards
>> (external debug board shift=1, internal omap has shift=2)
>
>OK, I've added that too, but for mach-omap2 only. I've also
>added an experimental zoom2/3 support.
>
>Care to take try it out and see what happens on a zoom?

Test on zoom3 failed with multi-omap branch.
Debugging the same, should have a zoom correction patch out today.

>

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2
  2010-01-16 11:55     ` Russell King - ARM Linux
@ 2010-01-22 20:39       ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 20:39 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-arm-kernel, linux-omap

[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 03:53]:
> On Fri, Jan 15, 2010 at 05:35:20PM -0800, Tony Lindgren wrote:
> > -#ifndef CONFIG_ARCH_OMAP4
> > +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> > +	defined(CONFIG_ARCH_OMAP34XX)
> > +
> > +#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> > +#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> > +
> > +omap_irq_base:	.word	0x0
> 
> You have no idea where this word will be placed - it could be in the middle
> of a read only section, which might really be read only.  It might also be
> out of reach of the "ldr \base, [pc, #offset]" instructions you're using
> below - which is what an "ldr \base, address" instruction really is.
> 
> > +
> >  		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> > -		ldr	\base, =OMAP2_VA_IC_BASE
> > -		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
> > +		ldr	\base, omap_irq_base
> > +		cmp	\base, #0		@ is irq base configured?
> > +		bne	9998f			@ already configured
> 
> First thing, why not use get_irqnr_preamble to load the base address?
> That means you only do all this computation once per group of IRQs
> processed.
> 
> Secondly, is this really worth the overhead, or can't you move
> omap_irq_base into the data section, and have your IRQ initialization
> function set the pointer?
> 
> You then don't have to make these two tests every time you check for
> an interrupt/enter to process interrupts.

Here's this patch updated. It should now be actually more optimized for
non-multi-omap configurations as it uses the get_irqnr_preamble :)

Regards,

Tony

[-- Attachment #2: multi-omap-entry-macro-v2.patch --]
[-- Type: text/x-diff, Size: 4042 bytes --]

>From 6f9a0d37612db2833d280748bedc9c35a2c366ab Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Fri, 22 Jan 2010 11:36:16 -0800
Subject: [PATCH] omap2/3: Make get_irqnr_and_base common for mach-omap2 multiboot

Make get_irqnr_and_base common for mach-omap2 multiboot

Note that this will only work currently for 24xx and 34xx.

The overhead of this should be minimal, it basically adds one
cmp to see if omap_irq_base has been configured already.
If necessary, we can set separate optimized get_irqnr_and_base
for non-multiboot configurations.

Support for 44xx can be added later on for basic multiboot,
and similar patch should be done for mach-omap1/entry-macro.S.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
index c7f1720..c5ea026 100644
--- a/arch/arm/mach-omap2/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
@@ -17,47 +17,85 @@
 
 #include <plat/omap24xx.h>
 #include <plat/omap34xx.h>
-
-/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
-#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
-#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
-#elif defined(CONFIG_ARCH_OMAP34XX)
-#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
-#endif
-#if defined(CONFIG_ARCH_OMAP4)
 #include <plat/omap44xx.h>
-#endif
-#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
-#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
 
 		.macro	disable_fiq
 		.endm
 
-		.macro  get_irqnr_preamble, base, tmp
-		.endm
-
 		.macro  arch_ret_to_user, tmp1, tmp2
 		.endm
 
-#ifndef CONFIG_ARCH_OMAP4
+#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
+	defined(CONFIG_ARCH_OMAP34XX)
+
+#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
+
+#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_ARCH_OMAP3)
+		/* Configure the interrupt base on the first interrupt */
+		.macro  get_irqnr_preamble, base, tmp
+9:
+		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
+
+		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
+2400:		ldr	\base, =OMAP2_IRQ_BASE
+		ldr	\tmp, =omap_irq_base
+		str	\base, [\tmp, #0]
+		b	9b
+3400:		ldr	\base, =OMAP3_IRQ_BASE
+		ldr	\tmp, =omap_irq_base
+		str	\base, [\tmp, #0]
+		b	9b
+9998:
+		.endm
+#else
+		.macro  get_irqnr_preamble, base, tmp
+#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
+		ldr	\base, =OMAP2_IRQ_BASE
+#else
+		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	\base, =OMAP2_VA_IC_BASE
 		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
 		cmp	\irqnr, #0x0
-		bne	2222f
+		bne	9999f
 		ldr	\irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
 		cmp	\irqnr, #0x0
-		bne	2222f
+		bne	9999f
 		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
 		cmp	\irqnr, #0x0
-2222:
+9999:
 		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
 		and	\irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
 
 		.endm
-#else
+#endif
+
+
+#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
+
 		/*
 		 * The interrupt numbering scheme is defined in the
 		 * interrupt controller spec.  To wit:

^ permalink raw reply related	[flat|nested] 76+ messages in thread

* [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2
@ 2010-01-22 20:39       ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 20:39 UTC (permalink / raw)
  To: linux-arm-kernel

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100116 03:53]:
> On Fri, Jan 15, 2010 at 05:35:20PM -0800, Tony Lindgren wrote:
> > -#ifndef CONFIG_ARCH_OMAP4
> > +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> > +	defined(CONFIG_ARCH_OMAP34XX)
> > +
> > +#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> > +#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> > +
> > +omap_irq_base:	.word	0x0
> 
> You have no idea where this word will be placed - it could be in the middle
> of a read only section, which might really be read only.  It might also be
> out of reach of the "ldr \base, [pc, #offset]" instructions you're using
> below - which is what an "ldr \base, address" instruction really is.
> 
> > +
> >  		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> > -		ldr	\base, =OMAP2_VA_IC_BASE
> > -		ldr	\irqnr, [\base, #0x98] /* IRQ pending reg 1 */
> > +		ldr	\base, omap_irq_base
> > +		cmp	\base, #0		@ is irq base configured?
> > +		bne	9998f			@ already configured
> 
> First thing, why not use get_irqnr_preamble to load the base address?
> That means you only do all this computation once per group of IRQs
> processed.
> 
> Secondly, is this really worth the overhead, or can't you move
> omap_irq_base into the data section, and have your IRQ initialization
> function set the pointer?
> 
> You then don't have to make these two tests every time you check for
> an interrupt/enter to process interrupts.

Here's this patch updated. It should now be actually more optimized for
non-multi-omap configurations as it uses the get_irqnr_preamble :)

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
  2010-01-22 14:48                 ` Pandita, Vikram
@ 2010-01-22 20:55                   ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 20:55 UTC (permalink / raw)
  To: Pandita, Vikram; +Cc: Russell King - ARM Linux, linux-arm-kernel, linux-omap

* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
> >
> >OK, I've added that too, but for mach-omap2 only. I've also
> >added an experimental zoom2/3 support.
> >
> >Care to take try it out and see what happens on a zoom?
> 
> Test on zoom3 failed with multi-omap branch.
> Debugging the same, should have a zoom correction patch out today.

Heh OK. I just pushed more updates into the multi-omap branch
if you want to try to boot zoom2/zoom3 using the same .config.

There are still issues with booting 2420 though..

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
@ 2010-01-22 20:55                   ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 20:55 UTC (permalink / raw)
  To: linux-arm-kernel

* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
> >
> >OK, I've added that too, but for mach-omap2 only. I've also
> >added an experimental zoom2/3 support.
> >
> >Care to take try it out and see what happens on a zoom?
> 
> Test on zoom3 failed with multi-omap branch.
> Debugging the same, should have a zoom correction patch out today.

Heh OK. I just pushed more updates into the multi-omap branch
if you want to try to boot zoom2/zoom3 using the same .config.

There are still issues with booting 2420 though..

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2
  2010-01-22 20:39       ` Tony Lindgren
@ 2010-01-22 20:56         ` Russell King - ARM Linux
  -1 siblings, 0 replies; 76+ messages in thread
From: Russell King - ARM Linux @ 2010-01-22 20:56 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

On Fri, Jan 22, 2010 at 12:39:53PM -0800, Tony Lindgren wrote:
> Here's this patch updated. It should now be actually more optimized for
> non-multi-omap configurations as it uses the get_irqnr_preamble :)

And the patch looks a lot cleaner and easier to read.

> diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
> index c7f1720..c5ea026 100644
> --- a/arch/arm/mach-omap2/include/mach/entry-macro.S
> +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
> @@ -17,47 +17,85 @@
>  
>  #include <plat/omap24xx.h>
>  #include <plat/omap34xx.h>
> -
> -/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
> -#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
> -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> -#elif defined(CONFIG_ARCH_OMAP34XX)
> -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> -#endif
> -#if defined(CONFIG_ARCH_OMAP4)
>  #include <plat/omap44xx.h>
> -#endif
> -#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> -#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
>  
>  		.macro	disable_fiq
>  		.endm
>  
> -		.macro  get_irqnr_preamble, base, tmp
> -		.endm
> -
>  		.macro  arch_ret_to_user, tmp1, tmp2
>  		.endm
>  
> -#ifndef CONFIG_ARCH_OMAP4
> +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> +	defined(CONFIG_ARCH_OMAP34XX)

Isn't this equivalent to:

#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
> +
> +#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_ARCH_OMAP3)
> +		/* Configure the interrupt base on the first interrupt */
> +		.macro  get_irqnr_preamble, base, tmp
> +9:
> +		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
> +
> +		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
> +2400:		ldr	\base, =OMAP2_IRQ_BASE
> +		ldr	\tmp, =omap_irq_base
> +		str	\base, [\tmp, #0]
> +		b	9b
> +3400:		ldr	\base, =OMAP3_IRQ_BASE
> +		ldr	\tmp, =omap_irq_base
> +		str	\base, [\tmp, #0]
> +		b	9b
> +9998:
> +		.endm
> +#else
> +		.macro  get_irqnr_preamble, base, tmp
> +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)

And this

#elif defined(CONFIG_ARCH_OMAP2)

?

> +		ldr	\base, =OMAP2_IRQ_BASE
> +#else
> +		ldr	\base, =OMAP3_IRQ_BASE
> +#endif

Whereas I can see the sense in loading 'base' here directly, I don't see
the point of finding a value for omap_irq_base in assembly code, when you
have to do IRQ initialization in C code.  In fact, you're already sorting
this out in omap_init_irq().

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2
@ 2010-01-22 20:56         ` Russell King - ARM Linux
  0 siblings, 0 replies; 76+ messages in thread
From: Russell King - ARM Linux @ 2010-01-22 20:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 22, 2010 at 12:39:53PM -0800, Tony Lindgren wrote:
> Here's this patch updated. It should now be actually more optimized for
> non-multi-omap configurations as it uses the get_irqnr_preamble :)

And the patch looks a lot cleaner and easier to read.

> diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
> index c7f1720..c5ea026 100644
> --- a/arch/arm/mach-omap2/include/mach/entry-macro.S
> +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
> @@ -17,47 +17,85 @@
>  
>  #include <plat/omap24xx.h>
>  #include <plat/omap34xx.h>
> -
> -/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
> -#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
> -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> -#elif defined(CONFIG_ARCH_OMAP34XX)
> -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> -#endif
> -#if defined(CONFIG_ARCH_OMAP4)
>  #include <plat/omap44xx.h>
> -#endif
> -#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> -#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
>  
>  		.macro	disable_fiq
>  		.endm
>  
> -		.macro  get_irqnr_preamble, base, tmp
> -		.endm
> -
>  		.macro  arch_ret_to_user, tmp1, tmp2
>  		.endm
>  
> -#ifndef CONFIG_ARCH_OMAP4
> +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> +	defined(CONFIG_ARCH_OMAP34XX)

Isn't this equivalent to:

#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
> +
> +#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_ARCH_OMAP3)
> +		/* Configure the interrupt base on the first interrupt */
> +		.macro  get_irqnr_preamble, base, tmp
> +9:
> +		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
> +
> +		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
> +2400:		ldr	\base, =OMAP2_IRQ_BASE
> +		ldr	\tmp, =omap_irq_base
> +		str	\base, [\tmp, #0]
> +		b	9b
> +3400:		ldr	\base, =OMAP3_IRQ_BASE
> +		ldr	\tmp, =omap_irq_base
> +		str	\base, [\tmp, #0]
> +		b	9b
> +9998:
> +		.endm
> +#else
> +		.macro  get_irqnr_preamble, base, tmp
> +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)

And this

#elif defined(CONFIG_ARCH_OMAP2)

?

> +		ldr	\base, =OMAP2_IRQ_BASE
> +#else
> +		ldr	\base, =OMAP3_IRQ_BASE
> +#endif

Whereas I can see the sense in loading 'base' here directly, I don't see
the point of finding a value for omap_irq_base in assembly code, when you
have to do IRQ initialization in C code.  In fact, you're already sorting
this out in omap_init_irq().

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
  2010-01-22 20:55                   ` Tony Lindgren
@ 2010-01-22 20:58                     ` Pandita, Vikram
  -1 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-22 20:58 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Russell King - ARM Linux, linux-arm-kernel, linux-omap



>-----Original Message-----
>From: Tony Lindgren [mailto:tony@atomide.com]
>Sent: Friday, January 22, 2010 2:55 PM
>To: Pandita, Vikram
>Cc: Russell King - ARM Linux; linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
>Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
>
>* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
>> >
>> >OK, I've added that too, but for mach-omap2 only. I've also
>> >added an experimental zoom2/3 support.
>> >
>> >Care to take try it out and see what happens on a zoom?
>>
>> Test on zoom3 failed with multi-omap branch.
>> Debugging the same, should have a zoom correction patch out today.
>
>Heh OK. I just pushed more updates into the multi-omap branch
>if you want to try to boot zoom2/zoom3 using the same .config.

Refreshed my tree and I don't see your patches yet.

>
>There are still issues with booting 2420 though..
>
>Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
@ 2010-01-22 20:58                     ` Pandita, Vikram
  0 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-22 20:58 UTC (permalink / raw)
  To: linux-arm-kernel



>-----Original Message-----
>From: Tony Lindgren [mailto:tony at atomide.com]
>Sent: Friday, January 22, 2010 2:55 PM
>To: Pandita, Vikram
>Cc: Russell King - ARM Linux; linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
>Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
>
>* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
>> >
>> >OK, I've added that too, but for mach-omap2 only. I've also
>> >added an experimental zoom2/3 support.
>> >
>> >Care to take try it out and see what happens on a zoom?
>>
>> Test on zoom3 failed with multi-omap branch.
>> Debugging the same, should have a zoom correction patch out today.
>
>Heh OK. I just pushed more updates into the multi-omap branch
>if you want to try to boot zoom2/zoom3 using the same .config.

Refreshed my tree and I don't see your patches yet.

>
>There are still issues with booting 2420 though..
>
>Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2
  2010-01-22 20:56         ` Russell King - ARM Linux
@ 2010-01-22 21:09           ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 21:09 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-arm-kernel, linux-omap

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100122 12:54]:
> On Fri, Jan 22, 2010 at 12:39:53PM -0800, Tony Lindgren wrote:
> > Here's this patch updated. It should now be actually more optimized for
> > non-multi-omap configurations as it uses the get_irqnr_preamble :)
> 
> And the patch looks a lot cleaner and easier to read.
> 
> > diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
> > index c7f1720..c5ea026 100644
> > --- a/arch/arm/mach-omap2/include/mach/entry-macro.S
> > +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
> > @@ -17,47 +17,85 @@
> >  
> >  #include <plat/omap24xx.h>
> >  #include <plat/omap34xx.h>
> > -
> > -/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
> > -#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
> > -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> > -#elif defined(CONFIG_ARCH_OMAP34XX)
> > -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> > -#endif
> > -#if defined(CONFIG_ARCH_OMAP4)
> >  #include <plat/omap44xx.h>
> > -#endif
> > -#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> > -#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> >  
> >  		.macro	disable_fiq
> >  		.endm
> >  
> > -		.macro  get_irqnr_preamble, base, tmp
> > -		.endm
> > -
> >  		.macro  arch_ret_to_user, tmp1, tmp2
> >  		.endm
> >  
> > -#ifndef CONFIG_ARCH_OMAP4
> > +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> > +	defined(CONFIG_ARCH_OMAP34XX)
> 
> Isn't this equivalent to:
> 
> #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
> 
> ?

Hmm, I guess it's not like that yet, but will be hopefully
soon.

Currently I believe we have CONFIG_ARCH_OMAP2 selected
for CONFIG_ARCH_OMAP3 too..

I have a set of patches that will remove the overlapping
Kconfig options. Basically I'm planning to convert:

CONFIG_ARCH_OMAP1	= arch/arm/mach-omap1
CONFIG_ARCH_OMAP2PLUS	= arch/arm/mach-omap2
CONFIG_ARCH_OMAP2	= defined(CONFIG_CPU_OMAP2420) || defined(CONFIG_CPU_OMAP2430)
CONFIG_ARCH_OMAP3	= defined(CONFIG_CPU_OMAP3430) || defined(CONFIG_CPU_OMAP3630)
CONFIG_ARCH_OMAP4	= stays the same

That will get rid of the double meaning for current
CONFIG_ARCH_OMAP2, and get rid of CONFIG_ARCH_OMAP24XX
and CONFIG_ARCH_OMAP34XX. Will post after I've updated
those patches again, hopefully during next week.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2
@ 2010-01-22 21:09           ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 21:09 UTC (permalink / raw)
  To: linux-arm-kernel

* Russell King - ARM Linux <linux@arm.linux.org.uk> [100122 12:54]:
> On Fri, Jan 22, 2010 at 12:39:53PM -0800, Tony Lindgren wrote:
> > Here's this patch updated. It should now be actually more optimized for
> > non-multi-omap configurations as it uses the get_irqnr_preamble :)
> 
> And the patch looks a lot cleaner and easier to read.
> 
> > diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
> > index c7f1720..c5ea026 100644
> > --- a/arch/arm/mach-omap2/include/mach/entry-macro.S
> > +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
> > @@ -17,47 +17,85 @@
> >  
> >  #include <plat/omap24xx.h>
> >  #include <plat/omap34xx.h>
> > -
> > -/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
> > -#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
> > -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> > -#elif defined(CONFIG_ARCH_OMAP34XX)
> > -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> > -#endif
> > -#if defined(CONFIG_ARCH_OMAP4)
> >  #include <plat/omap44xx.h>
> > -#endif
> > -#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> > -#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> >  
> >  		.macro	disable_fiq
> >  		.endm
> >  
> > -		.macro  get_irqnr_preamble, base, tmp
> > -		.endm
> > -
> >  		.macro  arch_ret_to_user, tmp1, tmp2
> >  		.endm
> >  
> > -#ifndef CONFIG_ARCH_OMAP4
> > +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> > +	defined(CONFIG_ARCH_OMAP34XX)
> 
> Isn't this equivalent to:
> 
> #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
> 
> ?

Hmm, I guess it's not like that yet, but will be hopefully
soon.

Currently I believe we have CONFIG_ARCH_OMAP2 selected
for CONFIG_ARCH_OMAP3 too..

I have a set of patches that will remove the overlapping
Kconfig options. Basically I'm planning to convert:

CONFIG_ARCH_OMAP1	= arch/arm/mach-omap1
CONFIG_ARCH_OMAP2PLUS	= arch/arm/mach-omap2
CONFIG_ARCH_OMAP2	= defined(CONFIG_CPU_OMAP2420) || defined(CONFIG_CPU_OMAP2430)
CONFIG_ARCH_OMAP3	= defined(CONFIG_CPU_OMAP3430) || defined(CONFIG_CPU_OMAP3630)
CONFIG_ARCH_OMAP4	= stays the same

That will get rid of the double meaning for current
CONFIG_ARCH_OMAP2, and get rid of CONFIG_ARCH_OMAP24XX
and CONFIG_ARCH_OMAP34XX. Will post after I've updated
those patches again, hopefully during next week.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
  2010-01-22 20:58                     ` Pandita, Vikram
@ 2010-01-22 21:10                       ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 21:10 UTC (permalink / raw)
  To: Pandita, Vikram; +Cc: Russell King - ARM Linux, linux-arm-kernel, linux-omap

* Pandita, Vikram <vikram.pandita@ti.com> [100122 12:56]:
> 
> 
> >-----Original Message-----
> >From: Tony Lindgren [mailto:tony@atomide.com]
> >Sent: Friday, January 22, 2010 2:55 PM
> >To: Pandita, Vikram
> >Cc: Russell King - ARM Linux; linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
> >Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
> >
> >* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
> >> >
> >> >OK, I've added that too, but for mach-omap2 only. I've also
> >> >added an experimental zoom2/3 support.
> >> >
> >> >Care to take try it out and see what happens on a zoom?
> >>
> >> Test on zoom3 failed with multi-omap branch.
> >> Debugging the same, should have a zoom correction patch out today.
> >
> >Heh OK. I just pushed more updates into the multi-omap branch
> >if you want to try to boot zoom2/zoom3 using the same .config.
> 
> Refreshed my tree and I don't see your patches yet.

Takes a few minutes to get mirrored from master.kernel.org..

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
@ 2010-01-22 21:10                       ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 21:10 UTC (permalink / raw)
  To: linux-arm-kernel

* Pandita, Vikram <vikram.pandita@ti.com> [100122 12:56]:
> 
> 
> >-----Original Message-----
> >From: Tony Lindgren [mailto:tony at atomide.com]
> >Sent: Friday, January 22, 2010 2:55 PM
> >To: Pandita, Vikram
> >Cc: Russell King - ARM Linux; linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
> >Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
> >
> >* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
> >> >
> >> >OK, I've added that too, but for mach-omap2 only. I've also
> >> >added an experimental zoom2/3 support.
> >> >
> >> >Care to take try it out and see what happens on a zoom?
> >>
> >> Test on zoom3 failed with multi-omap branch.
> >> Debugging the same, should have a zoom correction patch out today.
> >
> >Heh OK. I just pushed more updates into the multi-omap branch
> >if you want to try to boot zoom2/zoom3 using the same .config.
> 
> Refreshed my tree and I don't see your patches yet.

Takes a few minutes to get mirrored from master.kernel.org..

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2
  2010-01-22 21:09           ` Tony Lindgren
@ 2010-01-22 21:16             ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 21:16 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-arm-kernel, linux-omap

* Tony Lindgren <tony@atomide.com> [100122 13:07]:
> * Russell King - ARM Linux <linux@arm.linux.org.uk> [100122 12:54]:
> > On Fri, Jan 22, 2010 at 12:39:53PM -0800, Tony Lindgren wrote:
> > > Here's this patch updated. It should now be actually more optimized for
> > > non-multi-omap configurations as it uses the get_irqnr_preamble :)
> > 
> > And the patch looks a lot cleaner and easier to read.
> > 
> > > diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
> > > index c7f1720..c5ea026 100644
> > > --- a/arch/arm/mach-omap2/include/mach/entry-macro.S
> > > +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
> > > @@ -17,47 +17,85 @@
> > >  
> > >  #include <plat/omap24xx.h>
> > >  #include <plat/omap34xx.h>
> > > -
> > > -/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
> > > -#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
> > > -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> > > -#elif defined(CONFIG_ARCH_OMAP34XX)
> > > -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> > > -#endif
> > > -#if defined(CONFIG_ARCH_OMAP4)
> > >  #include <plat/omap44xx.h>
> > > -#endif
> > > -#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> > > -#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> > >  
> > >  		.macro	disable_fiq
> > >  		.endm
> > >  
> > > -		.macro  get_irqnr_preamble, base, tmp
> > > -		.endm
> > > -
> > >  		.macro  arch_ret_to_user, tmp1, tmp2
> > >  		.endm
> > >  
> > > -#ifndef CONFIG_ARCH_OMAP4
> > > +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> > > +	defined(CONFIG_ARCH_OMAP34XX)
> > 
> > Isn't this equivalent to:
> > 
> > #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
> > 
> > ?
> 
> Hmm, I guess it's not like that yet, but will be hopefully
> soon.
> 
> Currently I believe we have CONFIG_ARCH_OMAP2 selected
> for CONFIG_ARCH_OMAP3 too..

Hmm, never mind, I guess that issue is sorted out already.
So will update the patch accordingly. Other confusing
Kconfig options still remain, see below.
 
> I have a set of patches that will remove the overlapping
> Kconfig options. Basically I'm planning to convert:
> 
> CONFIG_ARCH_OMAP1	= arch/arm/mach-omap1
> CONFIG_ARCH_OMAP2PLUS	= arch/arm/mach-omap2
> CONFIG_ARCH_OMAP2	= defined(CONFIG_CPU_OMAP2420) || defined(CONFIG_CPU_OMAP2430)
> CONFIG_ARCH_OMAP3	= defined(CONFIG_CPU_OMAP3430) || defined(CONFIG_CPU_OMAP3630)
> CONFIG_ARCH_OMAP4	= stays the same
> 
> That will get rid of the double meaning for current
> CONFIG_ARCH_OMAP2, and get rid of CONFIG_ARCH_OMAP24XX
> and CONFIG_ARCH_OMAP34XX. Will post after I've updated
> those patches again, hopefully during next week.
> 
> 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] 76+ messages in thread

* [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2
@ 2010-01-22 21:16             ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-22 21:16 UTC (permalink / raw)
  To: linux-arm-kernel

* Tony Lindgren <tony@atomide.com> [100122 13:07]:
> * Russell King - ARM Linux <linux@arm.linux.org.uk> [100122 12:54]:
> > On Fri, Jan 22, 2010 at 12:39:53PM -0800, Tony Lindgren wrote:
> > > Here's this patch updated. It should now be actually more optimized for
> > > non-multi-omap configurations as it uses the get_irqnr_preamble :)
> > 
> > And the patch looks a lot cleaner and easier to read.
> > 
> > > diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
> > > index c7f1720..c5ea026 100644
> > > --- a/arch/arm/mach-omap2/include/mach/entry-macro.S
> > > +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
> > > @@ -17,47 +17,85 @@
> > >  
> > >  #include <plat/omap24xx.h>
> > >  #include <plat/omap34xx.h>
> > > -
> > > -/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
> > > -#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
> > > -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
> > > -#elif defined(CONFIG_ARCH_OMAP34XX)
> > > -#define OMAP2_VA_IC_BASE		OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
> > > -#endif
> > > -#if defined(CONFIG_ARCH_OMAP4)
> > >  #include <plat/omap44xx.h>
> > > -#endif
> > > -#define INTCPS_SIR_IRQ_OFFSET	0x0040		/* Active interrupt offset */
> > > -#define	ACTIVEIRQ_MASK		0x7f		/* Active interrupt bits */
> > >  
> > >  		.macro	disable_fiq
> > >  		.endm
> > >  
> > > -		.macro  get_irqnr_preamble, base, tmp
> > > -		.endm
> > > -
> > >  		.macro  arch_ret_to_user, tmp1, tmp2
> > >  		.endm
> > >  
> > > -#ifndef CONFIG_ARCH_OMAP4
> > > +#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) || \
> > > +	defined(CONFIG_ARCH_OMAP34XX)
> > 
> > Isn't this equivalent to:
> > 
> > #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
> > 
> > ?
> 
> Hmm, I guess it's not like that yet, but will be hopefully
> soon.
> 
> Currently I believe we have CONFIG_ARCH_OMAP2 selected
> for CONFIG_ARCH_OMAP3 too..

Hmm, never mind, I guess that issue is sorted out already.
So will update the patch accordingly. Other confusing
Kconfig options still remain, see below.
 
> I have a set of patches that will remove the overlapping
> Kconfig options. Basically I'm planning to convert:
> 
> CONFIG_ARCH_OMAP1	= arch/arm/mach-omap1
> CONFIG_ARCH_OMAP2PLUS	= arch/arm/mach-omap2
> CONFIG_ARCH_OMAP2	= defined(CONFIG_CPU_OMAP2420) || defined(CONFIG_CPU_OMAP2430)
> CONFIG_ARCH_OMAP3	= defined(CONFIG_CPU_OMAP3430) || defined(CONFIG_CPU_OMAP3630)
> CONFIG_ARCH_OMAP4	= stays the same
> 
> That will get rid of the double meaning for current
> CONFIG_ARCH_OMAP2, and get rid of CONFIG_ARCH_OMAP24XX
> and CONFIG_ARCH_OMAP34XX. Will post after I've updated
> those patches again, hopefully during next week.
> 
> Regards,
> 
> Tony
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 76+ messages in thread

* RE: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
  2010-01-22 21:10                       ` Tony Lindgren
@ 2010-01-22 23:10                         ` Pandita, Vikram
  -1 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-22 23:10 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Russell King - ARM Linux, linux-arm-kernel, linux-omap

Tony

>-----Original Message-----
>From: Tony Lindgren [mailto:tony@atomide.com]
>Sent: Friday, January 22, 2010 3:11 PM
>To: Pandita, Vikram
>Cc: Russell King - ARM Linux; linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
>Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
>
>* Pandita, Vikram <vikram.pandita@ti.com> [100122 12:56]:
>>
>>
>> >-----Original Message-----
>> >From: Tony Lindgren [mailto:tony@atomide.com]
>> >Sent: Friday, January 22, 2010 2:55 PM
>> >To: Pandita, Vikram
>> >Cc: Russell King - ARM Linux; linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
>> >Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
>> >
>> >* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
>> >> >
>> >> >OK, I've added that too, but for mach-omap2 only. I've also
>> >> >added an experimental zoom2/3 support.
>> >> >
>> >> >Care to take try it out and see what happens on a zoom?
>> >>
>> >> Test on zoom3 failed with multi-omap branch.
>> >> Debugging the same, should have a zoom correction patch out today.
>> >
>> >Heh OK. I just pushed more updates into the multi-omap branch
>> >if you want to try to boot zoom2/zoom3 using the same .config.
>>
>> Refreshed my tree and I don't see your patches yet.
>
>Takes a few minutes to get mirrored from master.kernel.org..

Yes I tried with new branch and zoom2/3 does not work.
Root cause: 
There is a very basic issue in low level code.

We are allowed to create only one Physical to Virtual mapping using MACHINE_START() phys_io and io_pg_offst of size 0x100000(1MB).

Now for zoom2/3 we need to do following:
MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
-       .phys_io        = 0x48000000,
-       .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
+       .phys_io        = 0x1000000, /*ZOOM_UART_BASE*/
+       .io_pg_offst    = ((0xfb000000) >> 18) & 0xfffc, /*ZOOM_UART_VIRT*/
        .boot_params    = 0x80000100,
        .map_io         = omap_zoom_map_io,
        .init_irq       = omap_zoom_init_irq,

This will create mapping:
0x1000000 <-> 0xfb000000 of 1MB

Now that leaves the phy address 0x4800000 omap register mapping, unmapped.

So the code to get scratchpad contents will abort:
arch/arm/mach-omap2/include/mach/debug-macro.S
	moveq   \rx, #0x48000000        @ physical base address
	movne   \rx, #0xfa000000        @ virtual base
	orr     \rx, \rx, #0x0006a000   @ uart1 on omap2/3/4


This seems to be a basic limitation of low level code and I have not clue how to circumvent this.
Thoughts?

Regards,
Vikram 


^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
@ 2010-01-22 23:10                         ` Pandita, Vikram
  0 siblings, 0 replies; 76+ messages in thread
From: Pandita, Vikram @ 2010-01-22 23:10 UTC (permalink / raw)
  To: linux-arm-kernel

Tony

>-----Original Message-----
>From: Tony Lindgren [mailto:tony at atomide.com]
>Sent: Friday, January 22, 2010 3:11 PM
>To: Pandita, Vikram
>Cc: Russell King - ARM Linux; linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
>Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
>
>* Pandita, Vikram <vikram.pandita@ti.com> [100122 12:56]:
>>
>>
>> >-----Original Message-----
>> >From: Tony Lindgren [mailto:tony at atomide.com]
>> >Sent: Friday, January 22, 2010 2:55 PM
>> >To: Pandita, Vikram
>> >Cc: Russell King - ARM Linux; linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
>> >Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
>> >
>> >* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
>> >> >
>> >> >OK, I've added that too, but for mach-omap2 only. I've also
>> >> >added an experimental zoom2/3 support.
>> >> >
>> >> >Care to take try it out and see what happens on a zoom?
>> >>
>> >> Test on zoom3 failed with multi-omap branch.
>> >> Debugging the same, should have a zoom correction patch out today.
>> >
>> >Heh OK. I just pushed more updates into the multi-omap branch
>> >if you want to try to boot zoom2/zoom3 using the same .config.
>>
>> Refreshed my tree and I don't see your patches yet.
>
>Takes a few minutes to get mirrored from master.kernel.org..

Yes I tried with new branch and zoom2/3 does not work.
Root cause: 
There is a very basic issue in low level code.

We are allowed to create only one Physical to Virtual mapping using MACHINE_START() phys_io and io_pg_offst of size 0x100000(1MB).

Now for zoom2/3 we need to do following:
MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
-       .phys_io        = 0x48000000,
-       .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
+       .phys_io        = 0x1000000, /*ZOOM_UART_BASE*/
+       .io_pg_offst    = ((0xfb000000) >> 18) & 0xfffc, /*ZOOM_UART_VIRT*/
        .boot_params    = 0x80000100,
        .map_io         = omap_zoom_map_io,
        .init_irq       = omap_zoom_init_irq,

This will create mapping:
0x1000000 <-> 0xfb000000 of 1MB

Now that leaves the phy address 0x4800000 omap register mapping, unmapped.

So the code to get scratchpad contents will abort:
arch/arm/mach-omap2/include/mach/debug-macro.S
	moveq   \rx, #0x48000000        @ physical base address
	movne   \rx, #0xfa000000        @ virtual base
	orr     \rx, \rx, #0x0006a000   @ uart1 on omap2/3/4


This seems to be a basic limitation of low level code and I have not clue how to circumvent this.
Thoughts?

Regards,
Vikram 

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
  2010-01-22 23:10                         ` Pandita, Vikram
@ 2010-01-23 17:13                           ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-23 17:13 UTC (permalink / raw)
  To: Pandita, Vikram; +Cc: Russell King - ARM Linux, linux-arm-kernel, linux-omap

* Pandita, Vikram <vikram.pandita@ti.com> [100122 15:08]:
> Tony
> 
> >-----Original Message-----
> >From: Tony Lindgren [mailto:tony@atomide.com]
> >Sent: Friday, January 22, 2010 3:11 PM
> >To: Pandita, Vikram
> >Cc: Russell King - ARM Linux; linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
> >Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
> >
> >* Pandita, Vikram <vikram.pandita@ti.com> [100122 12:56]:
> >>
> >>
> >> >-----Original Message-----
> >> >From: Tony Lindgren [mailto:tony@atomide.com]
> >> >Sent: Friday, January 22, 2010 2:55 PM
> >> >To: Pandita, Vikram
> >> >Cc: Russell King - ARM Linux; linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org
> >> >Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
> >> >
> >> >* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
> >> >> >
> >> >> >OK, I've added that too, but for mach-omap2 only. I've also
> >> >> >added an experimental zoom2/3 support.
> >> >> >
> >> >> >Care to take try it out and see what happens on a zoom?
> >> >>
> >> >> Test on zoom3 failed with multi-omap branch.
> >> >> Debugging the same, should have a zoom correction patch out today.
> >> >
> >> >Heh OK. I just pushed more updates into the multi-omap branch
> >> >if you want to try to boot zoom2/zoom3 using the same .config.
> >>
> >> Refreshed my tree and I don't see your patches yet.
> >
> >Takes a few minutes to get mirrored from master.kernel.org..
> 
> Yes I tried with new branch and zoom2/3 does not work.
> Root cause: 
> There is a very basic issue in low level code.
> 
> We are allowed to create only one Physical to Virtual mapping using MACHINE_START() phys_io and io_pg_offst of size 0x100000(1MB).
> 
> Now for zoom2/3 we need to do following:
> MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
> -       .phys_io        = 0x48000000,
> -       .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
> +       .phys_io        = 0x1000000, /*ZOOM_UART_BASE*/
> +       .io_pg_offst    = ((0xfb000000) >> 18) & 0xfffc, /*ZOOM_UART_VIRT*/
>         .boot_params    = 0x80000100,
>         .map_io         = omap_zoom_map_io,
>         .init_irq       = omap_zoom_init_irq,
> 
> This will create mapping:
> 0x1000000 <-> 0xfb000000 of 1MB
> 
> Now that leaves the phy address 0x4800000 omap register mapping, unmapped.

Right, we really need 0x48000000 mapped :)
 
> So the code to get scratchpad contents will abort:
> arch/arm/mach-omap2/include/mach/debug-macro.S
> 	moveq   \rx, #0x48000000        @ physical base address
> 	movne   \rx, #0xfa000000        @ virtual base
> 	orr     \rx, \rx, #0x0006a000   @ uart1 on omap2/3/4
> 
> 
> This seems to be a basic limitation of low level code and I have not clue how to circumvent this.
> Thoughts?

Please take a look at arch/arm/kernel/head.S where you can add
the extra mapping early on.

Hmm, I wonder if we cand nowadays do the extra mapping for zoom
external uart in arch/arm/kernel/early_printk.c?

Are you getting anything out of the zoom uart before MMU is
enabled?

To test this you can temporarily break your kernel by commenting
out the start_kernel line in head-common.S. Then the code falls
through to __error_p and prints out a processor error..

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
@ 2010-01-23 17:13                           ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-23 17:13 UTC (permalink / raw)
  To: linux-arm-kernel

* Pandita, Vikram <vikram.pandita@ti.com> [100122 15:08]:
> Tony
> 
> >-----Original Message-----
> >From: Tony Lindgren [mailto:tony at atomide.com]
> >Sent: Friday, January 22, 2010 3:11 PM
> >To: Pandita, Vikram
> >Cc: Russell King - ARM Linux; linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
> >Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
> >
> >* Pandita, Vikram <vikram.pandita@ti.com> [100122 12:56]:
> >>
> >>
> >> >-----Original Message-----
> >> >From: Tony Lindgren [mailto:tony at atomide.com]
> >> >Sent: Friday, January 22, 2010 2:55 PM
> >> >To: Pandita, Vikram
> >> >Cc: Russell King - ARM Linux; linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org
> >> >Subject: Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2
> >> >
> >> >* Pandita, Vikram <vikram.pandita@ti.com> [100122 06:46]:
> >> >> >
> >> >> >OK, I've added that too, but for mach-omap2 only. I've also
> >> >> >added an experimental zoom2/3 support.
> >> >> >
> >> >> >Care to take try it out and see what happens on a zoom?
> >> >>
> >> >> Test on zoom3 failed with multi-omap branch.
> >> >> Debugging the same, should have a zoom correction patch out today.
> >> >
> >> >Heh OK. I just pushed more updates into the multi-omap branch
> >> >if you want to try to boot zoom2/zoom3 using the same .config.
> >>
> >> Refreshed my tree and I don't see your patches yet.
> >
> >Takes a few minutes to get mirrored from master.kernel.org..
> 
> Yes I tried with new branch and zoom2/3 does not work.
> Root cause: 
> There is a very basic issue in low level code.
> 
> We are allowed to create only one Physical to Virtual mapping using MACHINE_START() phys_io and io_pg_offst of size 0x100000(1MB).
> 
> Now for zoom2/3 we need to do following:
> MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
> -       .phys_io        = 0x48000000,
> -       .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
> +       .phys_io        = 0x1000000, /*ZOOM_UART_BASE*/
> +       .io_pg_offst    = ((0xfb000000) >> 18) & 0xfffc, /*ZOOM_UART_VIRT*/
>         .boot_params    = 0x80000100,
>         .map_io         = omap_zoom_map_io,
>         .init_irq       = omap_zoom_init_irq,
> 
> This will create mapping:
> 0x1000000 <-> 0xfb000000 of 1MB
> 
> Now that leaves the phy address 0x4800000 omap register mapping, unmapped.

Right, we really need 0x48000000 mapped :)
 
> So the code to get scratchpad contents will abort:
> arch/arm/mach-omap2/include/mach/debug-macro.S
> 	moveq   \rx, #0x48000000        @ physical base address
> 	movne   \rx, #0xfa000000        @ virtual base
> 	orr     \rx, \rx, #0x0006a000   @ uart1 on omap2/3/4
> 
> 
> This seems to be a basic limitation of low level code and I have not clue how to circumvent this.
> Thoughts?

Please take a look at arch/arm/kernel/head.S where you can add
the extra mapping early on.

Hmm, I wonder if we cand nowadays do the extra mapping for zoom
external uart in arch/arm/kernel/early_printk.c?

Are you getting anything out of the zoom uart before MMU is
enabled?

To test this you can temporarily break your kernel by commenting
out the start_kernel line in head-common.S. Then the code falls
through to __error_p and prints out a processor error..

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* Re: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
  2010-01-19  1:26     ` Pandita, Vikram
@ 2010-01-26 17:22       ` Tony Lindgren
  -1 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-26 17:22 UTC (permalink / raw)
  To: Pandita, Vikram; +Cc: linux-arm-kernel, linux-omap

Hi,

* Pandita, Vikram <vikram.pandita@ti.com> [100118 17:24]:
> 
> 
> >-----Original Message-----
> >From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony
> >Lindgren
> >Sent: Friday, January 15, 2010 7:35 PM
> >To: linux-arm-kernel@lists.infradead.org
> >Cc: linux-omap@vger.kernel.org
> >Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
> 
> UART_SCR 		-> this is the scratchpad register 
> UART_OMAP_SCR	-> This is TI-only Supplementary control register
> 
> You probably confused the two (as rightly so since SCR is same name).
> So there is no need to save/restore the UART_SCR register as you have done, see inlined -- 
> 
> >
> >Define arch_decomp_setup() the same way as some other
> >architectures do. Use arch_id to configure the debug uart
> >based on the machine_is by storing it into the uart
> >scratchpad register for DEBUG_LL code to use.
> >
> >Signed-off-by: Tony Lindgren <tony@atomide.com>
> <snip>
> >--- a/arch/arm/mach-omap2/serial.c
> >+++ b/arch/arm/mach-omap2/serial.c
> >@@ -161,11 +161,22 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
> > static inline void __init omap_uart_reset(struct omap_uart_state *uart)
> > {
> > 	struct plat_serial8250_port *p = uart->p;
> >+	u8 scratchpad = 0;
> >+
> >+	/*
> >+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
> >+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
> >+	 */
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		scratchpad = serial_read_reg(p, UART_SCR);
> 
> No need to save and restore the UART_SCR register. 
> This never gets used in this function.
> 
> What gets used is UART_OMAP_SCR which is OMAP specific supplimantry control register 
> and not scratchpad.
> 
> >
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
> > 	serial_write_reg(p, UART_OMAP_SCR, 0x08);
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
> > 	serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
> >+
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		serial_write_reg(p, UART_SCR, scratchpad);
> 
> Remove this as well. No need. 

Just to clarify, the uncompress.h code is using the UART_SCR to store the
DEBUG_LL port number based on the machine ID.

The reason this code is not needed is that the earlyprintk code prints
out something already before we get to this code.

If earlyprintk did not print anything before this code, we would need
to save UART_SCR here as the debug serial port gets initialized the first
time something is printed.

Although the code above uses UART_OMAP_SCR and not UART_SCR, it resets
the uart so we lose UART_SCR.

So in any case I've dropped the code above.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

* [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
@ 2010-01-26 17:22       ` Tony Lindgren
  0 siblings, 0 replies; 76+ messages in thread
From: Tony Lindgren @ 2010-01-26 17:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

* Pandita, Vikram <vikram.pandita@ti.com> [100118 17:24]:
> 
> 
> >-----Original Message-----
> >From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Tony
> >Lindgren
> >Sent: Friday, January 15, 2010 7:35 PM
> >To: linux-arm-kernel at lists.infradead.org
> >Cc: linux-omap at vger.kernel.org
> >Subject: [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic
> 
> UART_SCR 		-> this is the scratchpad register 
> UART_OMAP_SCR	-> This is TI-only Supplementary control register
> 
> You probably confused the two (as rightly so since SCR is same name).
> So there is no need to save/restore the UART_SCR register as you have done, see inlined -- 
> 
> >
> >Define arch_decomp_setup() the same way as some other
> >architectures do. Use arch_id to configure the debug uart
> >based on the machine_is by storing it into the uart
> >scratchpad register for DEBUG_LL code to use.
> >
> >Signed-off-by: Tony Lindgren <tony@atomide.com>
> <snip>
> >--- a/arch/arm/mach-omap2/serial.c
> >+++ b/arch/arm/mach-omap2/serial.c
> >@@ -161,11 +161,22 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
> > static inline void __init omap_uart_reset(struct omap_uart_state *uart)
> > {
> > 	struct plat_serial8250_port *p = uart->p;
> >+	u8 scratchpad = 0;
> >+
> >+	/*
> >+	 * Save UART1 scratchpad register value for UART1 for DEBUG_LL.
> >+	 * See also include/plat/uncompress.h and include/mach/debug-macro.S.
> >+	 */
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		scratchpad = serial_read_reg(p, UART_SCR);
> 
> No need to save and restore the UART_SCR register. 
> This never gets used in this function.
> 
> What gets used is UART_OMAP_SCR which is OMAP specific supplimantry control register 
> and not scratchpad.
> 
> >
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
> > 	serial_write_reg(p, UART_OMAP_SCR, 0x08);
> > 	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
> > 	serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
> >+
> >+	if (p->mapbase == OMAP2_UART1_BASE)	/* OMAP2/3/4UART1_BASE */
> >+		serial_write_reg(p, UART_SCR, scratchpad);
> 
> Remove this as well. No need. 

Just to clarify, the uncompress.h code is using the UART_SCR to store the
DEBUG_LL port number based on the machine ID.

The reason this code is not needed is that the earlyprintk code prints
out something already before we get to this code.

If earlyprintk did not print anything before this code, we would need
to save UART_SCR here as the debug serial port gets initialized the first
time something is printed.

Although the code above uses UART_OMAP_SCR and not UART_SCR, it resets
the uart so we lose UART_SCR.

So in any case I've dropped the code above.

Regards,

Tony

^ permalink raw reply	[flat|nested] 76+ messages in thread

end of thread, other threads:[~2010-01-26 17:22 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-16  1:35 [PATCH 0/4] omap multiboot improvments for merge window after 2.6.34 Tony Lindgren
2010-01-16  1:35 ` Tony Lindgren
2010-01-16  1:35 ` [PATCH 1/4] omap: Clean the serial port defines Tony Lindgren
2010-01-16  1:35   ` Tony Lindgren
2010-01-16  7:48   ` Shilimkar, Santosh
2010-01-16  7:48     ` Shilimkar, Santosh
2010-01-16 19:25     ` Tony Lindgren
2010-01-16 19:25       ` Tony Lindgren
2010-01-16 19:33       ` Shilimkar, Santosh
2010-01-16 19:33         ` Shilimkar, Santosh
2010-01-16 20:03         ` Tony Lindgren
2010-01-16 20:03           ` Tony Lindgren
2010-01-19  0:39   ` Pandita, Vikram
2010-01-19  0:39     ` Pandita, Vikram
2010-01-20 23:10     ` Tony Lindgren
2010-01-20 23:10       ` Tony Lindgren
2010-01-16  1:35 ` [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic Tony Lindgren
2010-01-16  1:35   ` Tony Lindgren
2010-01-16  9:35   ` Russell King - ARM Linux
2010-01-16  9:35     ` Russell King - ARM Linux
2010-01-16 19:18     ` Tony Lindgren
2010-01-16 19:18       ` Tony Lindgren
2010-01-16 19:33       ` Russell King - ARM Linux
2010-01-16 19:33         ` Russell King - ARM Linux
2010-01-16 20:00         ` Tony Lindgren
2010-01-16 20:00           ` Tony Lindgren
2010-01-19  1:50           ` Pandita, Vikram
2010-01-19  1:50             ` Pandita, Vikram
2010-01-22  3:07             ` [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic, v2 Tony Lindgren
2010-01-22  3:07               ` Tony Lindgren
2010-01-22 14:48               ` Pandita, Vikram
2010-01-22 14:48                 ` Pandita, Vikram
2010-01-22 20:55                 ` Tony Lindgren
2010-01-22 20:55                   ` Tony Lindgren
2010-01-22 20:58                   ` Pandita, Vikram
2010-01-22 20:58                     ` Pandita, Vikram
2010-01-22 21:10                     ` Tony Lindgren
2010-01-22 21:10                       ` Tony Lindgren
2010-01-22 23:10                       ` Pandita, Vikram
2010-01-22 23:10                         ` Pandita, Vikram
2010-01-23 17:13                         ` Tony Lindgren
2010-01-23 17:13                           ` Tony Lindgren
2010-01-21 19:03         ` [PATCH 2/4] omap: Make uncompress code and DEBUG_LL code generic Tony Lindgren
2010-01-21 19:03           ` Tony Lindgren
2010-01-16 11:04   ` Shilimkar, Santosh
2010-01-16 11:04     ` Shilimkar, Santosh
2010-01-16 19:20     ` Tony Lindgren
2010-01-16 19:20       ` Tony Lindgren
2010-01-16 19:34       ` Shilimkar, Santosh
2010-01-16 19:34         ` Shilimkar, Santosh
2010-01-19  1:26   ` Pandita, Vikram
2010-01-19  1:26     ` Pandita, Vikram
2010-01-19 17:19     ` Kevin Hilman
2010-01-19 17:19       ` Kevin Hilman
2010-01-26 17:22     ` Tony Lindgren
2010-01-26 17:22       ` Tony Lindgren
2010-01-16  1:35 ` [PATCH 3/4] omap: Remove old DEBUG_LL serial port options Tony Lindgren
2010-01-16  1:35   ` Tony Lindgren
2010-01-16  1:35 ` [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot Tony Lindgren
2010-01-16  1:35   ` Tony Lindgren
2010-01-16 11:24   ` Shilimkar, Santosh
2010-01-16 11:24     ` Shilimkar, Santosh
2010-01-16 11:55   ` Russell King - ARM Linux
2010-01-16 11:55     ` Russell King - ARM Linux
2010-01-16 19:12     ` Tony Lindgren
2010-01-16 19:12       ` Tony Lindgren
2010-01-22 20:39     ` [PATCH 4/4] omap: Make get_irqnr_and_base common for mach-omap2 multiboot, v2 Tony Lindgren
2010-01-22 20:39       ` Tony Lindgren
2010-01-22 20:56       ` Russell King - ARM Linux
2010-01-22 20:56         ` Russell King - ARM Linux
2010-01-22 21:09         ` Tony Lindgren
2010-01-22 21:09           ` Tony Lindgren
2010-01-22 21:16           ` Tony Lindgren
2010-01-22 21:16             ` Tony Lindgren
2010-01-16 20:15 ` [PATCH 0/4] omap multiboot improvments for merge window after 2.6.34 Tony Lindgren
2010-01-16 20:15   ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.