All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Change omap DEBUG_LL code to use inituart for AUTO_ZRELADDR and ARM_PATCH_PHYS_VIRT
@ 2011-02-04  1:26 ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:26 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

Here are the changes to make omap DEBUG_LL code generic using
the new inituart macro posted in a separate series. This allows
leaving out the dependency to the uncompress code and allows
error messages when trying to boot a wrong zImage.

Adding support for new machines should be only additional two
lines of assembly per machine after these patches.

Regards,

Tony

---

Tony Lindgren (5):
      omap: Remove code configuring the DEBUG_LL serial port using uncompress code
      omap: Use inituart to configure the debug serial port based on machine ID
      omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
      omap: Combine debug-macro.S for omap1 and omap2+
      omap: Add CONFIG_AUTO_ZRELADDR and CONFIG_ARM_PATCH_PHYS_VIRT to defconfigs


 arch/arm/configs/omap1_defconfig               |    2 
 arch/arm/configs/omap2plus_defconfig           |    2 
 arch/arm/mach-omap1/include/mach/debug-macro.S |   98 ---------
 arch/arm/mach-omap1/serial.c                   |    7 +
 arch/arm/mach-omap2/include/mach/debug-macro.S |  138 -------------
 arch/arm/mach-omap2/serial.c                   |    7 +
 arch/arm/plat-omap/include/plat/debug-macro.S  |  257 ++++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/serial.h       |   34 ---
 arch/arm/plat-omap/include/plat/uncompress.h   |   32 +--
 9 files changed, 284 insertions(+), 293 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/debug-macro.S

-- 
Signature

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

* [PATCH 0/5] Change omap DEBUG_LL code to use inituart for AUTO_ZRELADDR and ARM_PATCH_PHYS_VIRT
@ 2011-02-04  1:26 ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:26 UTC (permalink / raw)
  To: linux-arm-kernel

Here are the changes to make omap DEBUG_LL code generic using
the new inituart macro posted in a separate series. This allows
leaving out the dependency to the uncompress code and allows
error messages when trying to boot a wrong zImage.

Adding support for new machines should be only additional two
lines of assembly per machine after these patches.

Regards,

Tony

---

Tony Lindgren (5):
      omap: Remove code configuring the DEBUG_LL serial port using uncompress code
      omap: Use inituart to configure the debug serial port based on machine ID
      omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
      omap: Combine debug-macro.S for omap1 and omap2+
      omap: Add CONFIG_AUTO_ZRELADDR and CONFIG_ARM_PATCH_PHYS_VIRT to defconfigs


 arch/arm/configs/omap1_defconfig               |    2 
 arch/arm/configs/omap2plus_defconfig           |    2 
 arch/arm/mach-omap1/include/mach/debug-macro.S |   98 ---------
 arch/arm/mach-omap1/serial.c                   |    7 +
 arch/arm/mach-omap2/include/mach/debug-macro.S |  138 -------------
 arch/arm/mach-omap2/serial.c                   |    7 +
 arch/arm/plat-omap/include/plat/debug-macro.S  |  257 ++++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/serial.h       |   34 ---
 arch/arm/plat-omap/include/plat/uncompress.h   |   32 +--
 9 files changed, 284 insertions(+), 293 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/debug-macro.S

-- 
Signature

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

* [PATCH 1/5] omap: Remove code configuring the DEBUG_LL serial port using uncompress code
  2011-02-04  1:26 ` Tony Lindgren
@ 2011-02-04  1:27   ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

This code gets too complex and has a dependency to the uncompress code
for initializing the serial port. The following patches will use inituart
for machine specific debug uart init.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   47 -------------
 arch/arm/mach-omap2/include/mach/debug-macro.S |   84 ------------------------
 arch/arm/plat-omap/include/plat/serial.h       |   34 ----------
 arch/arm/plat-omap/include/plat/uncompress.h   |   32 ++-------
 4 files changed, 9 insertions(+), 188 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index bf0cc57..db2cdf4 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -18,7 +18,6 @@
 #include <plat/serial.h>
 
 #define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
-#define omap_uart_p2v(x)	((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET)
 
 		.pushsection .data
 omap_uart_phys:	.word	0x0
@@ -37,57 +36,13 @@ omap_uart_virt:	.word	0x0
 		.macro	addruart, rp, rv
 
 		/* Use omap_uart_phys/virt if already configured */
-9:		mrc	p15, 0, \rp, c1, c0
+		mrc	p15, 0, \rp, c1, c0
 		tst	\rp, #1			@ MMU enabled?
 		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
 		ldrne	\rp, =omap_uart_phys	@ MMU enabled
 		add	\rv, \rp, #4		@ omap_uart_virt
 		ldr	\rp, [\rp, #0]
 		ldr	\rv, [\rv, #0]
-		cmp	\rp, #0			@ is port configured?
-		cmpne	\rv, #0
-		bne	99f			@ already configured
-
-		/* Check the debug UART configuration set in uncompress.h */
-		mrc	p15, 0, \rp, c1, c0
-		tst	\rp, #1			@ MMU enabled?
-		ldreq	\rp, =OMAP_UART_INFO	@ MMU not enabled
-		ldrne	\rp, =omap_uart_p2v(OMAP_UART_INFO)	@ MMU enabled
-		ldr	\rp, [\rp, #0]
-
-		/* Select the UART to use based on the UART1 scratchpad value */
-10:		cmp	\rp, #0			@ no port configured?
-		beq	11f			@ if none, try to use UART1
-		cmp	\rp, #OMAP1UART1
-		beq	11f			@ configure OMAP1UART1
-		cmp	\rp, #OMAP1UART2
-		beq	12f			@ configure OMAP1UART2
-		cmp	\rp, #OMAP1UART3
-		beq	13f			@ configure OMAP2UART3
-
-		/* Configure the UART offset from the phys/virt base */
-11:		mov	\rp, #0x00fb0000	@ OMAP1UART1
-		b	98f
-12:		mov	\rp, #0x00fb0000	@ OMAP1UART1
-		orr	\rp, \rp, #0x00000800	@ OMAP1UART2
-		b	98f
-13:		mov	\rp, #0x00fb0000	@ OMAP1UART1
-		orr	\rp, \rp, #0x00000800	@ OMAP1UART2
-		orr	\rp, \rp, #0x00009000	@ OMAP1UART3
-
-		/* Store both phys and virt address for the uart */
-98:		add	\rp, \rp, #0xff000000	@ phys base
-		mrc	p15, 0, \rv, c1, c0
-		tst	\rv, #1			@ MMU enabled?
-		ldreq	\rv, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-		ldrne	\rv, =omap_uart_phys	@ MMU enabled
-		str	\rp, [\rv, #0]
-		sub	\rp, \rp, #0xff000000	@ phys base
-		add	\rp, \rp, #0xfe000000	@ virt base
-		add	\rv, \rv, #4		@ omap_uart_lsr
-		str	\rp, [\rv, #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 6bbe2dd..336a838 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -20,7 +20,6 @@
 #define UART_OFFSET(addr)	((addr) & 0x00ffffff)
 
 #define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
-#define omap_uart_p2v(x)	((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET)
 
 		.pushsection .data
 omap_uart_phys:	.word	0
@@ -40,94 +39,13 @@ omap_uart_lsr:	.word	0
 		.macro	addruart, rp, rv
 
 		/* Use omap_uart_phys/virt if already configured */
-10:		mrc	p15, 0, \rp, c1, c0
+		mrc	p15, 0, \rp, c1, c0
 		tst	\rp, #1			@ MMU enabled?
 		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
 		ldrne	\rp, =omap_uart_phys	@ MMU enabled
 		add	\rv, \rp, #4		@ omap_uart_virt
 		ldr	\rp, [\rp, #0]
 		ldr	\rv, [\rv, #0]
-		cmp	\rp, #0			@ is port configured?
-		cmpne	\rv, #0
-		bne	99f			@ already configured
-
-		/* Check the debug UART configuration set in uncompress.h */
-		mrc	p15, 0, \rp, c1, c0
-		tst	\rp, #1			@ MMU enabled?
-		ldreq	\rp, =OMAP_UART_INFO	@ MMU not enabled
-		ldrne	\rp, =omap_uart_p2v(OMAP_UART_INFO)	@ MMU enabled
-		ldr	\rp, [\rp, #0]
-
-		/* Select the UART to use based on the UART1 scratchpad value */
-		cmp	\rp, #0			@ no port configured?
-		beq	21f			@ if none, try to use UART1
-		cmp	\rp, #OMAP2UART1	@ OMAP2/3/4UART1
-		beq	21f			@ configure OMAP2/3/4UART1
-		cmp	\rp, #OMAP2UART2	@ OMAP2/3/4UART2
-		beq	22f			@ configure OMAP2/3/4UART2
-		cmp	\rp, #OMAP2UART3	@ only on 24xx
-		beq	23f			@ configure OMAP2UART3
-		cmp	\rp, #OMAP3UART3	@ only on 34xx
-		beq	33f			@ configure OMAP3UART3
-		cmp	\rp, #OMAP4UART3	@ only on 44xx
-		beq	43f			@ configure OMAP4UART3
-		cmp	\rp, #OMAP3UART4	@ only on 36xx
-		beq	34f			@ configure OMAP3UART4
-		cmp	\rp, #OMAP4UART4	@ only on 44xx
-		beq	44f			@ configure OMAP4UART4
-		cmp	\rp, #ZOOM_UART		@ only on zoom2/3
-		beq	95f			@ configure ZOOM_UART
-
-		/* Configure the UART offset from the phys/virt base */
-21:		mov	\rp, #UART_OFFSET(OMAP2_UART1_BASE)	@ omap2/3/4
-		b	98f
-22:		mov	\rp, #UART_OFFSET(OMAP2_UART2_BASE)	@ omap2/3/4
-		b	98f
-23:		mov	\rp, #UART_OFFSET(OMAP2_UART3_BASE)
-		b	98f
-33:		mov	\rp, #UART_OFFSET(OMAP3_UART1_BASE)
-		add	\rp, \rp, #0x00fb0000
-		add	\rp, \rp, #0x00006000		@ OMAP3_UART3_BASE
-		b	98f
-34:		mov	\rp, #UART_OFFSET(OMAP3_UART1_BASE)
-		add	\rp, \rp, #0x00fb0000
-		add	\rp, \rp, #0x00028000		@ OMAP3_UART4_BASE
-		b	98f
-43:		mov	\rp, #UART_OFFSET(OMAP4_UART3_BASE)
-		b	98f
-44:		mov	\rp, #UART_OFFSET(OMAP4_UART4_BASE)
-		b	98f
-95:		ldr	\rp, =ZOOM_UART_BASE
-		mrc	p15, 0, \rv, c1, c0
-		tst	\rv, #1			@ MMU enabled?
-		ldreq	\rv, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-		ldrne	\rv, =omap_uart_phys	@ MMU enabled
-		str	\rp, [\rv, #0]
-		ldr	\rp, =ZOOM_UART_VIRT
-		add	\rv, \rv, #4		@ omap_uart_virt
-		str	\rp, [\rv, #0]
-		mov	\rp, #(UART_LSR << ZOOM_PORT_SHIFT)
-		add	\rv, \rv, #4		@ omap_uart_lsr
-		str	\rp, [\rv, #0]
-		b	10b
-
-		/* Store both phys and virt address for the uart */
-98:		add	\rp, \rp, #0x48000000	@ phys base
-		mrc	p15, 0, \rv, c1, c0
-		tst	\rv, #1			@ MMU enabled?
-		ldreq	\rv, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-		ldrne	\rv, =omap_uart_phys	@ MMU enabled
-		str	\rp, [\rv, #0]
-		sub	\rp, \rp, #0x48000000	@ phys base
-		add	\rp, \rp, #0xfa000000	@ virt base
-		add	\rv, \rv, #4		@ omap_uart_virt
-		str	\rp, [\rv, #0]
-		mov	\rp, #(UART_LSR << OMAP_PORT_SHIFT)
-		add	\rv, \rv, #4		@ omap_uart_lsr
-		str	\rp, [\rv, #0]
-
-		b	10b
-99:
 		.endm
 
 		.macro	senduart,rd,rx
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index 8ff605c..7d9ed90 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -15,20 +15,6 @@
 
 #include <linux/init.h>
 
-/*
- * Memory entry used for the DEBUG_LL UART configuration. See also
- * uncompress.h and debug-macro.S.
- *
- * Note that using a memory location for storing the UART configuration
- * has at least two limitations:
- *
- * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
- *    uncompress code could then partially overwrite itself
- * 2. We assume printascii is called at least once before paging_init,
- *    and addruart has a chance to read OMAP_UART_INFO
- */
-#define OMAP_UART_INFO		(PLAT_PHYS_OFFSET + 0x3ffc)
-
 /* OMAP1 serial ports */
 #define OMAP1_UART1_BASE	0xfffb0000
 #define OMAP1_UART2_BASE	0xfffb0800
@@ -63,26 +49,6 @@
 #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 ad98b85..ea1ffe4 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -30,15 +30,6 @@
 static volatile u8 *uart_base;
 static int uart_shift;
 
-/*
- * Store the DEBUG_LL uart number into memory.
- * See also debug-macro.S, and serial.c for related code.
- */
-static void set_omap_uart_info(unsigned char port)
-{
-	*(volatile u32 *)OMAP_UART_INFO = port;
-}
-
 static void putc(int c)
 {
 	if (!uart_base)
@@ -60,43 +51,34 @@ static inline void flush(void)
 /*
  * Macros to configure UART1 and debug UART
  */
-#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id)		\
+#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft)			\
 	if (machine_is_##mach()) {					\
 		uart_base = (volatile u8 *)(dbg_uart);			\
 		uart_shift = (dbg_shft);				\
-		port = (dbg_id);					\
-		set_omap_uart_info(port);				\
 		break;							\
 	}
 
 #define DEBUG_LL_OMAP7XX(p, mach)					\
-	_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT,	\
-		OMAP1UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT)
 
 #define DEBUG_LL_OMAP1(p, mach)						\
-	_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT,	\
-		OMAP1UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT)
 
 #define DEBUG_LL_OMAP2(p, mach)						\
-	_DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT,	\
-		OMAP2UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT)
 
 #define DEBUG_LL_OMAP3(p, mach)						\
-	_DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT,	\
-		OMAP3UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT)
 
 #define DEBUG_LL_OMAP4(p, mach)						\
-	_DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT,	\
-		OMAP4UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT)
 
 /* Zoom2/3 shift is different for UART1 and external port */
 #define DEBUG_LL_ZOOM(mach)						\
-	_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
+	_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT)
 
 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


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

* [PATCH 1/5] omap: Remove code configuring the DEBUG_LL serial port using uncompress code
@ 2011-02-04  1:27   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

This code gets too complex and has a dependency to the uncompress code
for initializing the serial port. The following patches will use inituart
for machine specific debug uart init.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   47 -------------
 arch/arm/mach-omap2/include/mach/debug-macro.S |   84 ------------------------
 arch/arm/plat-omap/include/plat/serial.h       |   34 ----------
 arch/arm/plat-omap/include/plat/uncompress.h   |   32 ++-------
 4 files changed, 9 insertions(+), 188 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index bf0cc57..db2cdf4 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -18,7 +18,6 @@
 #include <plat/serial.h>
 
 #define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
-#define omap_uart_p2v(x)	((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET)
 
 		.pushsection .data
 omap_uart_phys:	.word	0x0
@@ -37,57 +36,13 @@ omap_uart_virt:	.word	0x0
 		.macro	addruart, rp, rv
 
 		/* Use omap_uart_phys/virt if already configured */
-9:		mrc	p15, 0, \rp, c1, c0
+		mrc	p15, 0, \rp, c1, c0
 		tst	\rp, #1			@ MMU enabled?
 		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
 		ldrne	\rp, =omap_uart_phys	@ MMU enabled
 		add	\rv, \rp, #4		@ omap_uart_virt
 		ldr	\rp, [\rp, #0]
 		ldr	\rv, [\rv, #0]
-		cmp	\rp, #0			@ is port configured?
-		cmpne	\rv, #0
-		bne	99f			@ already configured
-
-		/* Check the debug UART configuration set in uncompress.h */
-		mrc	p15, 0, \rp, c1, c0
-		tst	\rp, #1			@ MMU enabled?
-		ldreq	\rp, =OMAP_UART_INFO	@ MMU not enabled
-		ldrne	\rp, =omap_uart_p2v(OMAP_UART_INFO)	@ MMU enabled
-		ldr	\rp, [\rp, #0]
-
-		/* Select the UART to use based on the UART1 scratchpad value */
-10:		cmp	\rp, #0			@ no port configured?
-		beq	11f			@ if none, try to use UART1
-		cmp	\rp, #OMAP1UART1
-		beq	11f			@ configure OMAP1UART1
-		cmp	\rp, #OMAP1UART2
-		beq	12f			@ configure OMAP1UART2
-		cmp	\rp, #OMAP1UART3
-		beq	13f			@ configure OMAP2UART3
-
-		/* Configure the UART offset from the phys/virt base */
-11:		mov	\rp, #0x00fb0000	@ OMAP1UART1
-		b	98f
-12:		mov	\rp, #0x00fb0000	@ OMAP1UART1
-		orr	\rp, \rp, #0x00000800	@ OMAP1UART2
-		b	98f
-13:		mov	\rp, #0x00fb0000	@ OMAP1UART1
-		orr	\rp, \rp, #0x00000800	@ OMAP1UART2
-		orr	\rp, \rp, #0x00009000	@ OMAP1UART3
-
-		/* Store both phys and virt address for the uart */
-98:		add	\rp, \rp, #0xff000000	@ phys base
-		mrc	p15, 0, \rv, c1, c0
-		tst	\rv, #1			@ MMU enabled?
-		ldreq	\rv, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-		ldrne	\rv, =omap_uart_phys	@ MMU enabled
-		str	\rp, [\rv, #0]
-		sub	\rp, \rp, #0xff000000	@ phys base
-		add	\rp, \rp, #0xfe000000	@ virt base
-		add	\rv, \rv, #4		@ omap_uart_lsr
-		str	\rp, [\rv, #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 6bbe2dd..336a838 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -20,7 +20,6 @@
 #define UART_OFFSET(addr)	((addr) & 0x00ffffff)
 
 #define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
-#define omap_uart_p2v(x)	((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET)
 
 		.pushsection .data
 omap_uart_phys:	.word	0
@@ -40,94 +39,13 @@ omap_uart_lsr:	.word	0
 		.macro	addruart, rp, rv
 
 		/* Use omap_uart_phys/virt if already configured */
-10:		mrc	p15, 0, \rp, c1, c0
+		mrc	p15, 0, \rp, c1, c0
 		tst	\rp, #1			@ MMU enabled?
 		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
 		ldrne	\rp, =omap_uart_phys	@ MMU enabled
 		add	\rv, \rp, #4		@ omap_uart_virt
 		ldr	\rp, [\rp, #0]
 		ldr	\rv, [\rv, #0]
-		cmp	\rp, #0			@ is port configured?
-		cmpne	\rv, #0
-		bne	99f			@ already configured
-
-		/* Check the debug UART configuration set in uncompress.h */
-		mrc	p15, 0, \rp, c1, c0
-		tst	\rp, #1			@ MMU enabled?
-		ldreq	\rp, =OMAP_UART_INFO	@ MMU not enabled
-		ldrne	\rp, =omap_uart_p2v(OMAP_UART_INFO)	@ MMU enabled
-		ldr	\rp, [\rp, #0]
-
-		/* Select the UART to use based on the UART1 scratchpad value */
-		cmp	\rp, #0			@ no port configured?
-		beq	21f			@ if none, try to use UART1
-		cmp	\rp, #OMAP2UART1	@ OMAP2/3/4UART1
-		beq	21f			@ configure OMAP2/3/4UART1
-		cmp	\rp, #OMAP2UART2	@ OMAP2/3/4UART2
-		beq	22f			@ configure OMAP2/3/4UART2
-		cmp	\rp, #OMAP2UART3	@ only on 24xx
-		beq	23f			@ configure OMAP2UART3
-		cmp	\rp, #OMAP3UART3	@ only on 34xx
-		beq	33f			@ configure OMAP3UART3
-		cmp	\rp, #OMAP4UART3	@ only on 44xx
-		beq	43f			@ configure OMAP4UART3
-		cmp	\rp, #OMAP3UART4	@ only on 36xx
-		beq	34f			@ configure OMAP3UART4
-		cmp	\rp, #OMAP4UART4	@ only on 44xx
-		beq	44f			@ configure OMAP4UART4
-		cmp	\rp, #ZOOM_UART		@ only on zoom2/3
-		beq	95f			@ configure ZOOM_UART
-
-		/* Configure the UART offset from the phys/virt base */
-21:		mov	\rp, #UART_OFFSET(OMAP2_UART1_BASE)	@ omap2/3/4
-		b	98f
-22:		mov	\rp, #UART_OFFSET(OMAP2_UART2_BASE)	@ omap2/3/4
-		b	98f
-23:		mov	\rp, #UART_OFFSET(OMAP2_UART3_BASE)
-		b	98f
-33:		mov	\rp, #UART_OFFSET(OMAP3_UART1_BASE)
-		add	\rp, \rp, #0x00fb0000
-		add	\rp, \rp, #0x00006000		@ OMAP3_UART3_BASE
-		b	98f
-34:		mov	\rp, #UART_OFFSET(OMAP3_UART1_BASE)
-		add	\rp, \rp, #0x00fb0000
-		add	\rp, \rp, #0x00028000		@ OMAP3_UART4_BASE
-		b	98f
-43:		mov	\rp, #UART_OFFSET(OMAP4_UART3_BASE)
-		b	98f
-44:		mov	\rp, #UART_OFFSET(OMAP4_UART4_BASE)
-		b	98f
-95:		ldr	\rp, =ZOOM_UART_BASE
-		mrc	p15, 0, \rv, c1, c0
-		tst	\rv, #1			@ MMU enabled?
-		ldreq	\rv, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-		ldrne	\rv, =omap_uart_phys	@ MMU enabled
-		str	\rp, [\rv, #0]
-		ldr	\rp, =ZOOM_UART_VIRT
-		add	\rv, \rv, #4		@ omap_uart_virt
-		str	\rp, [\rv, #0]
-		mov	\rp, #(UART_LSR << ZOOM_PORT_SHIFT)
-		add	\rv, \rv, #4		@ omap_uart_lsr
-		str	\rp, [\rv, #0]
-		b	10b
-
-		/* Store both phys and virt address for the uart */
-98:		add	\rp, \rp, #0x48000000	@ phys base
-		mrc	p15, 0, \rv, c1, c0
-		tst	\rv, #1			@ MMU enabled?
-		ldreq	\rv, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-		ldrne	\rv, =omap_uart_phys	@ MMU enabled
-		str	\rp, [\rv, #0]
-		sub	\rp, \rp, #0x48000000	@ phys base
-		add	\rp, \rp, #0xfa000000	@ virt base
-		add	\rv, \rv, #4		@ omap_uart_virt
-		str	\rp, [\rv, #0]
-		mov	\rp, #(UART_LSR << OMAP_PORT_SHIFT)
-		add	\rv, \rv, #4		@ omap_uart_lsr
-		str	\rp, [\rv, #0]
-
-		b	10b
-99:
 		.endm
 
 		.macro	senduart,rd,rx
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index 8ff605c..7d9ed90 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -15,20 +15,6 @@
 
 #include <linux/init.h>
 
-/*
- * Memory entry used for the DEBUG_LL UART configuration. See also
- * uncompress.h and debug-macro.S.
- *
- * Note that using a memory location for storing the UART configuration
- * has at least two limitations:
- *
- * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
- *    uncompress code could then partially overwrite itself
- * 2. We assume printascii is called at least once before paging_init,
- *    and addruart has a chance to read OMAP_UART_INFO
- */
-#define OMAP_UART_INFO		(PLAT_PHYS_OFFSET + 0x3ffc)
-
 /* OMAP1 serial ports */
 #define OMAP1_UART1_BASE	0xfffb0000
 #define OMAP1_UART2_BASE	0xfffb0800
@@ -63,26 +49,6 @@
 #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 ad98b85..ea1ffe4 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -30,15 +30,6 @@
 static volatile u8 *uart_base;
 static int uart_shift;
 
-/*
- * Store the DEBUG_LL uart number into memory.
- * See also debug-macro.S, and serial.c for related code.
- */
-static void set_omap_uart_info(unsigned char port)
-{
-	*(volatile u32 *)OMAP_UART_INFO = port;
-}
-
 static void putc(int c)
 {
 	if (!uart_base)
@@ -60,43 +51,34 @@ static inline void flush(void)
 /*
  * Macros to configure UART1 and debug UART
  */
-#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id)		\
+#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft)			\
 	if (machine_is_##mach()) {					\
 		uart_base = (volatile u8 *)(dbg_uart);			\
 		uart_shift = (dbg_shft);				\
-		port = (dbg_id);					\
-		set_omap_uart_info(port);				\
 		break;							\
 	}
 
 #define DEBUG_LL_OMAP7XX(p, mach)					\
-	_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT,	\
-		OMAP1UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT)
 
 #define DEBUG_LL_OMAP1(p, mach)						\
-	_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT,	\
-		OMAP1UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT)
 
 #define DEBUG_LL_OMAP2(p, mach)						\
-	_DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT,	\
-		OMAP2UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT)
 
 #define DEBUG_LL_OMAP3(p, mach)						\
-	_DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT,	\
-		OMAP3UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT)
 
 #define DEBUG_LL_OMAP4(p, mach)						\
-	_DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT,	\
-		OMAP4UART##p)
+	_DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT)
 
 /* Zoom2/3 shift is different for UART1 and external port */
 #define DEBUG_LL_ZOOM(mach)						\
-	_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
+	_DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT)
 
 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

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

* [PATCH 2/5] omap: Use inituart to configure the debug serial port based on machine ID
  2011-02-04  1:26 ` Tony Lindgren
@ 2011-02-04  1:27   ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

Set the debug serial port based on machine ID. Note that most
of the patch is just trivial checking for the machine ID.

Also note that this code won't work for debugging the uncompress code.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   77 +++++++++++++-
 arch/arm/mach-omap1/serial.c                   |    7 +
 arch/arm/mach-omap2/include/mach/debug-macro.S |  130 ++++++++++++++++++++++--
 arch/arm/mach-omap2/serial.c                   |    7 +
 4 files changed, 204 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index db2cdf4..80dcf18 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -14,24 +14,87 @@
 #include <linux/serial_reg.h>
 
 #include <asm/memory.h>
+#include <asm/mach-types.h>
 
+#include <plat/io.h>
 #include <plat/serial.h>
 
 #define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
 
-		.pushsection .data
-omap_uart_phys:	.word	0x0
-omap_uart_virt:	.word	0x0
-		.popsection
-
+		/*
+		 * Intialize the debug serial port based on machine ID
+		 */
 		.macro	inituart, id, a, v
+		mrc	p15, 0, \a, c1, c0
+		tst	\a, #1			@ MMU enabled?
+		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
+		ldrne	\a, =omap_uart_phys
+		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
+		str	\v, [\a, #8]		@ save lsr, different for 7xx
+
+		/* omap7xx/8xx based boards using uart1 with shift 0 */
+		ldr	\v, =MACH_TYPE_HERALD
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PERSEUS2
+		cmpne	\id, \v
+		ldreq	\v, =OMAP1_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		moveq	\v, #(UART_LSR << OMAP7XX_PORT_SHIFT)
+		streq	\v, [\a, #8]		@ save lsr, different for 7xx
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart1 */
+		ldr	\v, =MACH_TYPE_AMS_DELTA
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA770
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H2
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H3
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_INNOVATOR
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_OSK
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PALMTE
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PALMZ71
+		cmpne	\id, \v
+		ldreq	\v, =OMAP1_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart2 */
+		ldr	\v, =MACH_TYPE_OMAP_PALMTT
+		cmp	\id, \v
+		ldreq	\v, =OMAP1_UART2_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART2_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart3 */
+		ldr	\v, =MACH_TYPE_SX1
+		cmp	\id, \v
+		ldreq	\v, =OMAP1_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART3_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+999:
 		.endm
 
 		/*
 		 * 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.
+		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
+		 * temporarily into mach-omap[12]/serial.c and comment out
+		 * the inituart macro above.
 		 */
 		.macro	addruart, rp, rv
 
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 550ca9d..8b4ce4a 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -29,6 +29,13 @@
 
 #include "pm.h"
 
+#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
+/* Used by inituart, addruart and busyuart. See debug-macro.S */
+void __iomem *omap_uart_phys;
+void __iomem *omap_uart_virt;
+void __iomem *omap_uart_lsr;
+#endif
+
 static struct clk * uart1_ck;
 static struct clk * uart2_ck;
 static struct clk * uart3_ck;
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 336a838..45c29e3 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -14,27 +14,137 @@
 #include <linux/serial_reg.h>
 
 #include <asm/memory.h>
+#include <asm/mach-types.h>
 
+#include <plat/io.h>
 #include <plat/serial.h>
 
-#define UART_OFFSET(addr)	((addr) & 0x00ffffff)
-
 #define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
 
-		.pushsection .data
-omap_uart_phys:	.word	0
-omap_uart_virt:	.word	0
-omap_uart_lsr:	.word	0
-		.popsection
-
+		/*
+		 * Intialize the debug serial port based on machine ID
+		 */
 		.macro	inituart, id, a, v
+		mrc	p15, 0, \a, c1, c0
+		tst	\a, #1			@ MMU enabled?
+		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
+		ldrne	\a, =omap_uart_phys
+		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
+		str	\v, [\a, #8]		@ save lsr, different for zoom
+
+		/* omap2 based boards using uart1 */
+		ldr	\v, =MACH_TYPE_OMAP2EVM
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_2430SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_APOLLON
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H4
+		cmpne	\id, \v
+		ldreq	\v, =OMAP2_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP2_UART1_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap2 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_NOKIA_N800
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_N810
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_N810_WIMAX
+		cmpne	\id, \v
+		ldreq	\v, =OMAP2_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP2_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap3 based boards using uart1 */
+		ldr	\v, =MACH_TYPE_OMAP3EVM
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_3430SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_3630SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3530_LV_SOM
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_TORPEDO
+		cmpne	\id, \v
+		ldreq	\v, =OMAP3_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP3_UART1_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap3 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_CM_T35
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_CM_T3517
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_CRANEBOARD
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_DEVKIT8000
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_IGEP0020
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_IGEP0030
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_RM680
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_RX51
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3517EVM
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_BEAGLE
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_PANDORA
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_LDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OVERO
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_TOUCHBOOK
+		cmpne	\id, \v
+		ldreq	\v, =OMAP3_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap4 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_OMAP_4430SDP
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP4_PANDA
+		cmpne	\id, \v
+		ldreq	\v, =OMAP4_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP4_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* zoom2/3 external uart */
+		ldr	\v, =MACH_TYPE_OMAP_ZOOM2
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_ZOOM3
+		cmpne	\id, \v
+		ldreq	\v, =ZOOM_UART_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =ZOOM_UART_VIRT
+		streq	\v, [\a, #4]		@ save port virt addr
+		moveq	\v, #(UART_LSR << ZOOM_PORT_SHIFT)
+		streq	\v, [\a, #8]		@ save lsr, different for zoom
+		beq	999f
+
+999:
 		.endm
 
 		/*
 		 * 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.
+		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
+		 * temporarily into mach-omap[12]/serial.c and comment out
+		 * the inituart macro above.
 		 */
 		.macro	addruart, rp, rv
 
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 32e91a9..9a41d6c 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -104,6 +104,13 @@ struct omap_uart_state {
 #endif
 };
 
+#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
+/* Used by inituart, addruart and busyuart. See debug-macro.S */
+void __iomem *omap_uart_phys;
+void __iomem *omap_uart_virt;
+void __iomem *omap_uart_lsr;
+#endif
+
 static LIST_HEAD(uart_list);
 static u8 num_uarts;
 


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

* [PATCH 2/5] omap: Use inituart to configure the debug serial port based on machine ID
@ 2011-02-04  1:27   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

Set the debug serial port based on machine ID. Note that most
of the patch is just trivial checking for the machine ID.

Also note that this code won't work for debugging the uncompress code.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   77 +++++++++++++-
 arch/arm/mach-omap1/serial.c                   |    7 +
 arch/arm/mach-omap2/include/mach/debug-macro.S |  130 ++++++++++++++++++++++--
 arch/arm/mach-omap2/serial.c                   |    7 +
 4 files changed, 204 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index db2cdf4..80dcf18 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -14,24 +14,87 @@
 #include <linux/serial_reg.h>
 
 #include <asm/memory.h>
+#include <asm/mach-types.h>
 
+#include <plat/io.h>
 #include <plat/serial.h>
 
 #define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
 
-		.pushsection .data
-omap_uart_phys:	.word	0x0
-omap_uart_virt:	.word	0x0
-		.popsection
-
+		/*
+		 * Intialize the debug serial port based on machine ID
+		 */
 		.macro	inituart, id, a, v
+		mrc	p15, 0, \a, c1, c0
+		tst	\a, #1			@ MMU enabled?
+		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
+		ldrne	\a, =omap_uart_phys
+		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
+		str	\v, [\a, #8]		@ save lsr, different for 7xx
+
+		/* omap7xx/8xx based boards using uart1 with shift 0 */
+		ldr	\v, =MACH_TYPE_HERALD
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PERSEUS2
+		cmpne	\id, \v
+		ldreq	\v, =OMAP1_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		moveq	\v, #(UART_LSR << OMAP7XX_PORT_SHIFT)
+		streq	\v, [\a, #8]		@ save lsr, different for 7xx
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart1 */
+		ldr	\v, =MACH_TYPE_AMS_DELTA
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA770
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H2
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H3
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_INNOVATOR
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_OSK
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PALMTE
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PALMZ71
+		cmpne	\id, \v
+		ldreq	\v, =OMAP1_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart2 */
+		ldr	\v, =MACH_TYPE_OMAP_PALMTT
+		cmp	\id, \v
+		ldreq	\v, =OMAP1_UART2_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART2_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart3 */
+		ldr	\v, =MACH_TYPE_SX1
+		cmp	\id, \v
+		ldreq	\v, =OMAP1_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART3_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+999:
 		.endm
 
 		/*
 		 * 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.
+		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
+		 * temporarily into mach-omap[12]/serial.c and comment out
+		 * the inituart macro above.
 		 */
 		.macro	addruart, rp, rv
 
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 550ca9d..8b4ce4a 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -29,6 +29,13 @@
 
 #include "pm.h"
 
+#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
+/* Used by inituart, addruart and busyuart. See debug-macro.S */
+void __iomem *omap_uart_phys;
+void __iomem *omap_uart_virt;
+void __iomem *omap_uart_lsr;
+#endif
+
 static struct clk * uart1_ck;
 static struct clk * uart2_ck;
 static struct clk * uart3_ck;
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 336a838..45c29e3 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -14,27 +14,137 @@
 #include <linux/serial_reg.h>
 
 #include <asm/memory.h>
+#include <asm/mach-types.h>
 
+#include <plat/io.h>
 #include <plat/serial.h>
 
-#define UART_OFFSET(addr)	((addr) & 0x00ffffff)
-
 #define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
 
-		.pushsection .data
-omap_uart_phys:	.word	0
-omap_uart_virt:	.word	0
-omap_uart_lsr:	.word	0
-		.popsection
-
+		/*
+		 * Intialize the debug serial port based on machine ID
+		 */
 		.macro	inituart, id, a, v
+		mrc	p15, 0, \a, c1, c0
+		tst	\a, #1			@ MMU enabled?
+		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
+		ldrne	\a, =omap_uart_phys
+		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
+		str	\v, [\a, #8]		@ save lsr, different for zoom
+
+		/* omap2 based boards using uart1 */
+		ldr	\v, =MACH_TYPE_OMAP2EVM
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_2430SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_APOLLON
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H4
+		cmpne	\id, \v
+		ldreq	\v, =OMAP2_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP2_UART1_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap2 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_NOKIA_N800
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_N810
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_N810_WIMAX
+		cmpne	\id, \v
+		ldreq	\v, =OMAP2_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP2_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap3 based boards using uart1 */
+		ldr	\v, =MACH_TYPE_OMAP3EVM
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_3430SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_3630SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3530_LV_SOM
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_TORPEDO
+		cmpne	\id, \v
+		ldreq	\v, =OMAP3_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP3_UART1_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap3 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_CM_T35
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_CM_T3517
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_CRANEBOARD
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_DEVKIT8000
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_IGEP0020
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_IGEP0030
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_RM680
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_RX51
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3517EVM
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_BEAGLE
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_PANDORA
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_LDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OVERO
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_TOUCHBOOK
+		cmpne	\id, \v
+		ldreq	\v, =OMAP3_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap4 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_OMAP_4430SDP
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP4_PANDA
+		cmpne	\id, \v
+		ldreq	\v, =OMAP4_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP4_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* zoom2/3 external uart */
+		ldr	\v, =MACH_TYPE_OMAP_ZOOM2
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_ZOOM3
+		cmpne	\id, \v
+		ldreq	\v, =ZOOM_UART_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =ZOOM_UART_VIRT
+		streq	\v, [\a, #4]		@ save port virt addr
+		moveq	\v, #(UART_LSR << ZOOM_PORT_SHIFT)
+		streq	\v, [\a, #8]		@ save lsr, different for zoom
+		beq	999f
+
+999:
 		.endm
 
 		/*
 		 * 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.
+		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
+		 * temporarily into mach-omap[12]/serial.c and comment out
+		 * the inituart macro above.
 		 */
 		.macro	addruart, rp, rv
 
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 32e91a9..9a41d6c 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -104,6 +104,13 @@ struct omap_uart_state {
 #endif
 };
 
+#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
+/* Used by inituart, addruart and busyuart. See debug-macro.S */
+void __iomem *omap_uart_phys;
+void __iomem *omap_uart_virt;
+void __iomem *omap_uart_lsr;
+#endif
+
 static LIST_HEAD(uart_list);
 static u8 num_uarts;
 

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

* [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
  2011-02-04  1:26 ` Tony Lindgren
@ 2011-02-04  1:27   ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

This way we can have the debug-macro.S be common for omap1 and omap2+
and get sensible error messages booting the wrong zImage with
CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
with u-boot and uImage.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   36 ++++++++++++++++++++----
 arch/arm/mach-omap2/include/mach/debug-macro.S |   27 +++++++++++++++++-
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index 80dcf18..bae924e 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -27,7 +27,15 @@
 		.macro	inituart, id, a, v
 		mrc	p15, 0, \a, c1, c0
 		tst	\a, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\a, =omap_uart_phys
+		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
+		moveq	\v, pc			@ copy pc
+		andeq	\v, \v, #0xf8000000	@ clear lower bits
+		orreq	\a, \v			@ combile to get phys addr
+#else
 		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
+#endif
 		ldrne	\a, =omap_uart_phys
 		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
 		str	\v, [\a, #8]		@ save lsr, different for 7xx
@@ -101,7 +109,15 @@
 		/* Use omap_uart_phys/virt if already configured */
 		mrc	p15, 0, \rp, c1, c0
 		tst	\rp, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rp, =omap_uart_phys	@ MMU disabled
+		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
+		moveq	\rv, pc			@ copy pc
+		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
+		orreq	\rp, \rv		@ combine to get phys addr
+#else
 		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
+#endif
 		ldrne	\rp, =omap_uart_phys	@ MMU enabled
 		add	\rv, \rp, #4		@ omap_uart_virt
 		ldr	\rp, [\rp, #0]
@@ -113,15 +129,23 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-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, #(UART_LSR << OMAP7XX_PORT_SHIFT)]
+1001:		mrc	p15, 0, \rd, c1, c0
+		tst	\rd, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
+		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
+		roreq	\rd, \rd, #27		@ rotate bits
+		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
+		roreq	\rd, \rd, #5		@ rotate bits back
+#else
+		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
+#endif
+		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
+		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
-1002:
 		.endm
 
 		.macro	waituart,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 45c29e3..80e0bdc 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -27,8 +27,17 @@
 		.macro	inituart, id, a, v
 		mrc	p15, 0, \a, c1, c0
 		tst	\a, #1			@ MMU enabled?
+		ldreq	\a, =omap_uart_phys
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\a, =omap_uart_phys
+		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
+		moveq	\v, pc			@ copy pc
+		andeq	\v, \v, #0xf8000000	@ clear lower bits
+		orreq	\a, \v			@ combile to get phys addr
+#else
 		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
-		ldrne	\a, =omap_uart_phys
+#endif
+		ldrne	\a, =omap_uart_phys	@ MMU enabled
 		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
 		str	\v, [\a, #8]		@ save lsr, different for zoom
 
@@ -151,7 +160,15 @@
 		/* Use omap_uart_phys/virt if already configured */
 		mrc	p15, 0, \rp, c1, c0
 		tst	\rp, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rp, =omap_uart_phys	@ MMU disabled
+		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
+		moveq	\rv, pc			@ copy pc
+		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
+		orreq	\rp, \rv		@ combine to get phys addr
+#else
 		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
+#endif
 		ldrne	\rp, =omap_uart_phys	@ MMU enabled
 		add	\rv, \rp, #4		@ omap_uart_virt
 		ldr	\rp, [\rp, #0]
@@ -165,7 +182,15 @@
 		.macro	busyuart,rd,rx
 1001:		mrc	p15, 0, \rd, c1, c0
 		tst	\rd, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
+		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
+		roreq	\rd, \rd, #27		@ rotate bits
+		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
+		roreq	\rd, \rd, #5		@ rotate bits back
+#else
 		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
+#endif
 		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
 		ldr	\rd, [\rd, #0]
 		ldrb	\rd, [\rx, \rd]


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

* [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
@ 2011-02-04  1:27   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

This way we can have the debug-macro.S be common for omap1 and omap2+
and get sensible error messages booting the wrong zImage with
CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
with u-boot and uImage.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |   36 ++++++++++++++++++++----
 arch/arm/mach-omap2/include/mach/debug-macro.S |   27 +++++++++++++++++-
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index 80dcf18..bae924e 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -27,7 +27,15 @@
 		.macro	inituart, id, a, v
 		mrc	p15, 0, \a, c1, c0
 		tst	\a, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\a, =omap_uart_phys
+		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
+		moveq	\v, pc			@ copy pc
+		andeq	\v, \v, #0xf8000000	@ clear lower bits
+		orreq	\a, \v			@ combile to get phys addr
+#else
 		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
+#endif
 		ldrne	\a, =omap_uart_phys
 		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
 		str	\v, [\a, #8]		@ save lsr, different for 7xx
@@ -101,7 +109,15 @@
 		/* Use omap_uart_phys/virt if already configured */
 		mrc	p15, 0, \rp, c1, c0
 		tst	\rp, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rp, =omap_uart_phys	@ MMU disabled
+		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
+		moveq	\rv, pc			@ copy pc
+		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
+		orreq	\rp, \rv		@ combine to get phys addr
+#else
 		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
+#endif
 		ldrne	\rp, =omap_uart_phys	@ MMU enabled
 		add	\rv, \rp, #4		@ omap_uart_virt
 		ldr	\rp, [\rp, #0]
@@ -113,15 +129,23 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-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, #(UART_LSR << OMAP7XX_PORT_SHIFT)]
+1001:		mrc	p15, 0, \rd, c1, c0
+		tst	\rd, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
+		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
+		roreq	\rd, \rd, #27		@ rotate bits
+		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
+		roreq	\rd, \rd, #5		@ rotate bits back
+#else
+		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
+#endif
+		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
+		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
-1002:
 		.endm
 
 		.macro	waituart,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 45c29e3..80e0bdc 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -27,8 +27,17 @@
 		.macro	inituart, id, a, v
 		mrc	p15, 0, \a, c1, c0
 		tst	\a, #1			@ MMU enabled?
+		ldreq	\a, =omap_uart_phys
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\a, =omap_uart_phys
+		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
+		moveq	\v, pc			@ copy pc
+		andeq	\v, \v, #0xf8000000	@ clear lower bits
+		orreq	\a, \v			@ combile to get phys addr
+#else
 		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
-		ldrne	\a, =omap_uart_phys
+#endif
+		ldrne	\a, =omap_uart_phys	@ MMU enabled
 		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
 		str	\v, [\a, #8]		@ save lsr, different for zoom
 
@@ -151,7 +160,15 @@
 		/* Use omap_uart_phys/virt if already configured */
 		mrc	p15, 0, \rp, c1, c0
 		tst	\rp, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rp, =omap_uart_phys	@ MMU disabled
+		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
+		moveq	\rv, pc			@ copy pc
+		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
+		orreq	\rp, \rv		@ combine to get phys addr
+#else
 		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
+#endif
 		ldrne	\rp, =omap_uart_phys	@ MMU enabled
 		add	\rv, \rp, #4		@ omap_uart_virt
 		ldr	\rp, [\rp, #0]
@@ -165,7 +182,15 @@
 		.macro	busyuart,rd,rx
 1001:		mrc	p15, 0, \rd, c1, c0
 		tst	\rd, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
+		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
+		roreq	\rd, \rd, #27		@ rotate bits
+		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
+		roreq	\rd, \rd, #5		@ rotate bits back
+#else
 		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
+#endif
 		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
 		ldr	\rd, [\rd, #0]
 		ldrb	\rd, [\rx, \rd]

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

* [PATCH 4/5] omap: Combine debug-macro.S for omap1 and omap2+
  2011-02-04  1:26 ` Tony Lindgren
@ 2011-02-04  1:27   ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

Now the DEBUG_LL code is the same for all omaps.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |  140 -------------
 arch/arm/mach-omap2/include/mach/debug-macro.S |  191 ------------------
 arch/arm/plat-omap/include/plat/debug-macro.S  |  257 ++++++++++++++++++++++++
 3 files changed, 259 insertions(+), 329 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/debug-macro.S

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index bae924e..fbf6f34 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -11,142 +11,4 @@
  *
 */
 
-#include <linux/serial_reg.h>
-
-#include <asm/memory.h>
-#include <asm/mach-types.h>
-
-#include <plat/io.h>
-#include <plat/serial.h>
-
-#define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
-
-		/*
-		 * Intialize the debug serial port based on machine ID
-		 */
-		.macro	inituart, id, a, v
-		mrc	p15, 0, \a, c1, c0
-		tst	\a, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\a, =omap_uart_phys
-		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
-		moveq	\v, pc			@ copy pc
-		andeq	\v, \v, #0xf8000000	@ clear lower bits
-		orreq	\a, \v			@ combile to get phys addr
-#else
-		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
-#endif
-		ldrne	\a, =omap_uart_phys
-		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
-		str	\v, [\a, #8]		@ save lsr, different for 7xx
-
-		/* omap7xx/8xx based boards using uart1 with shift 0 */
-		ldr	\v, =MACH_TYPE_HERALD
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_PERSEUS2
-		cmpne	\id, \v
-		ldreq	\v, =OMAP1_UART1_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		moveq	\v, #(UART_LSR << OMAP7XX_PORT_SHIFT)
-		streq	\v, [\a, #8]		@ save lsr, different for 7xx
-		beq	999f
-
-		/* omap15xx/16xx based boards using uart1 */
-		ldr	\v, =MACH_TYPE_AMS_DELTA
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA770
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_H2
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_H3
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_INNOVATOR
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_OSK
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_PALMTE
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_PALMZ71
-		cmpne	\id, \v
-		ldreq	\v, =OMAP1_UART1_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap15xx/16xx based boards using uart2 */
-		ldr	\v, =MACH_TYPE_OMAP_PALMTT
-		cmp	\id, \v
-		ldreq	\v, =OMAP1_UART2_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP1_UART2_BASE - OMAP1_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap15xx/16xx based boards using uart3 */
-		ldr	\v, =MACH_TYPE_SX1
-		cmp	\id, \v
-		ldreq	\v, =OMAP1_UART3_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP1_UART3_BASE - OMAP1_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-999:
-		.endm
-
-		/*
-		 * Note that this code won't work if the bootloader passes
-		 * a wrong machine ID number in r1. To debug, just hardcode
-		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
-		 * temporarily into mach-omap[12]/serial.c and comment out
-		 * the inituart macro above.
-		 */
-		.macro	addruart, rp, rv
-
-		/* Use omap_uart_phys/virt if already configured */
-		mrc	p15, 0, \rp, c1, c0
-		tst	\rp, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\rp, =omap_uart_phys	@ MMU disabled
-		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
-		moveq	\rv, pc			@ copy pc
-		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
-		orreq	\rp, \rv		@ combine to get phys addr
-#else
-		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-#endif
-		ldrne	\rp, =omap_uart_phys	@ MMU enabled
-		add	\rv, \rp, #4		@ omap_uart_virt
-		ldr	\rp, [\rp, #0]
-		ldr	\rv, [\rv, #0]
-		.endm
-
-		.macro	senduart,rd,rx
-		strb	\rd, [\rx]
-		.endm
-
-		.macro	busyuart,rd,rx
-1001:		mrc	p15, 0, \rd, c1, c0
-		tst	\rd, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
-		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
-		roreq	\rd, \rd, #27		@ rotate bits
-		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
-		roreq	\rd, \rd, #5		@ rotate bits back
-#else
-		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
-#endif
-		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
-		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
-		.endm
-
-		.macro	waituart,rd,rx
-		.endm
+#include <plat/debug-macro.S>
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 80e0bdc..9a7edaf 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -11,193 +11,4 @@
  *
 */
 
-#include <linux/serial_reg.h>
-
-#include <asm/memory.h>
-#include <asm/mach-types.h>
-
-#include <plat/io.h>
-#include <plat/serial.h>
-
-#define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
-
-		/*
-		 * Intialize the debug serial port based on machine ID
-		 */
-		.macro	inituart, id, a, v
-		mrc	p15, 0, \a, c1, c0
-		tst	\a, #1			@ MMU enabled?
-		ldreq	\a, =omap_uart_phys
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\a, =omap_uart_phys
-		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
-		moveq	\v, pc			@ copy pc
-		andeq	\v, \v, #0xf8000000	@ clear lower bits
-		orreq	\a, \v			@ combile to get phys addr
-#else
-		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
-#endif
-		ldrne	\a, =omap_uart_phys	@ MMU enabled
-		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
-		str	\v, [\a, #8]		@ save lsr, different for zoom
-
-		/* omap2 based boards using uart1 */
-		ldr	\v, =MACH_TYPE_OMAP2EVM
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_2430SDP
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_APOLLON
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_H4
-		cmpne	\id, \v
-		ldreq	\v, =OMAP2_UART1_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP2_UART1_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap2 based boards using uart3 */
-		ldr	\v, =MACH_TYPE_NOKIA_N800
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA_N810
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA_N810_WIMAX
-		cmpne	\id, \v
-		ldreq	\v, =OMAP2_UART3_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP2_UART3_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap3 based boards using uart1 */
-		ldr	\v, =MACH_TYPE_OMAP3EVM
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_3430SDP
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_3630SDP
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3530_LV_SOM
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3_TORPEDO
-		cmpne	\id, \v
-		ldreq	\v, =OMAP3_UART1_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP3_UART1_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap3 based boards using uart3 */
-		ldr	\v, =MACH_TYPE_CM_T35
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_CM_T3517
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_CRANEBOARD
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_DEVKIT8000
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_IGEP0020
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_IGEP0030
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA_RM680
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA_RX51
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3517EVM
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3_BEAGLE
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3_PANDORA
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_LDP
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OVERO
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_TOUCHBOOK
-		cmpne	\id, \v
-		ldreq	\v, =OMAP3_UART3_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap4 based boards using uart3 */
-		ldr	\v, =MACH_TYPE_OMAP_4430SDP
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP4_PANDA
-		cmpne	\id, \v
-		ldreq	\v, =OMAP4_UART3_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP4_UART3_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* zoom2/3 external uart */
-		ldr	\v, =MACH_TYPE_OMAP_ZOOM2
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_ZOOM3
-		cmpne	\id, \v
-		ldreq	\v, =ZOOM_UART_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =ZOOM_UART_VIRT
-		streq	\v, [\a, #4]		@ save port virt addr
-		moveq	\v, #(UART_LSR << ZOOM_PORT_SHIFT)
-		streq	\v, [\a, #8]		@ save lsr, different for zoom
-		beq	999f
-
-999:
-		.endm
-
-		/*
-		 * Note that this code won't work if the bootloader passes
-		 * a wrong machine ID number in r1. To debug, just hardcode
-		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
-		 * temporarily into mach-omap[12]/serial.c and comment out
-		 * the inituart macro above.
-		 */
-		.macro	addruart, rp, rv
-
-		/* Use omap_uart_phys/virt if already configured */
-		mrc	p15, 0, \rp, c1, c0
-		tst	\rp, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\rp, =omap_uart_phys	@ MMU disabled
-		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
-		moveq	\rv, pc			@ copy pc
-		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
-		orreq	\rp, \rv		@ combine to get phys addr
-#else
-		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-#endif
-		ldrne	\rp, =omap_uart_phys	@ MMU enabled
-		add	\rv, \rp, #4		@ omap_uart_virt
-		ldr	\rp, [\rp, #0]
-		ldr	\rv, [\rv, #0]
-		.endm
-
-		.macro	senduart,rd,rx
-		strb	\rd, [\rx]
-		.endm
-
-		.macro	busyuart,rd,rx
-1001:		mrc	p15, 0, \rd, c1, c0
-		tst	\rd, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
-		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
-		roreq	\rd, \rd, #27		@ rotate bits
-		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
-		roreq	\rd, \rd, #5		@ rotate bits back
-#else
-		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
-#endif
-		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
-		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
-		.endm
-
-		.macro	waituart,rd,rx
-		.endm
+#include <plat/debug-macro.S>
diff --git a/arch/arm/plat-omap/include/plat/debug-macro.S b/arch/arm/plat-omap/include/plat/debug-macro.S
new file mode 100644
index 0000000..1a1a5e8
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/debug-macro.S
@@ -0,0 +1,257 @@
+/* arch/arm/plat-omap/include/mach/debug-macro.S
+ *
+ * Debugging macro include header
+ *
+ *  Copyright (C) 1994-1999 Russell King
+ *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#include <linux/serial_reg.h>
+
+#include <asm/memory.h>
+#include <asm/mach-types.h>
+
+#include <plat/io.h>
+#include <plat/serial.h>
+
+#define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
+
+		/*
+		 * Intialize the debug serial port based on machine ID
+		 */
+		.macro	inituart, id, a, v
+		mrc	p15, 0, \a, c1, c0
+		tst	\a, #1			@ MMU enabled?
+		ldreq	\a, =omap_uart_phys
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\a, =omap_uart_phys
+		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
+		moveq	\v, pc			@ copy pc
+		andeq	\v, \v, #0xf8000000	@ clear lower bits
+		orreq	\a, \v			@ combile to get phys addr
+#else
+		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
+#endif
+		ldrne	\a, =omap_uart_phys	@ MMU enabled
+		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
+		str	\v, [\a, #8]		@ save lsr, different for zoom
+
+		/* omap7xx/8xx based boards using uart1 with shift 0 */
+		ldr	\v, =MACH_TYPE_HERALD
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PERSEUS2
+		cmpne	\id, \v
+		ldreq	\v, =OMAP1_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		moveq	\v, #(UART_LSR << OMAP7XX_PORT_SHIFT)
+		streq	\v, [\a, #8]		@ save lsr, different for 7xx
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart1 */
+		ldr	\v, =MACH_TYPE_AMS_DELTA
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA770
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H2
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H3
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_INNOVATOR
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_OSK
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PALMTE
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PALMZ71
+		cmpne	\id, \v
+		ldreq	\v, =OMAP1_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart2 */
+		ldr	\v, =MACH_TYPE_OMAP_PALMTT
+		cmp	\id, \v
+		ldreq	\v, =OMAP1_UART2_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART2_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart3 */
+		ldr	\v, =MACH_TYPE_SX1
+		cmp	\id, \v
+		ldreq	\v, =OMAP1_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART3_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap2 based boards using uart1 */
+		ldr	\v, =MACH_TYPE_OMAP2EVM
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_2430SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_APOLLON
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H4
+		cmpne	\id, \v
+		ldreq	\v, =OMAP2_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP2_UART1_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap2 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_NOKIA_N800
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_N810
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_N810_WIMAX
+		cmpne	\id, \v
+		ldreq	\v, =OMAP2_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP2_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap3 based boards using uart1 */
+		ldr	\v, =MACH_TYPE_OMAP3EVM
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_3430SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_3630SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3530_LV_SOM
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_TORPEDO
+		cmpne	\id, \v
+		ldreq	\v, =OMAP3_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP3_UART1_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap3 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_CM_T35
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_CM_T3517
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_CRANEBOARD
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_DEVKIT8000
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_IGEP0020
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_IGEP0030
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_RM680
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_RX51
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3517EVM
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_BEAGLE
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_PANDORA
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_LDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OVERO
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_TOUCHBOOK
+		cmpne	\id, \v
+		ldreq	\v, =OMAP3_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap4 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_OMAP_4430SDP
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP4_PANDA
+		cmpne	\id, \v
+		ldreq	\v, =OMAP4_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP4_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* zoom2/3 external uart */
+		ldr	\v, =MACH_TYPE_OMAP_ZOOM2
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_ZOOM3
+		cmpne	\id, \v
+		ldreq	\v, =ZOOM_UART_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =ZOOM_UART_VIRT
+		streq	\v, [\a, #4]		@ save port virt addr
+		moveq	\v, #(UART_LSR << ZOOM_PORT_SHIFT)
+		streq	\v, [\a, #8]		@ save lsr, different for zoom
+		beq	999f
+
+999:
+		.endm
+
+		/*
+		 * Note that this code won't work if the bootloader passes
+		 * a wrong machine ID number in r1. To debug, just hardcode
+		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
+		 * temporarily into mach-omap[12]/serial.c and comment out
+		 * the inituart macro above.
+		 */
+		.macro	addruart, rp, rv
+
+		/* Use omap_uart_phys/virt if already configured */
+		mrc	p15, 0, \rp, c1, c0
+		tst	\rp, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rp, =omap_uart_phys	@ MMU disabled
+		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
+		moveq	\rv, pc			@ copy pc
+		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
+		orreq	\rp, \rv		@ combine to get phys addr
+#else
+		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
+#endif
+		ldrne	\rp, =omap_uart_phys	@ MMU enabled
+		add	\rv, \rp, #4		@ omap_uart_virt
+		ldr	\rp, [\rp, #0]
+		ldr	\rv, [\rv, #0]
+		.endm
+
+		.macro	senduart,rd,rx
+		strb	\rd, [\rx]
+		.endm
+
+		.macro	busyuart,rd,rx
+1001:		mrc	p15, 0, \rd, c1, c0
+		tst	\rd, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
+		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
+		roreq	\rd, \rd, #27		@ rotate bits
+		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
+		roreq	\rd, \rd, #5		@ rotate bits back
+#else
+		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
+#endif
+		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
+		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
+		.endm
+
+		.macro	waituart,rd,rx
+		.endm


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

* [PATCH 4/5] omap: Combine debug-macro.S for omap1 and omap2+
@ 2011-02-04  1:27   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

Now the DEBUG_LL code is the same for all omaps.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/include/mach/debug-macro.S |  140 -------------
 arch/arm/mach-omap2/include/mach/debug-macro.S |  191 ------------------
 arch/arm/plat-omap/include/plat/debug-macro.S  |  257 ++++++++++++++++++++++++
 3 files changed, 259 insertions(+), 329 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/debug-macro.S

diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index bae924e..fbf6f34 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -11,142 +11,4 @@
  *
 */
 
-#include <linux/serial_reg.h>
-
-#include <asm/memory.h>
-#include <asm/mach-types.h>
-
-#include <plat/io.h>
-#include <plat/serial.h>
-
-#define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
-
-		/*
-		 * Intialize the debug serial port based on machine ID
-		 */
-		.macro	inituart, id, a, v
-		mrc	p15, 0, \a, c1, c0
-		tst	\a, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\a, =omap_uart_phys
-		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
-		moveq	\v, pc			@ copy pc
-		andeq	\v, \v, #0xf8000000	@ clear lower bits
-		orreq	\a, \v			@ combile to get phys addr
-#else
-		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
-#endif
-		ldrne	\a, =omap_uart_phys
-		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
-		str	\v, [\a, #8]		@ save lsr, different for 7xx
-
-		/* omap7xx/8xx based boards using uart1 with shift 0 */
-		ldr	\v, =MACH_TYPE_HERALD
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_PERSEUS2
-		cmpne	\id, \v
-		ldreq	\v, =OMAP1_UART1_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		moveq	\v, #(UART_LSR << OMAP7XX_PORT_SHIFT)
-		streq	\v, [\a, #8]		@ save lsr, different for 7xx
-		beq	999f
-
-		/* omap15xx/16xx based boards using uart1 */
-		ldr	\v, =MACH_TYPE_AMS_DELTA
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA770
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_H2
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_H3
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_INNOVATOR
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_OSK
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_PALMTE
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_PALMZ71
-		cmpne	\id, \v
-		ldreq	\v, =OMAP1_UART1_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap15xx/16xx based boards using uart2 */
-		ldr	\v, =MACH_TYPE_OMAP_PALMTT
-		cmp	\id, \v
-		ldreq	\v, =OMAP1_UART2_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP1_UART2_BASE - OMAP1_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap15xx/16xx based boards using uart3 */
-		ldr	\v, =MACH_TYPE_SX1
-		cmp	\id, \v
-		ldreq	\v, =OMAP1_UART3_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP1_UART3_BASE - OMAP1_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-999:
-		.endm
-
-		/*
-		 * Note that this code won't work if the bootloader passes
-		 * a wrong machine ID number in r1. To debug, just hardcode
-		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
-		 * temporarily into mach-omap[12]/serial.c and comment out
-		 * the inituart macro above.
-		 */
-		.macro	addruart, rp, rv
-
-		/* Use omap_uart_phys/virt if already configured */
-		mrc	p15, 0, \rp, c1, c0
-		tst	\rp, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\rp, =omap_uart_phys	@ MMU disabled
-		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
-		moveq	\rv, pc			@ copy pc
-		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
-		orreq	\rp, \rv		@ combine to get phys addr
-#else
-		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-#endif
-		ldrne	\rp, =omap_uart_phys	@ MMU enabled
-		add	\rv, \rp, #4		@ omap_uart_virt
-		ldr	\rp, [\rp, #0]
-		ldr	\rv, [\rv, #0]
-		.endm
-
-		.macro	senduart,rd,rx
-		strb	\rd, [\rx]
-		.endm
-
-		.macro	busyuart,rd,rx
-1001:		mrc	p15, 0, \rd, c1, c0
-		tst	\rd, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
-		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
-		roreq	\rd, \rd, #27		@ rotate bits
-		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
-		roreq	\rd, \rd, #5		@ rotate bits back
-#else
-		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
-#endif
-		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
-		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
-		.endm
-
-		.macro	waituart,rd,rx
-		.endm
+#include <plat/debug-macro.S>
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 80e0bdc..9a7edaf 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -11,193 +11,4 @@
  *
 */
 
-#include <linux/serial_reg.h>
-
-#include <asm/memory.h>
-#include <asm/mach-types.h>
-
-#include <plat/io.h>
-#include <plat/serial.h>
-
-#define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
-
-		/*
-		 * Intialize the debug serial port based on machine ID
-		 */
-		.macro	inituart, id, a, v
-		mrc	p15, 0, \a, c1, c0
-		tst	\a, #1			@ MMU enabled?
-		ldreq	\a, =omap_uart_phys
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\a, =omap_uart_phys
-		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
-		moveq	\v, pc			@ copy pc
-		andeq	\v, \v, #0xf8000000	@ clear lower bits
-		orreq	\a, \v			@ combile to get phys addr
-#else
-		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
-#endif
-		ldrne	\a, =omap_uart_phys	@ MMU enabled
-		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
-		str	\v, [\a, #8]		@ save lsr, different for zoom
-
-		/* omap2 based boards using uart1 */
-		ldr	\v, =MACH_TYPE_OMAP2EVM
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_2430SDP
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_APOLLON
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_H4
-		cmpne	\id, \v
-		ldreq	\v, =OMAP2_UART1_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP2_UART1_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap2 based boards using uart3 */
-		ldr	\v, =MACH_TYPE_NOKIA_N800
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA_N810
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA_N810_WIMAX
-		cmpne	\id, \v
-		ldreq	\v, =OMAP2_UART3_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP2_UART3_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap3 based boards using uart1 */
-		ldr	\v, =MACH_TYPE_OMAP3EVM
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_3430SDP
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_3630SDP
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3530_LV_SOM
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3_TORPEDO
-		cmpne	\id, \v
-		ldreq	\v, =OMAP3_UART1_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP3_UART1_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap3 based boards using uart3 */
-		ldr	\v, =MACH_TYPE_CM_T35
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_CM_T3517
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_CRANEBOARD
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_DEVKIT8000
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_IGEP0020
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_IGEP0030
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA_RM680
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_NOKIA_RX51
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3517EVM
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3_BEAGLE
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP3_PANDORA
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_LDP
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_OVERO
-		cmpne	\id, \v
-		ldrne	\v, =MACH_TYPE_TOUCHBOOK
-		cmpne	\id, \v
-		ldreq	\v, =OMAP3_UART3_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* omap4 based boards using uart3 */
-		ldr	\v, =MACH_TYPE_OMAP_4430SDP
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP4_PANDA
-		cmpne	\id, \v
-		ldreq	\v, =OMAP4_UART3_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =(OMAP4_UART3_BASE + OMAP2_L4_IO_OFFSET)
-		streq	\v, [\a, #4]		@ save port virt addr
-		beq	999f
-
-		/* zoom2/3 external uart */
-		ldr	\v, =MACH_TYPE_OMAP_ZOOM2
-		cmp	\id, \v
-		ldrne	\v, =MACH_TYPE_OMAP_ZOOM3
-		cmpne	\id, \v
-		ldreq	\v, =ZOOM_UART_BASE
-		streq	\v, [\a, #0]		@ save port phys addr
-		ldreq	\v, =ZOOM_UART_VIRT
-		streq	\v, [\a, #4]		@ save port virt addr
-		moveq	\v, #(UART_LSR << ZOOM_PORT_SHIFT)
-		streq	\v, [\a, #8]		@ save lsr, different for zoom
-		beq	999f
-
-999:
-		.endm
-
-		/*
-		 * Note that this code won't work if the bootloader passes
-		 * a wrong machine ID number in r1. To debug, just hardcode
-		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
-		 * temporarily into mach-omap[12]/serial.c and comment out
-		 * the inituart macro above.
-		 */
-		.macro	addruart, rp, rv
-
-		/* Use omap_uart_phys/virt if already configured */
-		mrc	p15, 0, \rp, c1, c0
-		tst	\rp, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\rp, =omap_uart_phys	@ MMU disabled
-		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
-		moveq	\rv, pc			@ copy pc
-		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
-		orreq	\rp, \rv		@ combine to get phys addr
-#else
-		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
-#endif
-		ldrne	\rp, =omap_uart_phys	@ MMU enabled
-		add	\rv, \rp, #4		@ omap_uart_virt
-		ldr	\rp, [\rp, #0]
-		ldr	\rv, [\rv, #0]
-		.endm
-
-		.macro	senduart,rd,rx
-		strb	\rd, [\rx]
-		.endm
-
-		.macro	busyuart,rd,rx
-1001:		mrc	p15, 0, \rd, c1, c0
-		tst	\rd, #1			@ MMU enabled?
-#ifdef CONFIG_AUTO_ZRELADDR
-		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
-		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
-		roreq	\rd, \rd, #27		@ rotate bits
-		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
-		roreq	\rd, \rd, #5		@ rotate bits back
-#else
-		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
-#endif
-		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
-		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
-		.endm
-
-		.macro	waituart,rd,rx
-		.endm
+#include <plat/debug-macro.S>
diff --git a/arch/arm/plat-omap/include/plat/debug-macro.S b/arch/arm/plat-omap/include/plat/debug-macro.S
new file mode 100644
index 0000000..1a1a5e8
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/debug-macro.S
@@ -0,0 +1,257 @@
+/* arch/arm/plat-omap/include/mach/debug-macro.S
+ *
+ * Debugging macro include header
+ *
+ *  Copyright (C) 1994-1999 Russell King
+ *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#include <linux/serial_reg.h>
+
+#include <asm/memory.h>
+#include <asm/mach-types.h>
+
+#include <plat/io.h>
+#include <plat/serial.h>
+
+#define omap_uart_v2p(x)	((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
+
+		/*
+		 * Intialize the debug serial port based on machine ID
+		 */
+		.macro	inituart, id, a, v
+		mrc	p15, 0, \a, c1, c0
+		tst	\a, #1			@ MMU enabled?
+		ldreq	\a, =omap_uart_phys
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\a, =omap_uart_phys
+		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
+		moveq	\v, pc			@ copy pc
+		andeq	\v, \v, #0xf8000000	@ clear lower bits
+		orreq	\a, \v			@ combile to get phys addr
+#else
+		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
+#endif
+		ldrne	\a, =omap_uart_phys	@ MMU enabled
+		mov	\v, #(UART_LSR << OMAP_PORT_SHIFT)
+		str	\v, [\a, #8]		@ save lsr, different for zoom
+
+		/* omap7xx/8xx based boards using uart1 with shift 0 */
+		ldr	\v, =MACH_TYPE_HERALD
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PERSEUS2
+		cmpne	\id, \v
+		ldreq	\v, =OMAP1_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		moveq	\v, #(UART_LSR << OMAP7XX_PORT_SHIFT)
+		streq	\v, [\a, #8]		@ save lsr, different for 7xx
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart1 */
+		ldr	\v, =MACH_TYPE_AMS_DELTA
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA770
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H2
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H3
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_INNOVATOR
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_OSK
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PALMTE
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_PALMZ71
+		cmpne	\id, \v
+		ldreq	\v, =OMAP1_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART1_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart2 */
+		ldr	\v, =MACH_TYPE_OMAP_PALMTT
+		cmp	\id, \v
+		ldreq	\v, =OMAP1_UART2_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART2_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap15xx/16xx based boards using uart3 */
+		ldr	\v, =MACH_TYPE_SX1
+		cmp	\id, \v
+		ldreq	\v, =OMAP1_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP1_UART3_BASE - OMAP1_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap2 based boards using uart1 */
+		ldr	\v, =MACH_TYPE_OMAP2EVM
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_2430SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_APOLLON
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_H4
+		cmpne	\id, \v
+		ldreq	\v, =OMAP2_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP2_UART1_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap2 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_NOKIA_N800
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_N810
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_N810_WIMAX
+		cmpne	\id, \v
+		ldreq	\v, =OMAP2_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP2_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap3 based boards using uart1 */
+		ldr	\v, =MACH_TYPE_OMAP3EVM
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_3430SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_3630SDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3530_LV_SOM
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_TORPEDO
+		cmpne	\id, \v
+		ldreq	\v, =OMAP3_UART1_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP3_UART1_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap3 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_CM_T35
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_CM_T3517
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_CRANEBOARD
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_DEVKIT8000
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_IGEP0020
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_IGEP0030
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_RM680
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_NOKIA_RX51
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3517EVM
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_BEAGLE
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP3_PANDORA
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_LDP
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_OVERO
+		cmpne	\id, \v
+		ldrne	\v, =MACH_TYPE_TOUCHBOOK
+		cmpne	\id, \v
+		ldreq	\v, =OMAP3_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* omap4 based boards using uart3 */
+		ldr	\v, =MACH_TYPE_OMAP_4430SDP
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP4_PANDA
+		cmpne	\id, \v
+		ldreq	\v, =OMAP4_UART3_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =(OMAP4_UART3_BASE + OMAP2_L4_IO_OFFSET)
+		streq	\v, [\a, #4]		@ save port virt addr
+		beq	999f
+
+		/* zoom2/3 external uart */
+		ldr	\v, =MACH_TYPE_OMAP_ZOOM2
+		cmp	\id, \v
+		ldrne	\v, =MACH_TYPE_OMAP_ZOOM3
+		cmpne	\id, \v
+		ldreq	\v, =ZOOM_UART_BASE
+		streq	\v, [\a, #0]		@ save port phys addr
+		ldreq	\v, =ZOOM_UART_VIRT
+		streq	\v, [\a, #4]		@ save port virt addr
+		moveq	\v, #(UART_LSR << ZOOM_PORT_SHIFT)
+		streq	\v, [\a, #8]		@ save lsr, different for zoom
+		beq	999f
+
+999:
+		.endm
+
+		/*
+		 * Note that this code won't work if the bootloader passes
+		 * a wrong machine ID number in r1. To debug, just hardcode
+		 * the desired omap_uart_phys, omap_uart_virt and omap_uart_lsr
+		 * temporarily into mach-omap[12]/serial.c and comment out
+		 * the inituart macro above.
+		 */
+		.macro	addruart, rp, rv
+
+		/* Use omap_uart_phys/virt if already configured */
+		mrc	p15, 0, \rp, c1, c0
+		tst	\rp, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rp, =omap_uart_phys	@ MMU disabled
+		biceq	\rp, \rp, #0xf8000000	@ clear top bits of virt addr
+		moveq	\rv, pc			@ copy pc
+		andeq	\rv, \rv, #0xf8000000	@ clear lower bits
+		orreq	\rp, \rv		@ combine to get phys addr
+#else
+		ldreq	\rp, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
+#endif
+		ldrne	\rp, =omap_uart_phys	@ MMU enabled
+		add	\rv, \rp, #4		@ omap_uart_virt
+		ldr	\rp, [\rp, #0]
+		ldr	\rv, [\rv, #0]
+		.endm
+
+		.macro	senduart,rd,rx
+		strb	\rd, [\rx]
+		.endm
+
+		.macro	busyuart,rd,rx
+1001:		mrc	p15, 0, \rd, c1, c0
+		tst	\rd, #1			@ MMU enabled?
+#ifdef CONFIG_AUTO_ZRELADDR
+		ldreq	\rd, =omap_uart_lsr	@ MMU disabled
+		biceq	\rd, \rd, #0xf8000000	@ clear top bits of virt addr
+		roreq	\rd, \rd, #27		@ rotate bits
+		orreq	\rd, pc, lsr #27	@ orr with top bits of pc
+		roreq	\rd, \rd, #5		@ rotate bits back
+#else
+		ldreq	\rd, =omap_uart_v2p(omap_uart_lsr)	@ MMU disabled
+#endif
+		ldrne	\rd, =omap_uart_lsr	@ MMU enabled
+		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
+		.endm
+
+		.macro	waituart,rd,rx
+		.endm

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

* [PATCH 5/5] omap: Add CONFIG_AUTO_ZRELADDR and CONFIG_ARM_PATCH_PHYS_VIRT to defconfigs
  2011-02-04  1:26 ` Tony Lindgren
@ 2011-02-04  1:27   ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

Add CONFIG_AUTO_ZRELADDR and CONFIG_ARM_PATCH_PHYS_VIRT to defconfigs.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/configs/omap1_defconfig     |    2 ++
 arch/arm/configs/omap2plus_defconfig |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/configs/omap1_defconfig b/arch/arm/configs/omap1_defconfig
index 7b63462..261d37a 100644
--- a/arch/arm/configs/omap1_defconfig
+++ b/arch/arm/configs/omap1_defconfig
@@ -1,3 +1,4 @@
+CONFIG_ARM_PATCH_PHYS_VIRT=y
 CONFIG_EXPERIMENTAL=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
@@ -67,6 +68,7 @@ CONFIG_LEDS_CPU=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="root=1f03 rootfstype=jffs2"
+CONFIG_AUTO_ZRELADDR=y
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_MISC=y
 CONFIG_PM=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index ae890ca..8c9d734 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -1,3 +1,4 @@
+CONFIG_ARM_PATCH_PHYS_VIRT=y
 CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
@@ -65,6 +66,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200"
 CONFIG_KEXEC=y
+CONFIG_AUTO_ZRELADDR=y
 CONFIG_FPE_NWFPE=y
 CONFIG_VFP=y
 CONFIG_NEON=y


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

* [PATCH 5/5] omap: Add CONFIG_AUTO_ZRELADDR and CONFIG_ARM_PATCH_PHYS_VIRT to defconfigs
@ 2011-02-04  1:27   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

Add CONFIG_AUTO_ZRELADDR and CONFIG_ARM_PATCH_PHYS_VIRT to defconfigs.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/configs/omap1_defconfig     |    2 ++
 arch/arm/configs/omap2plus_defconfig |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/configs/omap1_defconfig b/arch/arm/configs/omap1_defconfig
index 7b63462..261d37a 100644
--- a/arch/arm/configs/omap1_defconfig
+++ b/arch/arm/configs/omap1_defconfig
@@ -1,3 +1,4 @@
+CONFIG_ARM_PATCH_PHYS_VIRT=y
 CONFIG_EXPERIMENTAL=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
@@ -67,6 +68,7 @@ CONFIG_LEDS_CPU=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="root=1f03 rootfstype=jffs2"
+CONFIG_AUTO_ZRELADDR=y
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_MISC=y
 CONFIG_PM=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index ae890ca..8c9d734 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -1,3 +1,4 @@
+CONFIG_ARM_PATCH_PHYS_VIRT=y
 CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
@@ -65,6 +66,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200"
 CONFIG_KEXEC=y
+CONFIG_AUTO_ZRELADDR=y
 CONFIG_FPE_NWFPE=y
 CONFIG_VFP=y
 CONFIG_NEON=y

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

* Re: [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
  2011-02-04  1:27   ` Tony Lindgren
@ 2011-02-04  3:33     ` Nicolas Pitre
  -1 siblings, 0 replies; 32+ messages in thread
From: Nicolas Pitre @ 2011-02-04  3:33 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

On Thu, 3 Feb 2011, Tony Lindgren wrote:

> This way we can have the debug-macro.S be common for omap1 and omap2+
> and get sensible error messages booting the wrong zImage with
> CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
> with u-boot and uImage.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap1/include/mach/debug-macro.S |   36 ++++++++++++++++++++----
>  arch/arm/mach-omap2/include/mach/debug-macro.S |   27 +++++++++++++++++-
>  2 files changed, 56 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> index 80dcf18..bae924e 100644
> --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> @@ -27,7 +27,15 @@
>  		.macro	inituart, id, a, v
>  		mrc	p15, 0, \a, c1, c0
>  		tst	\a, #1			@ MMU enabled?
> +#ifdef CONFIG_AUTO_ZRELADDR
> +		ldreq	\a, =omap_uart_phys
> +		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
> +		moveq	\v, pc			@ copy pc
> +		andeq	\v, \v, #0xf8000000	@ clear lower bits
> +		orreq	\a, \v			@ combile to get phys addr
> +#else
>  		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
> +#endif
>  		ldrne	\a, =omap_uart_phys

Gaaaaah!  This is horrible.

OK, you do want to store data in memory, right?  So the best way to 
always be position independent, even cross section, is to do the 
following (inspired by RMK's trick in the p2v series):

	.data

foo:	.word	0	@ value for sput
	.word	0	@ value for nik

	.text

bar:	.word	.
	.word	foo

sputnik:

	adr	r0, bar		@ get relative address of bar
	ldr	r1, [r0]	@ get absolute address of bar
	sub	r1, r1, r0	@ difference between abs and rel address
	ldr	r0, [r0, #4]	@ get absolute address of foo
	sub	r0, r0, r1	@ turn that into a relative address

	ldmia	r0, {r1, r2}	@ retrieve sput and nik
	add	r0, r1, r2
	mov	pc, lr

This code is totally position independent, so it works whether or not 
the MMU is active.  Therefore a similar technique in your macro (you 
could even put it into a macro for it) would allow you to get rid of the 
mrc and test for MMU active, get rid of the #ifdef, and not be limited 
to a 128 MB mask, etc.  And it is just one word longer than your 
shortest version i.e. 2 constants + 5 instructions vs 4 instructions + 2 
literal pool entries.


Nicolas

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

* [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
@ 2011-02-04  3:33     ` Nicolas Pitre
  0 siblings, 0 replies; 32+ messages in thread
From: Nicolas Pitre @ 2011-02-04  3:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 3 Feb 2011, Tony Lindgren wrote:

> This way we can have the debug-macro.S be common for omap1 and omap2+
> and get sensible error messages booting the wrong zImage with
> CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
> with u-boot and uImage.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap1/include/mach/debug-macro.S |   36 ++++++++++++++++++++----
>  arch/arm/mach-omap2/include/mach/debug-macro.S |   27 +++++++++++++++++-
>  2 files changed, 56 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> index 80dcf18..bae924e 100644
> --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> @@ -27,7 +27,15 @@
>  		.macro	inituart, id, a, v
>  		mrc	p15, 0, \a, c1, c0
>  		tst	\a, #1			@ MMU enabled?
> +#ifdef CONFIG_AUTO_ZRELADDR
> +		ldreq	\a, =omap_uart_phys
> +		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
> +		moveq	\v, pc			@ copy pc
> +		andeq	\v, \v, #0xf8000000	@ clear lower bits
> +		orreq	\a, \v			@ combile to get phys addr
> +#else
>  		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
> +#endif
>  		ldrne	\a, =omap_uart_phys

Gaaaaah!  This is horrible.

OK, you do want to store data in memory, right?  So the best way to 
always be position independent, even cross section, is to do the 
following (inspired by RMK's trick in the p2v series):

	.data

foo:	.word	0	@ value for sput
	.word	0	@ value for nik

	.text

bar:	.word	.
	.word	foo

sputnik:

	adr	r0, bar		@ get relative address of bar
	ldr	r1, [r0]	@ get absolute address of bar
	sub	r1, r1, r0	@ difference between abs and rel address
	ldr	r0, [r0, #4]	@ get absolute address of foo
	sub	r0, r0, r1	@ turn that into a relative address

	ldmia	r0, {r1, r2}	@ retrieve sput and nik
	add	r0, r1, r2
	mov	pc, lr

This code is totally position independent, so it works whether or not 
the MMU is active.  Therefore a similar technique in your macro (you 
could even put it into a macro for it) would allow you to get rid of the 
mrc and test for MMU active, get rid of the #ifdef, and not be limited 
to a 128 MB mask, etc.  And it is just one word longer than your 
shortest version i.e. 2 constants + 5 instructions vs 4 instructions + 2 
literal pool entries.


Nicolas

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

* Re: [PATCH 2/5] omap: Use inituart to configure the debug serial port based on machine ID
  2011-02-04  1:27   ` Tony Lindgren
@ 2011-02-04 12:04     ` Grazvydas Ignotas
  -1 siblings, 0 replies; 32+ messages in thread
From: Grazvydas Ignotas @ 2011-02-04 12:04 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

On Fri, Feb 4, 2011 at 3:27 AM, Tony Lindgren <tony@atomide.com> wrote:
> Set the debug serial port based on machine ID. Note that most
> of the patch is just trivial checking for the machine ID.
>
> Also note that this code won't work for debugging the uncompress code.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---

<snip>
> diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
> index 336a838..45c29e3 100644
> --- a/arch/arm/mach-omap2/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
<snip>

> +
> +               /* omap3 based boards using uart3 */
> +               ldr     \v, =MACH_TYPE_CM_T35
> +               cmp     \id, \v
> +               ldrne   \v, =MACH_TYPE_CM_T3517
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_CRANEBOARD
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_DEVKIT8000
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_IGEP0020
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_IGEP0030
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_NOKIA_RM680
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_NOKIA_RX51
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_OMAP3517EVM
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_OMAP3_BEAGLE
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_OMAP3_PANDORA
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_OMAP_LDP
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_OVERO
> +               cmpne   \id, \v
> +               ldrne   \v, =MACH_TYPE_TOUCHBOOK
> +               cmpne   \id, \v
> +               ldreq   \v, =OMAP3_UART3_BASE
> +               streq   \v, [\a, #0]            @ save port phys addr
> +               ldreq   \v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
> +               streq   \v, [\a, #4]            @ save port virt addr
> +               beq     999f

This looks a bit wasteful not only because of repeated CMPs, but also
LDRs are generating a large literal pool. Maybe something like that be
better:

    adr     r0, uart3_machines
0:
    ldrh    \v, [r0], #2
    tst     \v, \v
    beq     999f                    @ end of list
    cmp     \id, \v
    bne     0b
    ldr     \v, =OMAP3_UART3_BASE
    str     \v, [\a, #0]            @ save port phys addr
    ldr     \v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
    str     \v, [\a, #4]            @ save port virt addr
    b       999f

    uart3_machines:
    .short MACH_TYPE_CM_T35
    .short MACH_TYPE_CM_T3517
    ...
    .short 0

of course this needs an extra register..
--
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] 32+ messages in thread

* [PATCH 2/5] omap: Use inituart to configure the debug serial port based on machine ID
@ 2011-02-04 12:04     ` Grazvydas Ignotas
  0 siblings, 0 replies; 32+ messages in thread
From: Grazvydas Ignotas @ 2011-02-04 12:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 4, 2011 at 3:27 AM, Tony Lindgren <tony@atomide.com> wrote:
> Set the debug serial port based on machine ID. Note that most
> of the patch is just trivial checking for the machine ID.
>
> Also note that this code won't work for debugging the uncompress code.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---

<snip>
> diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
> index 336a838..45c29e3 100644
> --- a/arch/arm/mach-omap2/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
<snip>

> +
> + ? ? ? ? ? ? ? /* omap3 based boards using uart3 */
> + ? ? ? ? ? ? ? ldr ? ? \v, =MACH_TYPE_CM_T35
> + ? ? ? ? ? ? ? cmp ? ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_CM_T3517
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_CRANEBOARD
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_DEVKIT8000
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_IGEP0020
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_IGEP0030
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_NOKIA_RM680
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_NOKIA_RX51
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_OMAP3517EVM
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_OMAP3_BEAGLE
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_OMAP3_PANDORA
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_OMAP_LDP
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_OVERO
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldrne ? \v, =MACH_TYPE_TOUCHBOOK
> + ? ? ? ? ? ? ? cmpne ? \id, \v
> + ? ? ? ? ? ? ? ldreq ? \v, =OMAP3_UART3_BASE
> + ? ? ? ? ? ? ? streq ? \v, [\a, #0] ? ? ? ? ? ?@ save port phys addr
> + ? ? ? ? ? ? ? ldreq ? \v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
> + ? ? ? ? ? ? ? streq ? \v, [\a, #4] ? ? ? ? ? ?@ save port virt addr
> + ? ? ? ? ? ? ? beq ? ? 999f

This looks a bit wasteful not only because of repeated CMPs, but also
LDRs are generating a large literal pool. Maybe something like that be
better:

    adr     r0, uart3_machines
0:
    ldrh    \v, [r0], #2
    tst     \v, \v
    beq     999f                    @ end of list
    cmp     \id, \v
    bne     0b
    ldr     \v, =OMAP3_UART3_BASE
    str     \v, [\a, #0]            @ save port phys addr
    ldr     \v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
    str     \v, [\a, #4]            @ save port virt addr
    b       999f

    uart3_machines:
    .short MACH_TYPE_CM_T35
    .short MACH_TYPE_CM_T3517
    ...
    .short 0

of course this needs an extra register..

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

* Re: [PATCH 2/5] omap: Use inituart to configure the debug serial port based on machine ID
  2011-02-04 12:04     ` Grazvydas Ignotas
@ 2011-02-04 16:49       ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04 16:49 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-arm-kernel, linux-omap

* Grazvydas Ignotas <notasas@gmail.com> [110204 04:03]:
> On Fri, Feb 4, 2011 at 3:27 AM, Tony Lindgren <tony@atomide.com> wrote:
> > Set the debug serial port based on machine ID. Note that most
> > of the patch is just trivial checking for the machine ID.
> >
..
 
> This looks a bit wasteful not only because of repeated CMPs, but also
> LDRs are generating a large literal pool. Maybe something like that be
> better:
> 
>     adr     r0, uart3_machines
> 0:
>     ldrh    \v, [r0], #2
>     tst     \v, \v
>     beq     999f                    @ end of list
>     cmp     \id, \v
>     bne     0b
>     ldr     \v, =OMAP3_UART3_BASE
>     str     \v, [\a, #0]            @ save port phys addr
>     ldr     \v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
>     str     \v, [\a, #4]            @ save port virt addr
>     b       999f
> 
>     uart3_machines:
>     .short MACH_TYPE_CM_T35
>     .short MACH_TYPE_CM_T3517
>     ...
>     .short 0
> 
> of course this needs an extra register..

Hmm, addruart and busyuart are limited with registers, but
inituart may not be. I'll take a look if that can be done.

Regards,

Tony

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

* [PATCH 2/5] omap: Use inituart to configure the debug serial port based on machine ID
@ 2011-02-04 16:49       ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04 16:49 UTC (permalink / raw)
  To: linux-arm-kernel

* Grazvydas Ignotas <notasas@gmail.com> [110204 04:03]:
> On Fri, Feb 4, 2011 at 3:27 AM, Tony Lindgren <tony@atomide.com> wrote:
> > Set the debug serial port based on machine ID. Note that most
> > of the patch is just trivial checking for the machine ID.
> >
..
 
> This looks a bit wasteful not only because of repeated CMPs, but also
> LDRs are generating a large literal pool. Maybe something like that be
> better:
> 
>     adr     r0, uart3_machines
> 0:
>     ldrh    \v, [r0], #2
>     tst     \v, \v
>     beq     999f                    @ end of list
>     cmp     \id, \v
>     bne     0b
>     ldr     \v, =OMAP3_UART3_BASE
>     str     \v, [\a, #0]            @ save port phys addr
>     ldr     \v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
>     str     \v, [\a, #4]            @ save port virt addr
>     b       999f
> 
>     uart3_machines:
>     .short MACH_TYPE_CM_T35
>     .short MACH_TYPE_CM_T3517
>     ...
>     .short 0
> 
> of course this needs an extra register..

Hmm, addruart and busyuart are limited with registers, but
inituart may not be. I'll take a look if that can be done.

Regards,

Tony

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

* Re: [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
  2011-02-04  3:33     ` Nicolas Pitre
@ 2011-02-04 17:02       ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04 17:02 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: linux-arm-kernel, linux-omap

* Nicolas Pitre <nico@fluxnic.net> [110203 19:32]:
> On Thu, 3 Feb 2011, Tony Lindgren wrote:
> 
> > This way we can have the debug-macro.S be common for omap1 and omap2+
> > and get sensible error messages booting the wrong zImage with
> > CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
> > with u-boot and uImage.
...
 
> Gaaaaah!  This is horrible.

-ENOREGISTERS :)
 
> OK, you do want to store data in memory, right?  So the best way to 
> always be position independent, even cross section, is to do the 
> following (inspired by RMK's trick in the p2v series):
> 
> 	.data
> 
> foo:	.word	0	@ value for sput
> 	.word	0	@ value for nik
> 
> 	.text
> 
> bar:	.word	.
> 	.word	foo
> 
> sputnik:
> 
> 	adr	r0, bar		@ get relative address of bar
> 	ldr	r1, [r0]	@ get absolute address of bar
> 	sub	r1, r1, r0	@ difference between abs and rel address
> 	ldr	r0, [r0, #4]	@ get absolute address of foo
> 	sub	r0, r0, r1	@ turn that into a relative address
> 
> 	ldmia	r0, {r1, r2}	@ retrieve sput and nik
> 	add	r0, r1, r2
> 	mov	pc, lr
> 
> This code is totally position independent, so it works whether or not 
> the MMU is active.  Therefore a similar technique in your macro (you 
> could even put it into a macro for it) would allow you to get rid of the 
> mrc and test for MMU active, get rid of the #ifdef, and not be limited 
> to a 128 MB mask, etc.  And it is just one word longer than your 
> shortest version i.e. 2 constants + 5 instructions vs 4 instructions + 2 
> literal pool entries.

I think if we keep the address of the memory location in rx instead of
the port address value, then this could be done.

That would limit all the trickery to inituart only. Then addruart and
busyuart could just do ldr from the memory location to get the port
data without any trickery.

In that case the mapping of IO space for the serial port in head.S
would have to be changed as that relies on rx containing the port
IO address..

Regards,

Tony

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

* [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
@ 2011-02-04 17:02       ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04 17:02 UTC (permalink / raw)
  To: linux-arm-kernel

* Nicolas Pitre <nico@fluxnic.net> [110203 19:32]:
> On Thu, 3 Feb 2011, Tony Lindgren wrote:
> 
> > This way we can have the debug-macro.S be common for omap1 and omap2+
> > and get sensible error messages booting the wrong zImage with
> > CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
> > with u-boot and uImage.
...
 
> Gaaaaah!  This is horrible.

-ENOREGISTERS :)
 
> OK, you do want to store data in memory, right?  So the best way to 
> always be position independent, even cross section, is to do the 
> following (inspired by RMK's trick in the p2v series):
> 
> 	.data
> 
> foo:	.word	0	@ value for sput
> 	.word	0	@ value for nik
> 
> 	.text
> 
> bar:	.word	.
> 	.word	foo
> 
> sputnik:
> 
> 	adr	r0, bar		@ get relative address of bar
> 	ldr	r1, [r0]	@ get absolute address of bar
> 	sub	r1, r1, r0	@ difference between abs and rel address
> 	ldr	r0, [r0, #4]	@ get absolute address of foo
> 	sub	r0, r0, r1	@ turn that into a relative address
> 
> 	ldmia	r0, {r1, r2}	@ retrieve sput and nik
> 	add	r0, r1, r2
> 	mov	pc, lr
> 
> This code is totally position independent, so it works whether or not 
> the MMU is active.  Therefore a similar technique in your macro (you 
> could even put it into a macro for it) would allow you to get rid of the 
> mrc and test for MMU active, get rid of the #ifdef, and not be limited 
> to a 128 MB mask, etc.  And it is just one word longer than your 
> shortest version i.e. 2 constants + 5 instructions vs 4 instructions + 2 
> literal pool entries.

I think if we keep the address of the memory location in rx instead of
the port address value, then this could be done.

That would limit all the trickery to inituart only. Then addruart and
busyuart could just do ldr from the memory location to get the port
data without any trickery.

In that case the mapping of IO space for the serial port in head.S
would have to be changed as that relies on rx containing the port
IO address..

Regards,

Tony

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

* Re: [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
  2011-02-04  3:33     ` Nicolas Pitre
@ 2011-02-04 17:15       ` Russell King - ARM Linux
  -1 siblings, 0 replies; 32+ messages in thread
From: Russell King - ARM Linux @ 2011-02-04 17:15 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Tony Lindgren, linux-omap, linux-arm-kernel

On Thu, Feb 03, 2011 at 10:33:42PM -0500, Nicolas Pitre wrote:
> On Thu, 3 Feb 2011, Tony Lindgren wrote:
> 
> > This way we can have the debug-macro.S be common for omap1 and omap2+
> > and get sensible error messages booting the wrong zImage with
> > CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
> > with u-boot and uImage.
> > 
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >  arch/arm/mach-omap1/include/mach/debug-macro.S |   36 ++++++++++++++++++++----
> >  arch/arm/mach-omap2/include/mach/debug-macro.S |   27 +++++++++++++++++-
> >  2 files changed, 56 insertions(+), 7 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > index 80dcf18..bae924e 100644
> > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > @@ -27,7 +27,15 @@
> >  		.macro	inituart, id, a, v
> >  		mrc	p15, 0, \a, c1, c0
> >  		tst	\a, #1			@ MMU enabled?
> > +#ifdef CONFIG_AUTO_ZRELADDR
> > +		ldreq	\a, =omap_uart_phys
> > +		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
> > +		moveq	\v, pc			@ copy pc
> > +		andeq	\v, \v, #0xf8000000	@ clear lower bits
> > +		orreq	\a, \v			@ combile to get phys addr
> > +#else
> >  		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
> > +#endif
> >  		ldrne	\a, =omap_uart_phys
> 
> Gaaaaah!  This is horrible.
> 
> OK, you do want to store data in memory, right?  So the best way to 
> always be position independent, even cross section, is to do the 
> following (inspired by RMK's trick in the p2v series):

The other point to make is that for every machine in OMAP1, the
serial port is located at 0xffXXXXXX virtual, 0xfeXXXXXX physical.
For OMAP2, that's 0xfaXXXXXX virtual and 0x48XXXXXX physical.

So it's pointless storing both the virtual and physical addresses
as we can compute one from the other with a single instruction.
That gets rid of some of the complexity found in the debugging code.

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

* [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
@ 2011-02-04 17:15       ` Russell King - ARM Linux
  0 siblings, 0 replies; 32+ messages in thread
From: Russell King - ARM Linux @ 2011-02-04 17:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 03, 2011 at 10:33:42PM -0500, Nicolas Pitre wrote:
> On Thu, 3 Feb 2011, Tony Lindgren wrote:
> 
> > This way we can have the debug-macro.S be common for omap1 and omap2+
> > and get sensible error messages booting the wrong zImage with
> > CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
> > with u-boot and uImage.
> > 
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >  arch/arm/mach-omap1/include/mach/debug-macro.S |   36 ++++++++++++++++++++----
> >  arch/arm/mach-omap2/include/mach/debug-macro.S |   27 +++++++++++++++++-
> >  2 files changed, 56 insertions(+), 7 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > index 80dcf18..bae924e 100644
> > --- a/arch/arm/mach-omap1/include/mach/debug-macro.S
> > +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
> > @@ -27,7 +27,15 @@
> >  		.macro	inituart, id, a, v
> >  		mrc	p15, 0, \a, c1, c0
> >  		tst	\a, #1			@ MMU enabled?
> > +#ifdef CONFIG_AUTO_ZRELADDR
> > +		ldreq	\a, =omap_uart_phys
> > +		biceq	\a, \a, #0xf8000000	@ clear top bits of virt addr
> > +		moveq	\v, pc			@ copy pc
> > +		andeq	\v, \v, #0xf8000000	@ clear lower bits
> > +		orreq	\a, \v			@ combile to get phys addr
> > +#else
> >  		ldreq	\a, =omap_uart_v2p(omap_uart_phys)
> > +#endif
> >  		ldrne	\a, =omap_uart_phys
> 
> Gaaaaah!  This is horrible.
> 
> OK, you do want to store data in memory, right?  So the best way to 
> always be position independent, even cross section, is to do the 
> following (inspired by RMK's trick in the p2v series):

The other point to make is that for every machine in OMAP1, the
serial port is located at 0xffXXXXXX virtual, 0xfeXXXXXX physical.
For OMAP2, that's 0xfaXXXXXX virtual and 0x48XXXXXX physical.

So it's pointless storing both the virtual and physical addresses
as we can compute one from the other with a single instruction.
That gets rid of some of the complexity found in the debugging code.

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

* Re: [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
  2011-02-04 17:15       ` Russell King - ARM Linux
@ 2011-02-04 18:36         ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04 18:36 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: Nicolas Pitre, linux-omap, linux-arm-kernel

* Russell King - ARM Linux <linux@arm.linux.org.uk> [110204 09:14]:
> 
> The other point to make is that for every machine in OMAP1, the
> serial port is located at 0xffXXXXXX virtual, 0xfeXXXXXX physical.
> For OMAP2, that's 0xfaXXXXXX virtual and 0x48XXXXXX physical.
>
> So it's pointless storing both the virtual and physical addresses
> as we can compute one from the other with a single instruction.
> That gets rid of some of the complexity found in the debugging code.

OK. The zoom boards have external 8250 on the GPMC bus.

Tony

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

* [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
@ 2011-02-04 18:36         ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04 18:36 UTC (permalink / raw)
  To: linux-arm-kernel

* Russell King - ARM Linux <linux@arm.linux.org.uk> [110204 09:14]:
> 
> The other point to make is that for every machine in OMAP1, the
> serial port is located at 0xffXXXXXX virtual, 0xfeXXXXXX physical.
> For OMAP2, that's 0xfaXXXXXX virtual and 0x48XXXXXX physical.
>
> So it's pointless storing both the virtual and physical addresses
> as we can compute one from the other with a single instruction.
> That gets rid of some of the complexity found in the debugging code.

OK. The zoom boards have external 8250 on the GPMC bus.

Tony

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

* Re: [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
  2011-02-04 17:02       ` Tony Lindgren
@ 2011-02-04 20:16         ` Nicolas Pitre
  -1 siblings, 0 replies; 32+ messages in thread
From: Nicolas Pitre @ 2011-02-04 20:16 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

On Fri, 4 Feb 2011, Tony Lindgren wrote:

> * Nicolas Pitre <nico@fluxnic.net> [110203 19:32]:
> > On Thu, 3 Feb 2011, Tony Lindgren wrote:
> > 
> > > This way we can have the debug-macro.S be common for omap1 and omap2+
> > > and get sensible error messages booting the wrong zImage with
> > > CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
> > > with u-boot and uImage.
> ...
>  
> > Gaaaaah!  This is horrible.
> 
> -ENOREGISTERS :)
>  
> > OK, you do want to store data in memory, right?  So the best way to 
> > always be position independent, even cross section, is to do the 
> > following (inspired by RMK's trick in the p2v series):
> > 
> > 	.data
> > 
> > foo:	.word	0	@ value for sput
> > 	.word	0	@ value for nik
> > 
> > 	.text
> > 
> > bar:	.word	.
> > 	.word	foo
> > 
> > sputnik:
> > 
> > 	adr	r0, bar		@ get relative address of bar
> > 	ldr	r1, [r0]	@ get absolute address of bar
> > 	sub	r1, r1, r0	@ difference between abs and rel address
> > 	ldr	r0, [r0, #4]	@ get absolute address of foo
> > 	sub	r0, r0, r1	@ turn that into a relative address
> > 
> > 	ldmia	r0, {r1, r2}	@ retrieve sput and nik
> > 	add	r0, r1, r2
> > 	mov	pc, lr
> > 
> > This code is totally position independent, so it works whether or not 
> > the MMU is active.  Therefore a similar technique in your macro (you 
> > could even put it into a macro for it) would allow you to get rid of the 
> > mrc and test for MMU active, get rid of the #ifdef, and not be limited 
> > to a 128 MB mask, etc.  And it is just one word longer than your 
> > shortest version i.e. 2 constants + 5 instructions vs 4 instructions + 2 
> > literal pool entries.
> 
> I think if we keep the address of the memory location in rx instead of
> the port address value, then this could be done.
> 
> That would limit all the trickery to inituart only. Then addruart and
> busyuart could just do ldr from the memory location to get the port
> data without any trickery.

Just create a get_config_ptr macro or similar and the trickery will be 
nicely encapsulated.  You'd have:

	.macro get_config_ptr ptr, tmp
	b	9002f
	.align
9001:	.long	.
	.long	uart_param_storage
9002:	adr	\ptr, 9001b
	ldr	\tmp, [\ptr]
	sub	\tmp, \tmp, \ptr
	ldr	\ptr, [\ptr, #4]
	sub	\ptr, \ptr, \tmp
	.endm

	.macro addruart rp, rv
	get_config_ptr \rv
	ldr	\rp, [\rv]
	ldr	\rv, [\rv, #4]
	.endm

And for the other macros, you get the hardware address to use already, 
but you can still use get_config_ptr for extra config values you 
need if necessary.

> In that case the mapping of IO space for the serial port in head.S
> would have to be changed as that relies on rx containing the port
> IO address..

Yes, and I'm not sure if it is worth changing that at this point when it 
is possible to do it without introducing such a change which would 
affect all machines again.


Nicolas

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

* [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
@ 2011-02-04 20:16         ` Nicolas Pitre
  0 siblings, 0 replies; 32+ messages in thread
From: Nicolas Pitre @ 2011-02-04 20:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 4 Feb 2011, Tony Lindgren wrote:

> * Nicolas Pitre <nico@fluxnic.net> [110203 19:32]:
> > On Thu, 3 Feb 2011, Tony Lindgren wrote:
> > 
> > > This way we can have the debug-macro.S be common for omap1 and omap2+
> > > and get sensible error messages booting the wrong zImage with
> > > CONFIG_AUTO_ZRELADDR selected. Note that this does not seem to work
> > > with u-boot and uImage.
> ...
>  
> > Gaaaaah!  This is horrible.
> 
> -ENOREGISTERS :)
>  
> > OK, you do want to store data in memory, right?  So the best way to 
> > always be position independent, even cross section, is to do the 
> > following (inspired by RMK's trick in the p2v series):
> > 
> > 	.data
> > 
> > foo:	.word	0	@ value for sput
> > 	.word	0	@ value for nik
> > 
> > 	.text
> > 
> > bar:	.word	.
> > 	.word	foo
> > 
> > sputnik:
> > 
> > 	adr	r0, bar		@ get relative address of bar
> > 	ldr	r1, [r0]	@ get absolute address of bar
> > 	sub	r1, r1, r0	@ difference between abs and rel address
> > 	ldr	r0, [r0, #4]	@ get absolute address of foo
> > 	sub	r0, r0, r1	@ turn that into a relative address
> > 
> > 	ldmia	r0, {r1, r2}	@ retrieve sput and nik
> > 	add	r0, r1, r2
> > 	mov	pc, lr
> > 
> > This code is totally position independent, so it works whether or not 
> > the MMU is active.  Therefore a similar technique in your macro (you 
> > could even put it into a macro for it) would allow you to get rid of the 
> > mrc and test for MMU active, get rid of the #ifdef, and not be limited 
> > to a 128 MB mask, etc.  And it is just one word longer than your 
> > shortest version i.e. 2 constants + 5 instructions vs 4 instructions + 2 
> > literal pool entries.
> 
> I think if we keep the address of the memory location in rx instead of
> the port address value, then this could be done.
> 
> That would limit all the trickery to inituart only. Then addruart and
> busyuart could just do ldr from the memory location to get the port
> data without any trickery.

Just create a get_config_ptr macro or similar and the trickery will be 
nicely encapsulated.  You'd have:

	.macro get_config_ptr ptr, tmp
	b	9002f
	.align
9001:	.long	.
	.long	uart_param_storage
9002:	adr	\ptr, 9001b
	ldr	\tmp, [\ptr]
	sub	\tmp, \tmp, \ptr
	ldr	\ptr, [\ptr, #4]
	sub	\ptr, \ptr, \tmp
	.endm

	.macro addruart rp, rv
	get_config_ptr \rv
	ldr	\rp, [\rv]
	ldr	\rv, [\rv, #4]
	.endm

And for the other macros, you get the hardware address to use already, 
but you can still use get_config_ptr for extra config values you 
need if necessary.

> In that case the mapping of IO space for the serial port in head.S
> would have to be changed as that relies on rx containing the port
> IO address..

Yes, and I'm not sure if it is worth changing that at this point when it 
is possible to do it without introducing such a change which would 
affect all machines again.


Nicolas

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

* Re: [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
  2011-02-04 20:16         ` Nicolas Pitre
@ 2011-02-04 20:24           ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04 20:24 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: linux-arm-kernel, linux-omap

* Nicolas Pitre <nico@fluxnic.net> [110204 12:14]:
> 
> Just create a get_config_ptr macro or similar and the trickery will be 
> nicely encapsulated.  You'd have:
> 
> 	.macro get_config_ptr ptr, tmp
> 	b	9002f
> 	.align
> 9001:	.long	.
> 	.long	uart_param_storage
> 9002:	adr	\ptr, 9001b
> 	ldr	\tmp, [\ptr]
> 	sub	\tmp, \tmp, \ptr
> 	ldr	\ptr, [\ptr, #4]
> 	sub	\ptr, \ptr, \tmp
> 	.endm
> 
> 	.macro addruart rp, rv
> 	get_config_ptr \rv
> 	ldr	\rp, [\rv]
> 	ldr	\rv, [\rv, #4]
> 	.endm
> 
> And for the other macros, you get the hardware address to use already, 
> but you can still use get_config_ptr for extra config values you 
> need if necessary.

Thanks, will try that out next week. That might run into problems with
busyuart as it only has rd register to play with.
 
> > In that case the mapping of IO space for the serial port in head.S
> > would have to be changed as that relies on rx containing the port
> > IO address..
> 
> Yes, and I'm not sure if it is worth changing that at this point when it 
> is possible to do it without introducing such a change which would 
> affect all machines again.

Agreed, let's see how far we can get with the existing setup.

What might need to be done is to save and restore rx in
busyuart to be able to use your macro above.

Tony

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

* [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
@ 2011-02-04 20:24           ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-02-04 20:24 UTC (permalink / raw)
  To: linux-arm-kernel

* Nicolas Pitre <nico@fluxnic.net> [110204 12:14]:
> 
> Just create a get_config_ptr macro or similar and the trickery will be 
> nicely encapsulated.  You'd have:
> 
> 	.macro get_config_ptr ptr, tmp
> 	b	9002f
> 	.align
> 9001:	.long	.
> 	.long	uart_param_storage
> 9002:	adr	\ptr, 9001b
> 	ldr	\tmp, [\ptr]
> 	sub	\tmp, \tmp, \ptr
> 	ldr	\ptr, [\ptr, #4]
> 	sub	\ptr, \ptr, \tmp
> 	.endm
> 
> 	.macro addruart rp, rv
> 	get_config_ptr \rv
> 	ldr	\rp, [\rv]
> 	ldr	\rv, [\rv, #4]
> 	.endm
> 
> And for the other macros, you get the hardware address to use already, 
> but you can still use get_config_ptr for extra config values you 
> need if necessary.

Thanks, will try that out next week. That might run into problems with
busyuart as it only has rd register to play with.
 
> > In that case the mapping of IO space for the serial port in head.S
> > would have to be changed as that relies on rx containing the port
> > IO address..
> 
> Yes, and I'm not sure if it is worth changing that at this point when it 
> is possible to do it without introducing such a change which would 
> affect all machines again.

Agreed, let's see how far we can get with the existing setup.

What might need to be done is to save and restore rx in
busyuart to be able to use your macro above.

Tony

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

* Re: [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
  2011-02-04 20:24           ` Tony Lindgren
@ 2011-02-04 20:33             ` Nicolas Pitre
  -1 siblings, 0 replies; 32+ messages in thread
From: Nicolas Pitre @ 2011-02-04 20:33 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

On Fri, 4 Feb 2011, Tony Lindgren wrote:

> * Nicolas Pitre <nico@fluxnic.net> [110204 12:14]:
> > 
> > Just create a get_config_ptr macro or similar and the trickery will be 
> > nicely encapsulated.  You'd have:
> > 
> > 	.macro get_config_ptr ptr, tmp
> > 	b	9002f
> > 	.align
> > 9001:	.long	.
> > 	.long	uart_param_storage
> > 9002:	adr	\ptr, 9001b
> > 	ldr	\tmp, [\ptr]
> > 	sub	\tmp, \tmp, \ptr
> > 	ldr	\ptr, [\ptr, #4]
> > 	sub	\ptr, \ptr, \tmp
> > 	.endm
> > 
> > 	.macro addruart rp, rv
> > 	get_config_ptr \rv
> > 	ldr	\rp, [\rv]
> > 	ldr	\rv, [\rv, #4]
> > 	.endm
> > 
> > And for the other macros, you get the hardware address to use already, 
> > but you can still use get_config_ptr for extra config values you 
> > need if necessary.
> 
> Thanks, will try that out next week. That might run into problems with
> busyuart as it only has rd register to play with.

With some code auditing we could declare ip as being callee clobberable 
with those macros.


Nicolas

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

* [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
@ 2011-02-04 20:33             ` Nicolas Pitre
  0 siblings, 0 replies; 32+ messages in thread
From: Nicolas Pitre @ 2011-02-04 20:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 4 Feb 2011, Tony Lindgren wrote:

> * Nicolas Pitre <nico@fluxnic.net> [110204 12:14]:
> > 
> > Just create a get_config_ptr macro or similar and the trickery will be 
> > nicely encapsulated.  You'd have:
> > 
> > 	.macro get_config_ptr ptr, tmp
> > 	b	9002f
> > 	.align
> > 9001:	.long	.
> > 	.long	uart_param_storage
> > 9002:	adr	\ptr, 9001b
> > 	ldr	\tmp, [\ptr]
> > 	sub	\tmp, \tmp, \ptr
> > 	ldr	\ptr, [\ptr, #4]
> > 	sub	\ptr, \ptr, \tmp
> > 	.endm
> > 
> > 	.macro addruart rp, rv
> > 	get_config_ptr \rv
> > 	ldr	\rp, [\rv]
> > 	ldr	\rv, [\rv, #4]
> > 	.endm
> > 
> > And for the other macros, you get the hardware address to use already, 
> > but you can still use get_config_ptr for extra config values you 
> > need if necessary.
> 
> Thanks, will try that out next week. That might run into problems with
> busyuart as it only has rd register to play with.

With some code auditing we could declare ip as being callee clobberable 
with those macros.


Nicolas

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

* Re: [PATCH 0/5] Change omap DEBUG_LL code to use inituart for AUTO_ZRELADDR and ARM_PATCH_PHYS_VIRT
  2011-02-04  1:26 ` Tony Lindgren
@ 2011-02-09  6:08   ` Poddar, Sourav
  -1 siblings, 0 replies; 32+ messages in thread
From: Poddar, Sourav @ 2011-02-09  6:08 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, linux-arm-kernel

On Fri, Feb 4, 2011 at 6:56 AM, Tony Lindgren <tony@atomide.com> wrote:
> Here are the changes to make omap DEBUG_LL code generic using
> the new inituart macro posted in a separate series. This allows
> leaving out the dependency to the uncompress code and allows
> error messages when trying to boot a wrong zImage.
>
> Adding support for new machines should be only additional two
> lines of assembly per machine after these patches.
>
> Regards,
>
> Tony
>
> ---
>
> Tony Lindgren (5):
>      omap: Remove code configuring the DEBUG_LL serial port using uncompress code
>      omap: Use inituart to configure the debug serial port based on machine ID
>      omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
>      omap: Combine debug-macro.S for omap1 and omap2+
>      omap: Add CONFIG_AUTO_ZRELADDR and CONFIG_ARM_PATCH_PHYS_VIRT to defconfigs
>
>
>  arch/arm/configs/omap1_defconfig               |    2
>  arch/arm/configs/omap2plus_defconfig           |    2
>  arch/arm/mach-omap1/include/mach/debug-macro.S |   98 ---------
>  arch/arm/mach-omap1/serial.c                   |    7 +
>  arch/arm/mach-omap2/include/mach/debug-macro.S |  138 -------------
>  arch/arm/mach-omap2/serial.c                   |    7 +
>  arch/arm/plat-omap/include/plat/debug-macro.S  |  257 ++++++++++++++++++++++++
>  arch/arm/plat-omap/include/plat/serial.h       |   34 ---
>  arch/arm/plat-omap/include/plat/uncompress.h   |   32 +--
>  9 files changed, 284 insertions(+), 293 deletions(-)
>  create mode 100644 arch/arm/plat-omap/include/plat/debug-macro.

Boot tested linux-next branch with omap2plus_defconfig using NFS filesystem
along with the above 5 patch series and
2 patch series (Allow using machine ID for DEBUG_LL macros)
on Omap 2420,2430,3430 SDPs and Omap4 blaze.

Tested-by: Sourav Poddar<sourav.poddar@ti.com>

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

* [PATCH 0/5] Change omap DEBUG_LL code to use inituart for AUTO_ZRELADDR and ARM_PATCH_PHYS_VIRT
@ 2011-02-09  6:08   ` Poddar, Sourav
  0 siblings, 0 replies; 32+ messages in thread
From: Poddar, Sourav @ 2011-02-09  6:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 4, 2011 at 6:56 AM, Tony Lindgren <tony@atomide.com> wrote:
> Here are the changes to make omap DEBUG_LL code generic using
> the new inituart macro posted in a separate series. This allows
> leaving out the dependency to the uncompress code and allows
> error messages when trying to boot a wrong zImage.
>
> Adding support for new machines should be only additional two
> lines of assembly per machine after these patches.
>
> Regards,
>
> Tony
>
> ---
>
> Tony Lindgren (5):
> ? ? ?omap: Remove code configuring the DEBUG_LL serial port using uncompress code
> ? ? ?omap: Use inituart to configure the debug serial port based on machine ID
> ? ? ?omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL
> ? ? ?omap: Combine debug-macro.S for omap1 and omap2+
> ? ? ?omap: Add CONFIG_AUTO_ZRELADDR and CONFIG_ARM_PATCH_PHYS_VIRT to defconfigs
>
>
> ?arch/arm/configs/omap1_defconfig ? ? ? ? ? ? ? | ? ?2
> ?arch/arm/configs/omap2plus_defconfig ? ? ? ? ? | ? ?2
> ?arch/arm/mach-omap1/include/mach/debug-macro.S | ? 98 ---------
> ?arch/arm/mach-omap1/serial.c ? ? ? ? ? ? ? ? ? | ? ?7 +
> ?arch/arm/mach-omap2/include/mach/debug-macro.S | ?138 -------------
> ?arch/arm/mach-omap2/serial.c ? ? ? ? ? ? ? ? ? | ? ?7 +
> ?arch/arm/plat-omap/include/plat/debug-macro.S ?| ?257 ++++++++++++++++++++++++
> ?arch/arm/plat-omap/include/plat/serial.h ? ? ? | ? 34 ---
> ?arch/arm/plat-omap/include/plat/uncompress.h ? | ? 32 +--
> ?9 files changed, 284 insertions(+), 293 deletions(-)
> ?create mode 100644 arch/arm/plat-omap/include/plat/debug-macro.

Boot tested linux-next branch with omap2plus_defconfig using NFS filesystem
along with the above 5 patch series and
2 patch series (Allow using machine ID for DEBUG_LL macros)
on Omap 2420,2430,3430 SDPs and Omap4 blaze.

Tested-by: Sourav Poddar<sourav.poddar@ti.com>

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

end of thread, other threads:[~2011-02-09  6:08 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-04  1:26 [PATCH 0/5] Change omap DEBUG_LL code to use inituart for AUTO_ZRELADDR and ARM_PATCH_PHYS_VIRT Tony Lindgren
2011-02-04  1:26 ` Tony Lindgren
2011-02-04  1:27 ` [PATCH 1/5] omap: Remove code configuring the DEBUG_LL serial port using uncompress code Tony Lindgren
2011-02-04  1:27   ` Tony Lindgren
2011-02-04  1:27 ` [PATCH 2/5] omap: Use inituart to configure the debug serial port based on machine ID Tony Lindgren
2011-02-04  1:27   ` Tony Lindgren
2011-02-04 12:04   ` Grazvydas Ignotas
2011-02-04 12:04     ` Grazvydas Ignotas
2011-02-04 16:49     ` Tony Lindgren
2011-02-04 16:49       ` Tony Lindgren
2011-02-04  1:27 ` [PATCH 3/5] omap: Add support for CONFIG_AUTO_ZRELADDR for DEBUG_LL Tony Lindgren
2011-02-04  1:27   ` Tony Lindgren
2011-02-04  3:33   ` Nicolas Pitre
2011-02-04  3:33     ` Nicolas Pitre
2011-02-04 17:02     ` Tony Lindgren
2011-02-04 17:02       ` Tony Lindgren
2011-02-04 20:16       ` Nicolas Pitre
2011-02-04 20:16         ` Nicolas Pitre
2011-02-04 20:24         ` Tony Lindgren
2011-02-04 20:24           ` Tony Lindgren
2011-02-04 20:33           ` Nicolas Pitre
2011-02-04 20:33             ` Nicolas Pitre
2011-02-04 17:15     ` Russell King - ARM Linux
2011-02-04 17:15       ` Russell King - ARM Linux
2011-02-04 18:36       ` Tony Lindgren
2011-02-04 18:36         ` Tony Lindgren
2011-02-04  1:27 ` [PATCH 4/5] omap: Combine debug-macro.S for omap1 and omap2+ Tony Lindgren
2011-02-04  1:27   ` Tony Lindgren
2011-02-04  1:27 ` [PATCH 5/5] omap: Add CONFIG_AUTO_ZRELADDR and CONFIG_ARM_PATCH_PHYS_VIRT to defconfigs Tony Lindgren
2011-02-04  1:27   ` Tony Lindgren
2011-02-09  6:08 ` [PATCH 0/5] Change omap DEBUG_LL code to use inituart for AUTO_ZRELADDR and ARM_PATCH_PHYS_VIRT Poddar, Sourav
2011-02-09  6:08   ` Poddar, Sourav

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.