Skip to contentSkip to conversation

ARM: davinci: implement DEBUG_LL port choice

PATCH New Uwe Kleine-König 2 participants 6 messages Mar 15, 2012 – Apr 29, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: davinci: implement DEBUG_LL port choice

Apart from the necessity to do this change for multi-platform kernels the previous logic depended on the zImage decompressor to write the physical and virtual address to a magic memory location. If the decompressor is unused or not correctly configured for the current machid, the addruart macro was an infinite loop. Moreover debugging the early zImage code was not possible either.

---
 arch/arm/Kconfig.debug                           |   16 ++++++
 arch/arm/mach-davinci/include/mach/debug-macro.S |   58 ++++++++--------------
 arch/arm/mach-davinci/include/mach/hardware.h    |    2 +-
 arch/arm/mach-davinci/include/mach/serial.h      |   10 ----
 arch/arm/mach-davinci/include/mach/uncompress.h  |   25 +++-------
 5 files changed, 44 insertions(+), 67 deletions(-)
arch/arm/Kconfig.debug +16 -0
index e0d236d..57019be 100644
@@ -108,6 +108,22 @@ choice
 		bool "Kernel low-level debugging on 9263, 9g45 and cap9"
 		depends on HAVE_AT91_DBGU1
 
+	config DEBUG_DAVINCI_UART0
+		bool "Kernel low-level debugging on Davinci using uart0
+		depends on ARCH_DAVINCI_DM644x
+
+	config DEBUG_DA8XX_UART1
+		bool "Kernel low-level debugging on DA8xx using uart1"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_DA8XX_UART2
+		bool "Kernel low-level debugging on DA8xx using uart2"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_TNETV107X_UART1
+		bool "Kernel low-level debugging on TNETV107x using uart1
+		depends on ARCH_DAVINCI_TNETV107X
+
 	config DEBUG_FOOTBRIDGE_COM1
 		bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1"
 		depends on FOOTBRIDGE
arch/arm/mach-davinci/include/mach/debug-macro.S +20 -38

66 lines not on this page · raw message

arch/arm/mach-davinci/include/mach/hardware.h +1 -1
index 414e0b9..649ddc2 100644
@@ -24,7 +24,7 @@
 /*
  * I/O mapping
  */
-#define IO_PHYS				0x01c00000UL
+#define IO_PHYS				UL(0x01c00000)
 #define IO_OFFSET			0xfd000000 /* Virtual IO = 0xfec00000 */
 #define IO_SIZE				0x00400000
 #define IO_VIRT				(IO_PHYS + IO_OFFSET)
arch/arm/mach-davinci/include/mach/serial.h +0 -10
index e347d88..46b3cd1 100644
@@ -15,16 +15,6 @@
 
 #include <mach/hardware.h>
 
-/*
- * Stolen area that contains debug uart physical and virtual addresses.  These
- * addresses are filled in by the uncompress.h code, and are used by the debug
- * macros in debug-macro.S.
- *
- * This area sits just below the page tables (see arch/arm/kernel/head.S).
- * We define it as a relative offset from start of usable RAM.
- */
-#define DAVINCI_UART_INFO_OFS	0x3ff8
-
 #define DAVINCI_UART0_BASE	(IO_PHYS + 0x20000)
 #define DAVINCI_UART1_BASE	(IO_PHYS + 0x20400)
 #define DAVINCI_UART2_BASE	(IO_PHYS + 0x20800)
arch/arm/mach-davinci/include/mach/uncompress.h +7 -18
index 9dc7cf9..25cf227 100644
@@ -41,37 +41,25 @@ static inline void flush(void)
 		barrier();
 }
 
-static inline void set_uart_info(u32 phys, void * __iomem virt)
+static inline void set_uart_info(u32 phys)
 {
-	/*
-	 * Get address of some.bss variable and round it down
-	 * a la CONFIG_AUTO_ZRELADDR.
-	 */
-	u32 ram_start = (u32)&uart & 0xf8000000;
-	u32 *uart_info = (u32 *)(ram_start + DAVINCI_UART_INFO_OFS);
-
 	uart = (u32 *)phys;
-	uart_info[0] = phys;
-	uart_info[1] = (u32)virt;
 }
 
-#define _DEBUG_LL_ENTRY(machine, phys, virt)			\
+#define _DEBUG_LL_ENTRY(machine, phys)				\
 	if (machine_is_##machine()) {				\
-		set_uart_info(phys, virt);			\
+		set_uart_info(phys);				\
 		break;						\
 	}
 
 #define DEBUG_LL_DAVINCI(machine, port)				\
-	_DEBUG_LL_ENTRY(machine, DAVINCI_UART##port##_BASE,	\
-			IO_ADDRESS(DAVINCI_UART##port##_BASE))
+	_DEBUG_LL_ENTRY(machine, DAVINCI_UART##port##_BASE)
 
 #define DEBUG_LL_DA8XX(machine, port)				\
-	_DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE,	\
-			IO_ADDRESS(DA8XX_UART##port##_BASE))
+	_DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE)
 
 #define DEBUG_LL_TNETV107X(machine, port)			\
-	_DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE,	\
-			TNETV107X_UART##port##_VIRT)
+	_DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE)
 
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
@@ -96,6 +84,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 		DEBUG_LL_DA8XX(davinci_da850_evm,	2);
 		DEBUG_LL_DA8XX(mityomapl138,		1);
 		DEBUG_LL_DA8XX(omapl138_hawkboard,	2);
+		DEBUG_LL_DA8XX(bje_display3_5,		0);
 
 		/* TNETV107x boards */
 		DEBUG_LL_TNETV107X(tnetv107x,		1);
Signature · 1 line
1.7.9.1
#1 lore raw

PATCH 1/1 ARM: davinci: implement DEBUG_LL port choice

Hello,

Quoted 30 lines · Uwe Kleine-K?nig

Apart from the necessity to do this change for multi-platform kernels the previous logic depended on the zImage decompressor to write the physical and virtual address to a magic memory location. If the decompressor is unused or not correctly configured for the current machid, the addruart macro was an infinite loop. Moreover debugging the early zImage code was not possible either.

---
 arch/arm/Kconfig.debug                           |   16 ++++++
 arch/arm/mach-davinci/include/mach/debug-macro.S |   58 ++++++++--------------
 arch/arm/mach-davinci/include/mach/hardware.h    |    2 +-
 arch/arm/mach-davinci/include/mach/serial.h      |   10 ----
 arch/arm/mach-davinci/include/mach/uncompress.h  |   25 +++-------
 5 files changed, 44 insertions(+), 67 deletions(-)
arch/arm/Kconfig.debug +6 -0
index e0d236d..57019be 100644
@@ -108,6 +108,22 @@ choice
 		bool "Kernel low-level debugging on 9263, 9g45 and cap9"
 		depends on HAVE_AT91_DBGU1
 
+	config DEBUG_DAVINCI_UART0
+		bool "Kernel low-level debugging on Davinci using uart0
+		depends on ARCH_DAVINCI_DM644x
+
+	config DEBUG_DA8XX_UART1
+		bool "Kernel low-level debugging on DA8xx using uart1"

arch/arm/Kconfig.debug choice · line 126

Quoted 10 lines
arch/arm/Kconfig.debug +10 -0
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_DA8XX_UART2
+		bool "Kernel low-level debugging on DA8xx using uart2"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_TNETV107X_UART1
+		bool "Kernel low-level debugging on TNETV107x using uart1
+		depends on ARCH_DAVINCI_TNETV107X
+

on the first and the last description line there are the closing " missing. Should I resend?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#2 lore raw

PATCH 1/1 ARM: davinci: implement DEBUG_LL port choice

Hi Uwe,

Quoted 18 lines · Uwe Kleine-K?nig
Quoted 18 lines
arch/arm/Kconfig.debug +10 -0
index e0d236d..57019be 100644
@@ -108,6 +108,22 @@ choice
 		bool "Kernel low-level debugging on 9263, 9g45 and cap9"
 		depends on HAVE_AT91_DBGU1
 
+	config DEBUG_DAVINCI_UART0
+		bool "Kernel low-level debugging on Davinci using uart0
+		depends on ARCH_DAVINCI_DM644x
+
+	config DEBUG_DA8XX_UART1
+		bool "Kernel low-level debugging on DA8xx using uart1"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_DA8XX_UART2
+		bool "Kernel low-level debugging on DA8xx using uart2"
Quoted 8 lines

arch/arm/Kconfig.debug choice · line 126

Quoted 6 lines
arch/arm/Kconfig.debug +6 -0
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_TNETV107X_UART1
+		bool "Kernel low-level debugging on TNETV107x using uart1
+		depends on ARCH_DAVINCI_TNETV107X
+

on the first and the last description line there are the closing " missing. Should I resend?

Yes, please do so. I have not yet reviewed/tested this.

Thanks,
Sekhar

#3 lore raw

PATCH v2 1/1 ARM: davinci: implement DEBUG_LL port choice

Apart from the necessity to do this change for multi-platform kernels the previous logic depended on the zImage decompressor to write the physical and virtual address to a magic memory location. If the decompressor is unused or not correctly configured for the current machid, the addruart macro was an infinite loop. Moreover debugging the early zImage code was not possible either.

---
Changes since (implicit) v1:
- add closing " to description strings
- remove debug setting for unmainlined machine id in uncompress.h

 arch/arm/Kconfig.debug                           |   16 ++++++
 arch/arm/mach-davinci/include/mach/debug-macro.S |   58 ++++++++--------------
 arch/arm/mach-davinci/include/mach/hardware.h    |    2 +-
 arch/arm/mach-davinci/include/mach/serial.h      |   10 ----
 arch/arm/mach-davinci/include/mach/uncompress.h  |   24 ++-------
 5 files changed, 43 insertions(+), 67 deletions(-)
arch/arm/Kconfig.debug +16 -0
index e0d236d..4c2fb44 100644
@@ -108,6 +108,22 @@ choice
 		bool "Kernel low-level debugging on 9263, 9g45 and cap9"
 		depends on HAVE_AT91_DBGU1
 
+	config DEBUG_DAVINCI_UART0
+		bool "Kernel low-level debugging on Davinci using uart0"
+		depends on ARCH_DAVINCI_DM644x
+
+	config DEBUG_DA8XX_UART1
+		bool "Kernel low-level debugging on DA8xx using uart1"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_DA8XX_UART2
+		bool "Kernel low-level debugging on DA8xx using uart2"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_TNETV107X_UART1
+		bool "Kernel low-level debugging on TNETV107x using uart1"
+		depends on ARCH_DAVINCI_TNETV107X
+
 	config DEBUG_FOOTBRIDGE_COM1
 		bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1"
 		depends on FOOTBRIDGE
arch/arm/mach-davinci/include/mach/debug-macro.S +20 -38

66 lines not on this page · raw message

arch/arm/mach-davinci/include/mach/hardware.h +1 -1
index 414e0b9..649ddc2 100644
@@ -24,7 +24,7 @@
 /*
  * I/O mapping
  */
-#define IO_PHYS				0x01c00000UL
+#define IO_PHYS				UL(0x01c00000)
 #define IO_OFFSET			0xfd000000 /* Virtual IO = 0xfec00000 */
 #define IO_SIZE				0x00400000
 #define IO_VIRT				(IO_PHYS + IO_OFFSET)
arch/arm/mach-davinci/include/mach/serial.h +0 -10
index e347d88..46b3cd1 100644
@@ -15,16 +15,6 @@
 
 #include <mach/hardware.h>
 
-/*
- * Stolen area that contains debug uart physical and virtual addresses.  These
- * addresses are filled in by the uncompress.h code, and are used by the debug
- * macros in debug-macro.S.
- *
- * This area sits just below the page tables (see arch/arm/kernel/head.S).
- * We define it as a relative offset from start of usable RAM.
- */
-#define DAVINCI_UART_INFO_OFS	0x3ff8
-
 #define DAVINCI_UART0_BASE	(IO_PHYS + 0x20000)
 #define DAVINCI_UART1_BASE	(IO_PHYS + 0x20400)
 #define DAVINCI_UART2_BASE	(IO_PHYS + 0x20800)
arch/arm/mach-davinci/include/mach/uncompress.h +6 -18
index 9dc7cf9..0ff7363 100644
@@ -41,37 +41,25 @@ static inline void flush(void)
 		barrier();
 }
 
-static inline void set_uart_info(u32 phys, void * __iomem virt)
+static inline void set_uart_info(u32 phys)
 {
-	/*
-	 * Get address of some.bss variable and round it down
-	 * a la CONFIG_AUTO_ZRELADDR.
-	 */
-	u32 ram_start = (u32)&uart & 0xf8000000;
-	u32 *uart_info = (u32 *)(ram_start + DAVINCI_UART_INFO_OFS);
-
 	uart = (u32 *)phys;
-	uart_info[0] = phys;
-	uart_info[1] = (u32)virt;
 }
 
-#define _DEBUG_LL_ENTRY(machine, phys, virt)			\
+#define _DEBUG_LL_ENTRY(machine, phys)				\
 	if (machine_is_##machine()) {				\
-		set_uart_info(phys, virt);			\
+		set_uart_info(phys);				\
 		break;						\
 	}
 
 #define DEBUG_LL_DAVINCI(machine, port)				\
-	_DEBUG_LL_ENTRY(machine, DAVINCI_UART##port##_BASE,	\
-			IO_ADDRESS(DAVINCI_UART##port##_BASE))
+	_DEBUG_LL_ENTRY(machine, DAVINCI_UART##port##_BASE)
 
 #define DEBUG_LL_DA8XX(machine, port)				\
-	_DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE,	\
-			IO_ADDRESS(DA8XX_UART##port##_BASE))
+	_DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE)
 
 #define DEBUG_LL_TNETV107X(machine, port)			\
-	_DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE,	\
-			TNETV107X_UART##port##_VIRT)
+	_DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE)
 
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
Signature · 1 line
1.7.9.1
#4 lore raw

PATCH v2 1/1 ARM: davinci: implement DEBUG_LL port choice

Hi Uwe,

Thanks for the patch.

Quoted 14 lines · Uwe Kleine-K?nig

Apart from the necessity to do this change for multi-platform kernels the previous logic depended on the zImage decompressor to write the physical and virtual address to a magic memory location. If the decompressor is unused or not correctly configured for the current machid, the addruart macro was an infinite loop. Moreover debugging the early zImage code was not possible either.

arch/arm/Kconfig.debug +0 -0
index e0d236d..4c2fb44 100644

arch/arm/Kconfig.debug choice · line 113

Quoted 6 lines
arch/arm/Kconfig.debug +3 -0
@@ -108,6 +108,22 @@ choice
 		bool "Kernel low-level debugging on 9263, 9g45 and cap9"
 		depends on HAVE_AT91_DBGU1
 
+	config DEBUG_DAVINCI_UART0
+		bool "Kernel low-level debugging on Davinci using uart0"
+		depends on ARCH_DAVINCI_DM644x

I guess this is meant for the traditional DaVinci DM* devices. The correct "depends on" in that case is ARCH_DAVINCI_DMx. DM644x is just one of those DaVinci devices. Also, the config is better named DEBUG_DAVINCI_DMx_UART0 to remain consistent with the corresponding ARCH_ config.

arch/arm/Kconfig.debug choice · line 114

Quoted 1 line
arch/arm/Kconfig.debug +1 -0
+	config DEBUG_DA8XX_UART1

I would prefer calling this DEBUG_DAVINCI_DA8XX_UART0 for the same reason of naming consistency with the corresponding ARCH_ config.

arch/arm/Kconfig.debug choice · line 124

Quoted 10 lines
arch/arm/Kconfig.debug +10 -0
+		bool "Kernel low-level debugging on DA8xx using uart1"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_DA8XX_UART2
+		bool "Kernel low-level debugging on DA8xx using uart2"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_TNETV107X_UART1
+		bool "Kernel low-level debugging on TNETV107x using uart1"
+		depends on ARCH_DAVINCI_TNETV107X

There should be some help text associated with each of these macros.

[...]

arch/arm/mach-davinci/include/mach/debug-macro.S

Quoted 5 lines
arch/arm/mach-davinci/include/mach/debug-macro.S +3 -0
 
+#ifndef UART_VIRTBASE
+#define UART_VIRTBASE IO_ADDRESS(UART_BASE)
+#endif

Prefer using tabs for indentation here..

arch/arm/mach-davinci/include/mach/debug-macro.S

Quoted 4 lines

-100:

arch/arm/mach-davinci/include/mach/debug-macro.S +3 -0
+		.macro addruart, rp, rv, tmp
+		ldr     \rp, =UART_BASE
+		ldr     \rv, =UART_VIRTBASE

.. and here (after ldr)

[...]

arch/arm/mach-davinci/include/mach/uncompress.h

Quoted 9 lines
arch/arm/mach-davinci/include/mach/uncompress.h +2 -2
 
-#define _DEBUG_LL_ENTRY(machine, phys, virt)			\
+#define _DEBUG_LL_ENTRY(machine, phys)				\
 	if (machine_is_##machine()) {				\
-		set_uart_info(phys, virt);			\
+		set_uart_info(phys);				\
 		break;						\
 	}

So, this throws a checkpatch error:

ERROR: Macros with complex values should be enclosed in parenthesis

I made changes for these issues and in the process also made sure the patch applies cleanly to latest kernel. Here is the updated patch I intend to queue for v3.5

Thanks,
Sekhar

-----8<-----
Author: Uwe Kleine-K?nig <[email protected]>
Commit: Sekhar Nori <[email protected]>

ARM: davinci: implement DEBUG_LL port choice

Apart from the necessity to do this change for multi-platform kernels the previous logic depended on the zImage decompressor to write the physical and virtual address to a magic memory location. If the decompressor is unused or not correctly configured for the current machid, the addruart macro was an infinite loop. Moreover debugging the early zImage code was not possible either.

[nsekhar at ti.com: add braces in _DEBUG_LL_ENTRY() macro to fix checkpatch error. Fix debug port choice config dependency for traditional DaVincis. Modify debug port config names and add help text.]

arch/arm/Kconfig.debug +29 -0
index 85348a0..e561adc 100644
@@ -103,6 +103,35 @@ choice
 		  Say Y here if you want the debug print routines to direct
 		  their output to the second serial port on these devices.
 
+	config DEBUG_DAVINCI_DA8XX_UART1
+		bool "Kernel low-level debugging on DaVinci DA8XX using UART1"
+		depends on ARCH_DAVINCI_DA8XX
+		help
+		  Say Y here if you want the debug print routines to direct
+		  their output to UART1 serial port on DaVinci DA8XX devices.
+
+	config DEBUG_DAVINCI_DA8XX_UART2
+		bool "Kernel low-level debugging on DaVinci DA8XX using UART2"
+		depends on ARCH_DAVINCI_DA8XX
+		help
+		  Say Y here if you want the debug print routines to direct
+		  their output to UART2 serial port on DaVinci DA8XX devices.
+
+	config DEBUG_DAVINCI_DMx_UART0
+		bool "Kernel low-level debugging on DaVinci DMx using UART0"
+		depends on ARCH_DAVINCI_DMx
+		help
+		  Say Y here if you want the debug print routines to direct
+		  their output to UART0 serial port on DaVinci DMx devices.
+
+	config DEBUG_DAVINCI_TNETV107X_UART1
+		bool "Kernel low-level debugging on DaVinci TNETV107x using UART1"
+		depends on ARCH_DAVINCI_TNETV107X
+		help
+		  Say Y here if you want the debug print routines to direct
+		  their output to UART1 serial port on DaVinci TNETV107X
+		  devices.
+
 	config DEBUG_DC21285_PORT
 		bool "Kernel low-level debugging messages via footbridge serial port"
 		depends on FOOTBRIDGE
arch/arm/mach-davinci/include/mach/debug-macro.S +20 -38

66 lines not on this page · raw message

arch/arm/mach-davinci/include/mach/hardware.h +1 -1
index 2184691..16bb422 100644
@@ -22,7 +22,7 @@
 /*
  * I/O mapping
  */
-#define IO_PHYS				0x01c00000UL
+#define IO_PHYS				UL(0x01c00000)
 #define IO_OFFSET			0xfd000000 /* Virtual IO = 0xfec00000 */
 #define IO_SIZE				0x00400000
 #define IO_VIRT				(IO_PHYS + IO_OFFSET)
arch/arm/mach-davinci/include/mach/serial.h +0 -10
index e347d88..46b3cd1 100644
@@ -15,16 +15,6 @@
 
 #include <mach/hardware.h>
 
-/*
- * Stolen area that contains debug uart physical and virtual addresses.  These
- * addresses are filled in by the uncompress.h code, and are used by the debug
- * macros in debug-macro.S.
- *
- * This area sits just below the page tables (see arch/arm/kernel/head.S).
- * We define it as a relative offset from start of usable RAM.
- */
-#define DAVINCI_UART_INFO_OFS	0x3ff8
-
 #define DAVINCI_UART0_BASE	(IO_PHYS + 0x20000)
 #define DAVINCI_UART1_BASE	(IO_PHYS + 0x20400)
 #define DAVINCI_UART2_BASE	(IO_PHYS + 0x20800)
arch/arm/mach-davinci/include/mach/uncompress.h +10 -20
index da2fb2c..18cfd49 100644
@@ -43,37 +43,27 @@ static inline void flush(void)
 		barrier();
 }
 
-static inline void set_uart_info(u32 phys, void * __iomem virt)
+static inline void set_uart_info(u32 phys)
 {
-	/*
-	 * Get address of some.bss variable and round it down
-	 * a la CONFIG_AUTO_ZRELADDR.
-	 */
-	u32 ram_start = (u32)&uart & 0xf8000000;
-	u32 *uart_info = (u32 *)(ram_start + DAVINCI_UART_INFO_OFS);
-
 	uart = (u32 *)phys;
-	uart_info[0] = phys;
-	uart_info[1] = (u32)virt;
 }
 
-#define _DEBUG_LL_ENTRY(machine, phys, virt)			\
-	if (machine_is_##machine()) {				\
-		set_uart_info(phys, virt);			\
-		break;						\
+#define _DEBUG_LL_ENTRY(machine, phys)				\
+	{							\
+		if (machine_is_##machine()) {			\
+			set_uart_info(phys);			\
+			break;					\
+		}						\
 	}
 
 #define DEBUG_LL_DAVINCI(machine, port)				\
-	_DEBUG_LL_ENTRY(machine, DAVINCI_UART##port##_BASE,	\
-			IO_ADDRESS(DAVINCI_UART##port##_BASE))
+	_DEBUG_LL_ENTRY(machine, DAVINCI_UART##port##_BASE)
 
 #define DEBUG_LL_DA8XX(machine, port)				\
-	_DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE,	\
-			IO_ADDRESS(DA8XX_UART##port##_BASE))
+	_DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE)
 
 #define DEBUG_LL_TNETV107X(machine, port)			\
-	_DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE,	\
-			TNETV107X_UART##port##_VIRT)
+	_DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE)
 
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
#5 lore raw

PATCH v2 1/1 ARM: davinci: implement DEBUG_LL port choice

Hi,

Quoted 18 lines · Sekhar

arch/arm/Kconfig.debug choice · line 113

Quoted 11 lines
arch/arm/Kconfig.debug +3 -0
index e0d236d..4c2fb44 100644
@@ -108,6 +108,22 @@ choice
 		bool "Kernel low-level debugging on 9263, 9g45 and cap9"
 		depends on HAVE_AT91_DBGU1
 
+	config DEBUG_DAVINCI_UART0
+		bool "Kernel low-level debugging on Davinci using uart0"
+		depends on ARCH_DAVINCI_DM644x

I guess this is meant for the traditional DaVinci DM* devices. The correct "depends on" in that case is ARCH_DAVINCI_DMx. DM644x is just one of those DaVinci devices. Also, the config is better named DEBUG_DAVINCI_DMx_UART0 to remain consistent with the corresponding ARCH_ config.

Quoted 4 lines

arch/arm/Kconfig.debug choice · line 114

Quoted 1 line
arch/arm/Kconfig.debug +1 -0
+	config DEBUG_DA8XX_UART1

I would prefer calling this DEBUG_DAVINCI_DA8XX_UART0 for the same reason of naming consistency with the corresponding ARCH_ config.

..._UART1, but otherwise ok.

Quoted 15 lines

arch/arm/Kconfig.debug choice · line 129

Quoted 10 lines
arch/arm/Kconfig.debug +10 -0
+		bool "Kernel low-level debugging on DA8xx using uart1"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_DA8XX_UART2
+		bool "Kernel low-level debugging on DA8xx using uart2"
+		depends on ARCH_DAVINCI_DA8XX
+
+	config DEBUG_TNETV107X_UART1
+		bool "Kernel low-level debugging on TNETV107x using uart1"
+		depends on ARCH_DAVINCI_TNETV107X

There should be some help text associated with each of these macros.

[...]

Quoted 7 lines

arch/arm/mach-davinci/include/mach/debug-macro.S line 42

Quoted 5 lines
arch/arm/mach-davinci/include/mach/debug-macro.S +3 -0
 
+#ifndef UART_VIRTBASE
+#define UART_VIRTBASE IO_ADDRESS(UART_BASE)
+#endif

Prefer using tabs for indentation here..

*shrug*

Quoted 6 lines

arch/arm/mach-davinci/include/mach/debug-macro.S line 46

Quoted 4 lines

-100:

arch/arm/mach-davinci/include/mach/debug-macro.S +3 -0
+		.macro addruart, rp, rv, tmp
+		ldr     \rp, =UART_BASE
+		ldr     \rv, =UART_VIRTBASE

.. and here (after ldr)

ack

Quoted 15 lines

[...]

arch/arm/mach-davinci/include/mach/uncompress.h static inline void flush(void) · line 57

Quoted 9 lines
arch/arm/mach-davinci/include/mach/uncompress.h +2 -2
 
-#define _DEBUG_LL_ENTRY(machine, phys, virt)			\
+#define _DEBUG_LL_ENTRY(machine, phys)				\
 	if (machine_is_##machine()) {				\
-		set_uart_info(phys, virt);			\
+		set_uart_info(phys);				\
 		break;						\
 	}

So, this throws a checkpatch error:

Quoted 1 line

ERROR: Macros with complex values should be enclosed in parenthesis

Yeah, but the problem is not new and so it's IMHO right to keep it as is. YMMV.

Quoted 6 lines

I made changes for these issues and in the process also made sure the patch applies cleanly to latest kernel. Here is the updated patch I intend to queue for v3.5

Thanks,
Sekhar

looks good, thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |