All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Uncompress debug for multiplatform
@ 2013-01-17 15:21 Shawn Guo
  2013-01-17 15:21 ` [PATCH 1/2] ARM: use Kconfig to select uncompress.h Shawn Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Shawn Guo @ 2013-01-17 15:21 UTC (permalink / raw)
  To: linux-arm-kernel

It's not about running single zImage on multiple platforms with
uncompress debug output, but having uncompress debug work for platform
that DEBUG_LL is enabled for.  But still it's better than nothing.

Shawn Guo (2):
  ARM: use Kconfig to select uncompress.h
  ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug

 arch/arm/Kconfig.debug              |    5 +++++
 arch/arm/boot/compressed/Makefile   |    3 +++
 arch/arm/boot/compressed/debug.S    |    3 +++
 arch/arm/boot/compressed/misc.c     |    8 +-------
 arch/arm/include/debug/highbank.S   |    3 +++
 arch/arm/include/debug/imx.S        |    3 +++
 arch/arm/include/debug/mvebu.S      |    3 +++
 arch/arm/include/debug/picoxcell.S  |    3 +++
 arch/arm/include/debug/socfpga.S    |    3 +++
 arch/arm/include/debug/sunxi.S      |    3 +++
 arch/arm/include/debug/tegra.S      |    3 +++
 arch/arm/include/debug/uncompress.h |    9 +++++++++
 arch/arm/include/debug/vexpress.S   |    3 +++
 arch/arm/include/debug/zynq.S       |    3 +++
 14 files changed, 48 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/boot/compressed/debug.S
 create mode 100644 arch/arm/include/debug/uncompress.h

-- 
1.7.9.5

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

* [PATCH 1/2] ARM: use Kconfig to select uncompress.h
  2013-01-17 15:21 [PATCH 0/2] Uncompress debug for multiplatform Shawn Guo
@ 2013-01-17 15:21 ` Shawn Guo
  2013-01-17 16:00   ` Arnd Bergmann
  2013-01-17 15:21 ` [PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug Shawn Guo
       [not found] ` <20130128141947.GA11626@S2101-09.ap.freescale.net>
  2 siblings, 1 reply; 22+ messages in thread
From: Shawn Guo @ 2013-01-17 15:21 UTC (permalink / raw)
  To: linux-arm-kernel

Following the approach handling DEBUG_LL inclusion, the patch creates
a Kconfig symbol CONFIG_UNCOMPRESS_INCLUDE for choosing the correct
uncompress header.  For traditional build, mach/uncompress.h will be
included in arch/arm/boot/compressed/misc.c.  For multiplatform build,
debug/uncompress.h which contains a suite of empty functions will be
used.  In this way, a platform with particular uncompress.h
implementation could choose its own uncompress.h with this Kconfig
option.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/Kconfig.debug              |    5 +++++
 arch/arm/boot/compressed/misc.c     |    8 +-------
 arch/arm/include/debug/uncompress.h |    3 +++
 3 files changed, 9 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/include/debug/uncompress.h

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 05f83c8..86b273f8 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -523,6 +523,11 @@ config DEBUG_LL_INCLUDE
 	default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
 	default "mach/debug-macro.S"
 
+config UNCOMPRESS_INCLUDE
+	string
+	default "debug/uncompress.h" if ARCH_MULTIPLATFORM
+	default "mach/uncompress.h"
+
 config EARLY_PRINTK
 	bool "Early printk"
 	depends on DEBUG_LL
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index df89983..31bd43b 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -25,13 +25,7 @@ unsigned int __machine_arch_type;
 static void putstr(const char *ptr);
 extern void error(char *x);
 
-#ifdef CONFIG_ARCH_MULTIPLATFORM
-static inline void putc(int c) {}
-static inline void flush(void) {}
-static inline void arch_decomp_setup(void) {}
-#else
-#include <mach/uncompress.h>
-#endif
+#include CONFIG_UNCOMPRESS_INCLUDE
 
 #ifdef CONFIG_DEBUG_ICEDCC
 
diff --git a/arch/arm/include/debug/uncompress.h b/arch/arm/include/debug/uncompress.h
new file mode 100644
index 0000000..e19955d
--- /dev/null
+++ b/arch/arm/include/debug/uncompress.h
@@ -0,0 +1,3 @@
+static inline void putc(int c) {}
+static inline void flush(void) {}
+static inline void arch_decomp_setup(void) {}
-- 
1.7.9.5

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

* [PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug
  2013-01-17 15:21 [PATCH 0/2] Uncompress debug for multiplatform Shawn Guo
  2013-01-17 15:21 ` [PATCH 1/2] ARM: use Kconfig to select uncompress.h Shawn Guo
@ 2013-01-17 15:21 ` Shawn Guo
  2013-01-17 15:33   ` Shawn Guo
                     ` (2 more replies)
       [not found] ` <20130128141947.GA11626@S2101-09.ap.freescale.net>
  2 siblings, 3 replies; 22+ messages in thread
From: Shawn Guo @ 2013-01-17 15:21 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of providing a dummy uncompress.h and losing the uncompress
debug capability completely for multiplatform build, the patch turns
the uncompress debug into part of DEBUG_LL support.  Thus, when
DEBUG_LL is turned on for a particular platform, uncompress debug works
too for that platform.

To have the uncompress debug work, what most platforms need is only
a putc() implementation.  Meanwhile, DEBUG_LL infrastructural already
has printch() there.  We direct putc() call to printch() by creating
arch/arm/boot/compressed/debug.S which simply includes
arch/arm/kernel/debug.S.

However, there is a problem with above approach.  DEBUG_LL routines
will check MMU enable bit to decide whether physical or virtual address
should be used to access debug port.  In case virtual address needs
to be used, the address returned by addruart will not work for
decompressor who uses a different mapping from what kernel uses.
Fortunately, decompressor uses a flat mapping (same physical and virtual
addresses).  So we can easily work it around by asking platform addruart
return physical address as virtual address when it runs in decompressor.
The macro UNCOMPRESS_DEBUG is defined for this use.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/boot/compressed/Makefile   |    3 +++
 arch/arm/boot/compressed/debug.S    |    3 +++
 arch/arm/include/debug/highbank.S   |    3 +++
 arch/arm/include/debug/imx.S        |    3 +++
 arch/arm/include/debug/mvebu.S      |    3 +++
 arch/arm/include/debug/picoxcell.S  |    3 +++
 arch/arm/include/debug/socfpga.S    |    3 +++
 arch/arm/include/debug/sunxi.S      |    3 +++
 arch/arm/include/debug/tegra.S      |    3 +++
 arch/arm/include/debug/uncompress.h |    8 +++++++-
 arch/arm/include/debug/vexpress.S   |    3 +++
 arch/arm/include/debug/zynq.S       |    3 +++
 12 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/compressed/debug.S

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 5cad8a6..c9865f6 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -24,6 +24,9 @@ endif
 AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
 HEAD	= head.o
 OBJS	+= misc.o decompress.o
+ifeq ($(CONFIG_DEBUG_LL),y)
+OBJS	+= debug.o
+endif
 FONTC	= $(srctree)/drivers/video/console/font_acorn_8x8.c
 
 # string library code (-Os is enforced to keep it much smaller)
diff --git a/arch/arm/boot/compressed/debug.S b/arch/arm/boot/compressed/debug.S
new file mode 100644
index 0000000..7283d5c
--- /dev/null
+++ b/arch/arm/boot/compressed/debug.S
@@ -0,0 +1,3 @@
+#define UNCOMPRESS_DEBUG
+
+#include "../../kernel/debug.S"
diff --git a/arch/arm/include/debug/highbank.S b/arch/arm/include/debug/highbank.S
index 8cad432..13056cf 100644
--- a/arch/arm/include/debug/highbank.S
+++ b/arch/arm/include/debug/highbank.S
@@ -12,6 +12,9 @@
 		.macro	addruart,rp,rv,tmp
 		ldr	\rv, =0xfee36000
 		ldr	\rp, =0xfff36000
+#ifdef UNCOMPRESS_DEBUG
+		mov	\rv, \rp
+#endif
 		.endm
 
 #include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/include/debug/imx.S b/arch/arm/include/debug/imx.S
index 619d8cc..257f160 100644
--- a/arch/arm/include/debug/imx.S
+++ b/arch/arm/include/debug/imx.S
@@ -31,6 +31,9 @@
 		.macro	addruart, rp, rv, tmp
 		ldr	\rp, =UART_PADDR	@ physical
 		ldr	\rv, =UART_VADDR	@ virtual
+#ifdef UNCOMPRESS_DEBUG
+		mov	\rv, \rp
+#endif
 		.endm
 
 		.macro	senduart,rd,rx
diff --git a/arch/arm/include/debug/mvebu.S b/arch/arm/include/debug/mvebu.S
index 865c6d0..2024c1c 100644
--- a/arch/arm/include/debug/mvebu.S
+++ b/arch/arm/include/debug/mvebu.S
@@ -19,6 +19,9 @@
 	ldr	\rv, =ARMADA_370_XP_REGS_VIRT_BASE
 	orr	\rp, \rp, #0x00012000
 	orr	\rv, \rv, #0x00012000
+#ifdef UNCOMPRESS_DEBUG
+	mov	\rv, \rp
+#endif
 	.endm
 
 #define UART_SHIFT	2
diff --git a/arch/arm/include/debug/picoxcell.S b/arch/arm/include/debug/picoxcell.S
index bc1f07c..0869efc 100644
--- a/arch/arm/include/debug/picoxcell.S
+++ b/arch/arm/include/debug/picoxcell.S
@@ -14,6 +14,9 @@
 		.macro	addruart, rp, rv, tmp
 		ldr	\rv, =PHYS_TO_IO(PICOXCELL_UART1_BASE)
 		ldr	\rp, =PICOXCELL_UART1_BASE
+#ifdef UNCOMPRESS_DEBUG
+		mov	\rv, \rp
+#endif
 		.endm
 
 #include "8250_32.S"
diff --git a/arch/arm/include/debug/socfpga.S b/arch/arm/include/debug/socfpga.S
index 966b2f9..0298e12 100644
--- a/arch/arm/include/debug/socfpga.S
+++ b/arch/arm/include/debug/socfpga.S
@@ -15,6 +15,9 @@
 		orr	\rp, \rp, #0x00c00000
 		orr	\rv, \rp, #0xfe000000	@ virtual base
 		orr	\rp, \rp, #0xff000000	@ physical base
+#ifdef UNCOMPRESS_DEBUG
+		mov	\rv, \rp
+#endif
 		.endm
 
 #include "8250_32.S"
diff --git a/arch/arm/include/debug/sunxi.S b/arch/arm/include/debug/sunxi.S
index 04eb56d..5c40a3a 100644
--- a/arch/arm/include/debug/sunxi.S
+++ b/arch/arm/include/debug/sunxi.S
@@ -21,6 +21,9 @@
 	.macro	addruart, rp, rv, tmp
 	ldr	\rp, =SUNXI_UART_DEBUG_PHYS_BASE
 	ldr	\rv, =SUNXI_UART_DEBUG_VIRT_BASE
+#ifdef UNCOMPRESS_DEBUG
+	mov	\rv, \rp
+#endif
 	.endm
 
 #define UART_SHIFT	2
diff --git a/arch/arm/include/debug/tegra.S b/arch/arm/include/debug/tegra.S
index 883d7c2..789fcb4 100644
--- a/arch/arm/include/debug/tegra.S
+++ b/arch/arm/include/debug/tegra.S
@@ -188,6 +188,9 @@
 		/* Load previously selected UART address */
 100:		ldr	\rp, [\tmp, #4]		@ Load tegra_uart_phys
 		ldr	\rv, [\tmp, #8]		@ Load tegra_uart_virt
+#ifdef UNCOMPRESS_DEBUG
+		mov	\rv, \rp
+#endif
 		.endm
 
 /*
diff --git a/arch/arm/include/debug/uncompress.h b/arch/arm/include/debug/uncompress.h
index e19955d..b142a84 100644
--- a/arch/arm/include/debug/uncompress.h
+++ b/arch/arm/include/debug/uncompress.h
@@ -1,3 +1,9 @@
-static inline void putc(int c) {}
+#ifdef CONFIG_DEBUG_LL
+extern void printch(int c);
+#else
+static inline void printch(int c) {}
+#endif
+
+static inline void putc(int c) { printch(c); }
 static inline void flush(void) {}
 static inline void arch_decomp_setup(void) {}
diff --git a/arch/arm/include/debug/vexpress.S b/arch/arm/include/debug/vexpress.S
index dc8e882..5015a01 100644
--- a/arch/arm/include/debug/vexpress.S
+++ b/arch/arm/include/debug/vexpress.S
@@ -43,6 +43,9 @@
 		orrne	\rv, \rp, #DEBUG_LL_VIRT_BASE
 		orrne	\rp, \rp, #DEBUG_LL_PHYS_BASE_RS1
 
+#ifdef UNCOMPRESS_DEBUG
+		mov	\rv, \rp
+#endif
 		.endm
 
 #include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/include/debug/zynq.S b/arch/arm/include/debug/zynq.S
index f9aa974..2795a64 100644
--- a/arch/arm/include/debug/zynq.S
+++ b/arch/arm/include/debug/zynq.S
@@ -35,6 +35,9 @@
 		.macro	addruart, rp, rv, tmp
 		ldr	\rp, =LL_UART_PADDR	@ physical
 		ldr	\rv, =LL_UART_VADDR	@ virtual
+#ifdef UNCOMPRESS_DEBUG
+		mov	\rv, \rp
+#endif
 		.endm
 
 		.macro	senduart,rd,rx
-- 
1.7.9.5

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

* [PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug
  2013-01-17 15:21 ` [PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug Shawn Guo
@ 2013-01-17 15:33   ` Shawn Guo
  2013-01-17 16:25   ` Arnd Bergmann
  2013-01-18  2:45   ` [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
  2 siblings, 0 replies; 22+ messages in thread
From: Shawn Guo @ 2013-01-17 15:33 UTC (permalink / raw)
  To: linux-arm-kernel

Russell,

On Thu, Jan 17, 2013 at 11:21:59PM +0800, Shawn Guo wrote:
>  arch/arm/boot/compressed/Makefile   |    3 +++
>  arch/arm/boot/compressed/debug.S    |    3 +++
>  arch/arm/include/debug/highbank.S   |    3 +++
>  arch/arm/include/debug/imx.S        |    3 +++
>  arch/arm/include/debug/mvebu.S      |    3 +++
>  arch/arm/include/debug/picoxcell.S  |    3 +++
>  arch/arm/include/debug/socfpga.S    |    3 +++
>  arch/arm/include/debug/sunxi.S      |    3 +++
>  arch/arm/include/debug/tegra.S      |    3 +++
>  arch/arm/include/debug/uncompress.h |    8 +++++++-
>  arch/arm/include/debug/vexpress.S   |    3 +++
>  arch/arm/include/debug/zynq.S       |    3 +++
>  12 files changed, 40 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/boot/compressed/debug.S
> 
...
> diff --git a/arch/arm/boot/compressed/debug.S b/arch/arm/boot/compressed/debug.S
> new file mode 100644
> index 0000000..7283d5c
> --- /dev/null
> +++ b/arch/arm/boot/compressed/debug.S
> @@ -0,0 +1,3 @@
> +#define UNCOMPRESS_DEBUG
> +
> +#include "../../kernel/debug.S"
> diff --git a/arch/arm/include/debug/highbank.S b/arch/arm/include/debug/highbank.S
> index 8cad432..13056cf 100644
> --- a/arch/arm/include/debug/highbank.S
> +++ b/arch/arm/include/debug/highbank.S
> @@ -12,6 +12,9 @@
>  		.macro	addruart,rp,rv,tmp
>  		ldr	\rv, =0xfee36000
>  		ldr	\rp, =0xfff36000
> +#ifdef UNCOMPRESS_DEBUG
> +		mov	\rv, \rp
> +#endif
>  		.endm
>  
Are you fine with patching arch/arm/kernel/debug.S to have
UNCOMPRESS_DEBUG checked, so that we can avoid patching addruart
for all those platforms?

Shawn

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

* [PATCH 1/2] ARM: use Kconfig to select uncompress.h
  2013-01-17 15:21 ` [PATCH 1/2] ARM: use Kconfig to select uncompress.h Shawn Guo
@ 2013-01-17 16:00   ` Arnd Bergmann
  0 siblings, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2013-01-17 16:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 17 January 2013, Shawn Guo wrote:
> Spam Status: Spamassassin 0% probability of being spam.
> 
> Full report:
> No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1  
> Following the approach handling DEBUG_LL inclusion, the patch creates
> a Kconfig symbol CONFIG_UNCOMPRESS_INCLUDE for choosing the correct
> uncompress header.  For traditional build, mach/uncompress.h will be
> included in arch/arm/boot/compressed/misc.c.  For multiplatform build,
> debug/uncompress.h which contains a suite of empty functions will be
> used.  In this way, a platform with particular uncompress.h
> implementation could choose its own uncompress.h with this Kconfig
> option.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

Nice trick!

Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* [PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug
  2013-01-17 15:21 ` [PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug Shawn Guo
  2013-01-17 15:33   ` Shawn Guo
@ 2013-01-17 16:25   ` Arnd Bergmann
  2013-01-18  2:49     ` Shawn Guo
  2013-01-18  2:45   ` [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
  2 siblings, 1 reply; 22+ messages in thread
From: Arnd Bergmann @ 2013-01-17 16:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 17 January 2013, Shawn Guo wrote:
> However, there is a problem with above approach.  DEBUG_LL routines
> will check MMU enable bit to decide whether physical or virtual address
> should be used to access debug port.  In case virtual address needs
> to be used, the address returned by addruart will not work for
> decompressor who uses a different mapping from what kernel uses.
> Fortunately, decompressor uses a flat mapping (same physical and virtual
> addresses).  So we can easily work it around by asking platform addruart
> return physical address as virtual address when it runs in decompressor.
> The macro UNCOMPRESS_DEBUG is defined for this use.

Can't you just create a new copy of kernel/debug.S in boot/compressed/
that provides only a putc() function and uses the physical address
unconditionally?

For all I can tell, that should be little more than just

#include CONFIG_DEBUG_LL_INCLUDE
ENTRY(putc)
	addruart r1, r2, r3
	waituart r3, r1
	senduart r0, r1
	busyuart r3, r1
	mov pc,lr
ENDPROC(putc)

(I'm not sure about the actual semantics of the above, take that
as an approximation)

	Arnd

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-01-17 15:21 ` [PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug Shawn Guo
  2013-01-17 15:33   ` Shawn Guo
  2013-01-17 16:25   ` Arnd Bergmann
@ 2013-01-18  2:45   ` Shawn Guo
  2013-01-18  8:47     ` Arnd Bergmann
                       ` (2 more replies)
  2 siblings, 3 replies; 22+ messages in thread
From: Shawn Guo @ 2013-01-18  2:45 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of giving zero support of uncompress debug for multiplatform
build, the patch turns uncompress debug into one part of DEBUG_LL
support.  When DEBUG_LL is turned on for a particular platform,
uncompress debug works too for that platform.

It reuses the platform DEBUG_LL macros by creating a simple
arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
included there, and implements a generic putc() using those macros.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/boot/compressed/Makefile   |    3 +++
 arch/arm/boot/compressed/debug.S    |   11 +++++++++++
 arch/arm/include/debug/uncompress.h |    4 ++++
 3 files changed, 18 insertions(+)
 create mode 100644 arch/arm/boot/compressed/debug.S

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 5cad8a6..c9865f6 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -24,6 +24,9 @@ endif
 AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
 HEAD	= head.o
 OBJS	+= misc.o decompress.o
+ifeq ($(CONFIG_DEBUG_LL),y)
+OBJS	+= debug.o
+endif
 FONTC	= $(srctree)/drivers/video/console/font_acorn_8x8.c
 
 # string library code (-Os is enforced to keep it much smaller)
diff --git a/arch/arm/boot/compressed/debug.S b/arch/arm/boot/compressed/debug.S
new file mode 100644
index 0000000..bdb0e25
--- /dev/null
+++ b/arch/arm/boot/compressed/debug.S
@@ -0,0 +1,11 @@
+#include <linux/linkage.h>
+
+#include CONFIG_DEBUG_LL_INCLUDE
+
+ENTRY(putc)
+	addruart r1, r2, r3
+	waituart r3, r1
+	senduart r0, r1
+	busyuart r3, r1
+	mov	 pc, lr
+ENDPROC(putc)
diff --git a/arch/arm/include/debug/uncompress.h b/arch/arm/include/debug/uncompress.h
index e19955d..9aa5314 100644
--- a/arch/arm/include/debug/uncompress.h
+++ b/arch/arm/include/debug/uncompress.h
@@ -1,3 +1,7 @@
+#ifdef CONFIG_DEBUG_LL
+extern void putc(int c);
+#else
 static inline void putc(int c) {}
+#endif
 static inline void flush(void) {}
 static inline void arch_decomp_setup(void) {}
-- 
1.7.9.5

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

* [PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug
  2013-01-17 16:25   ` Arnd Bergmann
@ 2013-01-18  2:49     ` Shawn Guo
  0 siblings, 0 replies; 22+ messages in thread
From: Shawn Guo @ 2013-01-18  2:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 17, 2013 at 04:25:42PM +0000, Arnd Bergmann wrote:
> On Thursday 17 January 2013, Shawn Guo wrote:
> > However, there is a problem with above approach.  DEBUG_LL routines
> > will check MMU enable bit to decide whether physical or virtual address
> > should be used to access debug port.  In case virtual address needs
> > to be used, the address returned by addruart will not work for
> > decompressor who uses a different mapping from what kernel uses.
> > Fortunately, decompressor uses a flat mapping (same physical and virtual
> > addresses).  So we can easily work it around by asking platform addruart
> > return physical address as virtual address when it runs in decompressor.
> > The macro UNCOMPRESS_DEBUG is defined for this use.
> 
> Can't you just create a new copy of kernel/debug.S in boot/compressed/
> that provides only a putc() function and uses the physical address
> unconditionally?
> 
Why did I not think of this?  The approach is obviously simpler.
Please check the updated version I just sent out.  Thanks.

Shawn

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-01-18  2:45   ` [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
@ 2013-01-18  8:47     ` Arnd Bergmann
  2013-01-18 10:42       ` Russell King - ARM Linux
  2013-01-18 11:15       ` Shawn Guo
  2013-01-18 18:03     ` Olof Johansson
  2013-02-04 16:01     ` Russell King - ARM Linux
  2 siblings, 2 replies; 22+ messages in thread
From: Arnd Bergmann @ 2013-01-18  8:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 18 January 2013, Shawn Guo wrote:
> +ENTRY(putc)
> +       addruart r1, r2, r3
> +       waituart r3, r1
> +       senduart r0, r1
> +       busyuart r3, r1
> +       mov      pc, lr
> +ENDPROC(putc)

Ah, so it actually worked? I was expecting at least some part of
my code to be wrong ;-) My assembler skills are very much
lacking and I had not tried it.

Upon closer inspection, it seems that the CR/LF logic from
the printascii function is not here, and it probably should be.

I also saw that some similar code is already present in
arch/arm/boot/compressed/head.S as a local version of putc,
maybe that can be combined with this rather than adding a new
file.

	Arnd

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-01-18  8:47     ` Arnd Bergmann
@ 2013-01-18 10:42       ` Russell King - ARM Linux
  2013-01-18 11:15       ` Shawn Guo
  1 sibling, 0 replies; 22+ messages in thread
From: Russell King - ARM Linux @ 2013-01-18 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 18, 2013 at 08:47:50AM +0000, Arnd Bergmann wrote:
> On Friday 18 January 2013, Shawn Guo wrote:
> > +ENTRY(putc)
> > +       addruart r1, r2, r3
> > +       waituart r3, r1
> > +       senduart r0, r1
> > +       busyuart r3, r1
> > +       mov      pc, lr
> > +ENDPROC(putc)
> 
> Ah, so it actually worked? I was expecting at least some part of
> my code to be wrong ;-) My assembler skills are very much
> lacking and I had not tried it.
> 
> Upon closer inspection, it seems that the CR/LF logic from
> the printascii function is not here, and it probably should be.

No it shouldn't.  The CR/LF handling is already done (so actually
aliasing it to printch in arch/arm/kernel/debug.S will result in
two CRs per LF.

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-01-18  8:47     ` Arnd Bergmann
  2013-01-18 10:42       ` Russell King - ARM Linux
@ 2013-01-18 11:15       ` Shawn Guo
  1 sibling, 0 replies; 22+ messages in thread
From: Shawn Guo @ 2013-01-18 11:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 18, 2013 at 08:47:50AM +0000, Arnd Bergmann wrote:
> On Friday 18 January 2013, Shawn Guo wrote:
> > +ENTRY(putc)
> > +       addruart r1, r2, r3
> > +       waituart r3, r1
> > +       senduart r0, r1
> > +       busyuart r3, r1
> > +       mov      pc, lr
> > +ENDPROC(putc)
> 
> Ah, so it actually worked? I was expecting at least some part of
> my code to be wrong ;-) My assembler skills are very much
> lacking and I had not tried it.
> 
Yes, it worked.  Actually, I wrote it myself after reading your comment
saying take your code as approximation.  And then I compared my code
with yours and found the only difference is the indent of the last
statement :)

> Upon closer inspection, it seems that the CR/LF logic from
> the printascii function is not here, and it probably should be.
> 
No.  As Russell already pointed out, the current implementation of
putc() is exactly what putstr() expect, with no CR/LF logic.

Shawn

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-01-18  2:45   ` [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
  2013-01-18  8:47     ` Arnd Bergmann
@ 2013-01-18 18:03     ` Olof Johansson
  2013-02-04 16:01     ` Russell King - ARM Linux
  2 siblings, 0 replies; 22+ messages in thread
From: Olof Johansson @ 2013-01-18 18:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 17, 2013 at 6:45 PM, Shawn Guo <shawn.guo@linaro.org> wrote:
> Instead of giving zero support of uncompress debug for multiplatform
> build, the patch turns uncompress debug into one part of DEBUG_LL
> support.  When DEBUG_LL is turned on for a particular platform,
> uncompress debug works too for that platform.
>
> It reuses the platform DEBUG_LL macros by creating a simple
> arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
> included there, and implements a generic putc() using those macros.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

This looks great, and it's even cleaner than I was hoping it'd be
based on my suggestion. Nice! :)

Russell, do you want to apply this or should we? If the former, for
the patch tracker:

Acked-by: Olof Johansson <olof@lixom.net>

If the latter, let me know and I'll pick it up.


Thanks!

-Olof

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

* [PATCH 0/2] Uncompress debug for multiplatform
       [not found] ` <20130128141947.GA11626@S2101-09.ap.freescale.net>
@ 2013-01-28 14:22   ` Shawn Guo
  0 siblings, 0 replies; 22+ messages in thread
From: Shawn Guo @ 2013-01-28 14:22 UTC (permalink / raw)
  To: linux-arm-kernel

Sorry, Russell.  I meant to put your email address on To.

Shawn

On Mon, Jan 28, 2013 at 10:19:51PM +0800, Russell King wrote:
> On Thu, Jan 17, 2013 at 11:21:57PM +0800, Shawn Guo wrote:
> > It's not about running single zImage on multiple platforms with
> > uncompress debug output, but having uncompress debug work for platform
> > that DEBUG_LL is enabled for.  But still it's better than nothing.
> > 
> > Shawn Guo (2):
> >   ARM: use Kconfig to select uncompress.h
> >   ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug
> 
> Just put them into patch tracker as #7633 and #7634.
> 
> Shawn
> 

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-01-18  2:45   ` [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
  2013-01-18  8:47     ` Arnd Bergmann
  2013-01-18 18:03     ` Olof Johansson
@ 2013-02-04 16:01     ` Russell King - ARM Linux
  2013-02-06  9:32       ` Russell King - ARM Linux
  2 siblings, 1 reply; 22+ messages in thread
From: Russell King - ARM Linux @ 2013-02-04 16:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 18, 2013 at 10:45:20AM +0800, Shawn Guo wrote:
> Instead of giving zero support of uncompress debug for multiplatform
> build, the patch turns uncompress debug into one part of DEBUG_LL
> support.  When DEBUG_LL is turned on for a particular platform,
> uncompress debug works too for that platform.
> 
> It reuses the platform DEBUG_LL macros by creating a simple
> arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
> included there, and implements a generic putc() using those macros.

Ok, I've applied this on the previso that _no one_ in future whinges if
the debug infrastructure doesn't quite meet their expectation.  The
debug infrastructure remains first and foremost that: a simple debug
infrastructure suitable for use in the early assembly and the like.

That is its primary concern and trumps any requirements from consoles,
early printk, decompressor output, and the like.

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-02-04 16:01     ` Russell King - ARM Linux
@ 2013-02-06  9:32       ` Russell King - ARM Linux
  2013-02-06 19:04         ` Stephen Warren
  2013-02-08 11:44         ` [PATCH v3 " Shawn Guo
  0 siblings, 2 replies; 22+ messages in thread
From: Russell King - ARM Linux @ 2013-02-06  9:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 04, 2013 at 04:01:33PM +0000, Russell King - ARM Linux wrote:
> On Fri, Jan 18, 2013 at 10:45:20AM +0800, Shawn Guo wrote:
> > Instead of giving zero support of uncompress debug for multiplatform
> > build, the patch turns uncompress debug into one part of DEBUG_LL
> > support.  When DEBUG_LL is turned on for a particular platform,
> > uncompress debug works too for that platform.
> > 
> > It reuses the platform DEBUG_LL macros by creating a simple
> > arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
> > included there, and implements a generic putc() using those macros.
> 
> Ok, I've applied this on the previso that _no one_ in future whinges if
> the debug infrastructure doesn't quite meet their expectation.  The
> debug infrastructure remains first and foremost that: a simple debug
> infrastructure suitable for use in the early assembly and the like.
> 
> That is its primary concern and trumps any requirements from consoles,
> early printk, decompressor output, and the like.

... and now I've dropped the two patches because it causes build failures
for all OMAP and PXA platforms.

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-02-06  9:32       ` Russell King - ARM Linux
@ 2013-02-06 19:04         ` Stephen Warren
  2013-02-07  5:04           ` Shawn Guo
  2013-02-08 11:44         ` [PATCH v3 " Shawn Guo
  1 sibling, 1 reply; 22+ messages in thread
From: Stephen Warren @ 2013-02-06 19:04 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/06/2013 02:32 AM, Russell King - ARM Linux wrote:
> On Mon, Feb 04, 2013 at 04:01:33PM +0000, Russell King - ARM Linux wrote:
>> On Fri, Jan 18, 2013 at 10:45:20AM +0800, Shawn Guo wrote:
>>> Instead of giving zero support of uncompress debug for multiplatform
>>> build, the patch turns uncompress debug into one part of DEBUG_LL
>>> support.  When DEBUG_LL is turned on for a particular platform,
>>> uncompress debug works too for that platform.
>>>
>>> It reuses the platform DEBUG_LL macros by creating a simple
>>> arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
>>> included there, and implements a generic putc() using those macros.
>>
>> Ok, I've applied this on the previso that _no one_ in future whinges if
>> the debug infrastructure doesn't quite meet their expectation.  The
>> debug infrastructure remains first and foremost that: a simple debug
>> infrastructure suitable for use in the early assembly and the like.
>>
>> That is its primary concern and trumps any requirements from consoles,
>> early printk, decompressor output, and the like.
> 
> ... and now I've dropped the two patches because it causes build failures
> for all OMAP and PXA platforms.

It also breaks tegra_defconfig. For reference, the (or perhaps just a)
reason here is that arch/arm/include/debug/tegra.S references symbol
tegra_uart_config, which is declared in arch/arm/mach-tegra/common.c,
which isn't part of the decompressor build. Tegra's uncompress.h doesn't
touch this symbol, hence avoids this problem.

I'd guess OMAP is broken for similar reasons, since when I created the
tegra_uart_config symbol I was inspired by the OMAP DEBUG_LL code.

Perhaps the patch can be re-cast to only affect multi-platform kernels,
and leave unconverted platforms using uncompress.h (at least, I assume
that must be the problem).

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-02-06 19:04         ` Stephen Warren
@ 2013-02-07  5:04           ` Shawn Guo
  2013-02-07 16:36             ` Stephen Warren
  2013-02-08 12:59             ` Russell King - ARM Linux
  0 siblings, 2 replies; 22+ messages in thread
From: Shawn Guo @ 2013-02-07  5:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 06, 2013 at 12:04:19PM -0700, Stephen Warren wrote:
> On 02/06/2013 02:32 AM, Russell King - ARM Linux wrote:
> > On Mon, Feb 04, 2013 at 04:01:33PM +0000, Russell King - ARM Linux wrote:
> >> On Fri, Jan 18, 2013 at 10:45:20AM +0800, Shawn Guo wrote:
> >>> Instead of giving zero support of uncompress debug for multiplatform
> >>> build, the patch turns uncompress debug into one part of DEBUG_LL
> >>> support.  When DEBUG_LL is turned on for a particular platform,
> >>> uncompress debug works too for that platform.
> >>>
> >>> It reuses the platform DEBUG_LL macros by creating a simple
> >>> arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
> >>> included there, and implements a generic putc() using those macros.
> >>
> >> Ok, I've applied this on the previso that _no one_ in future whinges if
> >> the debug infrastructure doesn't quite meet their expectation.  The
> >> debug infrastructure remains first and foremost that: a simple debug
> >> infrastructure suitable for use in the early assembly and the like.
> >>
> >> That is its primary concern and trumps any requirements from consoles,
> >> early printk, decompressor output, and the like.
> > 
> > ... and now I've dropped the two patches because it causes build failures
> > for all OMAP and PXA platforms.
> 
> It also breaks tegra_defconfig. For reference, the (or perhaps just a)
> reason here is that arch/arm/include/debug/tegra.S references symbol
> tegra_uart_config, which is declared in arch/arm/mach-tegra/common.c,
> which isn't part of the decompressor build. Tegra's uncompress.h doesn't
> touch this symbol, hence avoids this problem.
> 
Thanks for the info, Stephen.

>From what I see, the patch breaks omap, pxa and tegra build by
different causes.

=== omap ===

  AS      arch/arm/boot/compressed/debug.o
  LD      arch/arm/boot/compressed/vmlinux
`.data' referenced in section `.text' of arch/arm/boot/compressed/debug.o: defined in discarded section `.data' of arch/arm/boot/compressed/debug.o
make[3]: *** [arch/arm/boot/compressed/vmlinux] Error 1

The following change moving the variables out of stack section seems
fixing the failure, but I'm not quite sure if it works.

8<---
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug
index cfaed13..7b2877e 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -17,11 +17,9 @@

 #define UART_OFFSET(addr)      ((addr) & 0x00ffffff)

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

                /*
                 * Note that this code won't work if the bootloader passes

--->8

=== pxa/mmp ===

  AS      arch/arm/boot/compressed/debug.o
arch/arm/boot/compressed/debug.S: Assembler messages:
arch/arm/boot/compressed/debug.S:8: Error: garbage following instruction -- `ldr r2,=IOMEM(0xfe000000)'
make[3]: *** [arch/arm/boot/compressed/debug.o] Error 1

This is fairly easy to fix with the following change.

8<---
diff --git a/arch/arm/boot/compressed/debug.S b/arch/arm/boot/compressed/debug.S
index bdb0e25..6e8382d 100644
--- a/arch/arm/boot/compressed/debug.S
+++ b/arch/arm/boot/compressed/debug.S
@@ -1,4 +1,5 @@
 #include <linux/linkage.h>
+#include <asm/assembler.h>

 #include CONFIG_DEBUG_LL_INCLUDE

--->8

=== tegra ===

  LD      arch/arm/boot/compressed/vmlinux
arch/arm/boot/compressed/debug.o: In function `putc':
arch/arm/boot/compressed/debug.S:7: undefined reference to `tegra_uart_config'
make[3]: *** [arch/arm/boot/compressed/vmlinux] Error 1

You have explained the cause clearly.

> I'd guess OMAP is broken for similar reasons, since when I created the
> tegra_uart_config symbol I was inspired by the OMAP DEBUG_LL code.
> 
> Perhaps the patch can be re-cast to only affect multi-platform kernels,
> and leave unconverted platforms using uncompress.h (at least, I assume
> that must be the problem).

Indeed.  The arch/arm/boot/compressed/debug.S shouldn't be part of
traditional build but only multiplatform.  Let's force that with the
change below.

8<---
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index c9865f6..13bdd10 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -24,9 +24,11 @@ endif
 AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
 HEAD   = head.o
 OBJS   += misc.o decompress.o
+ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
 ifeq ($(CONFIG_DEBUG_LL),y)
 OBJS   += debug.o
 endif
+endif
 FONTC  = $(srctree)/drivers/video/console/font_acorn_8x8.c

 # string library code (-Os is enforced to keep it much smaller)
--->8

Shawn

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-02-07  5:04           ` Shawn Guo
@ 2013-02-07 16:36             ` Stephen Warren
  2013-02-08 12:59             ` Russell King - ARM Linux
  1 sibling, 0 replies; 22+ messages in thread
From: Stephen Warren @ 2013-02-07 16:36 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/06/2013 10:04 PM, Shawn Guo wrote:
> On Wed, Feb 06, 2013 at 12:04:19PM -0700, Stephen Warren wrote:
>> On 02/06/2013 02:32 AM, Russell King - ARM Linux wrote:
>>> On Mon, Feb 04, 2013 at 04:01:33PM +0000, Russell King - ARM Linux wrote:
>>>> On Fri, Jan 18, 2013 at 10:45:20AM +0800, Shawn Guo wrote:
>>>>> Instead of giving zero support of uncompress debug for multiplatform
>>>>> build, the patch turns uncompress debug into one part of DEBUG_LL
>>>>> support.  When DEBUG_LL is turned on for a particular platform,
>>>>> uncompress debug works too for that platform.
>>>>>
>>>>> It reuses the platform DEBUG_LL macros by creating a simple
>>>>> arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
>>>>> included there, and implements a generic putc() using those macros.
>>>>
>>>> Ok, I've applied this on the previso that _no one_ in future whinges if
>>>> the debug infrastructure doesn't quite meet their expectation.  The
>>>> debug infrastructure remains first and foremost that: a simple debug
>>>> infrastructure suitable for use in the early assembly and the like.
>>>>
>>>> That is its primary concern and trumps any requirements from consoles,
>>>> early printk, decompressor output, and the like.
>>>
>>> ... and now I've dropped the two patches because it causes build failures
>>> for all OMAP and PXA platforms.
>>
>> It also breaks tegra_defconfig. For reference, the (or perhaps just a)
>> reason here is that arch/arm/include/debug/tegra.S references symbol
>> tegra_uart_config, which is declared in arch/arm/mach-tegra/common.c,
>> which isn't part of the decompressor build. Tegra's uncompress.h doesn't
>> touch this symbol, hence avoids this problem.
>>
> Thanks for the info, Stephen.
> 
> From what I see, the patch breaks omap, pxa and tegra build by
> different causes.
...
>> Perhaps the patch can be re-cast to only affect multi-platform kernels,
>> and leave unconverted platforms using uncompress.h (at least, I assume
>> that must be the problem).
> 
> Indeed.  The arch/arm/boot/compressed/debug.S shouldn't be part of
> traditional build but only multiplatform.  Let's force that with the
> change below.
> 
> 8<---
> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
> index c9865f6..13bdd10 100644
> --- a/arch/arm/boot/compressed/Makefile
> +++ b/arch/arm/boot/compressed/Makefile
> @@ -24,9 +24,11 @@ endif
>  AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
>  HEAD   = head.o
>  OBJS   += misc.o decompress.o
> +ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
>  ifeq ($(CONFIG_DEBUG_LL),y)
>  OBJS   += debug.o
>  endif
> +endif
>  FONTC  = $(srctree)/drivers/video/console/font_acorn_8x8.c
> 
>  # string library code (-Os is enforced to keep it much smaller)
> --->8

Yes, that patch fixes the build problem for me, and all decompressor
output and earlyprintk works. Thanks.

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

* [PATCH v3 2/2] ARM: uncompress debug support for multiplatform build
  2013-02-06  9:32       ` Russell King - ARM Linux
  2013-02-06 19:04         ` Stephen Warren
@ 2013-02-08 11:44         ` Shawn Guo
  2013-02-08 12:27           ` Russell King - ARM Linux
  1 sibling, 1 reply; 22+ messages in thread
From: Shawn Guo @ 2013-02-08 11:44 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of giving zero support of uncompress debug for multiplatform
build, the patch turns uncompress debug into one part of DEBUG_LL
support.  When DEBUG_LL is turned on for a particular platform,
uncompress debug works too for that platform.

It reuses the platform DEBUG_LL macros by creating a simple
arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
included there, and implements a generic putc() using those macros.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
---
Changes since v2:
 * Build arch/arm/boot/compressed/debug.S only for multiplatform kernel
   to fix the breakage on traditional platform build
 * Include asm/assembler.h in arch/arm/boot/compressed/debug.S, as it
   may commonly be needed by platforms to be converted to multiplatform

Russell,

I will put it into patch system if I do not receive any comment
tomorrow.

Shawn

 arch/arm/boot/compressed/Makefile   |    5 +++++
 arch/arm/boot/compressed/debug.S    |   12 ++++++++++++
 arch/arm/include/debug/uncompress.h |    4 ++++
 3 files changed, 21 insertions(+)
 create mode 100644 arch/arm/boot/compressed/debug.S

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 5cad8a6..13bdd10 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -24,6 +24,11 @@ endif
 AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
 HEAD	= head.o
 OBJS	+= misc.o decompress.o
+ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
+ifeq ($(CONFIG_DEBUG_LL),y)
+OBJS	+= debug.o
+endif
+endif
 FONTC	= $(srctree)/drivers/video/console/font_acorn_8x8.c
 
 # string library code (-Os is enforced to keep it much smaller)
diff --git a/arch/arm/boot/compressed/debug.S b/arch/arm/boot/compressed/debug.S
new file mode 100644
index 0000000..6e8382d
--- /dev/null
+++ b/arch/arm/boot/compressed/debug.S
@@ -0,0 +1,12 @@
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+
+#include CONFIG_DEBUG_LL_INCLUDE
+
+ENTRY(putc)
+	addruart r1, r2, r3
+	waituart r3, r1
+	senduart r0, r1
+	busyuart r3, r1
+	mov	 pc, lr
+ENDPROC(putc)
diff --git a/arch/arm/include/debug/uncompress.h b/arch/arm/include/debug/uncompress.h
index e19955d..9aa5314 100644
--- a/arch/arm/include/debug/uncompress.h
+++ b/arch/arm/include/debug/uncompress.h
@@ -1,3 +1,7 @@
+#ifdef CONFIG_DEBUG_LL
+extern void putc(int c);
+#else
 static inline void putc(int c) {}
+#endif
 static inline void flush(void) {}
 static inline void arch_decomp_setup(void) {}
-- 
1.7.9.5

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

* [PATCH v3 2/2] ARM: uncompress debug support for multiplatform build
  2013-02-08 11:44         ` [PATCH v3 " Shawn Guo
@ 2013-02-08 12:27           ` Russell King - ARM Linux
  2013-02-08 12:45             ` Shawn Guo
  0 siblings, 1 reply; 22+ messages in thread
From: Russell King - ARM Linux @ 2013-02-08 12:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 08, 2013 at 07:44:52PM +0800, Shawn Guo wrote:
> Instead of giving zero support of uncompress debug for multiplatform
> build, the patch turns uncompress debug into one part of DEBUG_LL
> support.  When DEBUG_LL is turned on for a particular platform,
> uncompress debug works too for that platform.
> 
> It reuses the platform DEBUG_LL macros by creating a simple
> arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
> included there, and implements a generic putc() using those macros.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Acked-by: Olof Johansson <olof@lixom.net>
> ---
> Changes since v2:
>  * Build arch/arm/boot/compressed/debug.S only for multiplatform kernel
>    to fix the breakage on traditional platform build
>  * Include asm/assembler.h in arch/arm/boot/compressed/debug.S, as it
>    may commonly be needed by platforms to be converted to multiplatform
> 
> Russell,
> 
> I will put it into patch system if I do not receive any comment
> tomorrow.

This doesn't address the problem with OMAP, which is that the OMAP debug
code places data into the .data section, and that is not allowed in the
decompressor.

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

* [PATCH v3 2/2] ARM: uncompress debug support for multiplatform build
  2013-02-08 12:27           ` Russell King - ARM Linux
@ 2013-02-08 12:45             ` Shawn Guo
  0 siblings, 0 replies; 22+ messages in thread
From: Shawn Guo @ 2013-02-08 12:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 08, 2013 at 12:27:14PM +0000, Russell King - ARM Linux wrote:
> On Fri, Feb 08, 2013 at 07:44:52PM +0800, Shawn Guo wrote:
> > Instead of giving zero support of uncompress debug for multiplatform
> > build, the patch turns uncompress debug into one part of DEBUG_LL
> > support.  When DEBUG_LL is turned on for a particular platform,
> > uncompress debug works too for that platform.
> > 
> > It reuses the platform DEBUG_LL macros by creating a simple
> > arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
> > included there, and implements a generic putc() using those macros.
> > 
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Acked-by: Olof Johansson <olof@lixom.net>
> > ---
> > Changes since v2:
> >  * Build arch/arm/boot/compressed/debug.S only for multiplatform kernel
> >    to fix the breakage on traditional platform build
> >  * Include asm/assembler.h in arch/arm/boot/compressed/debug.S, as it
> >    may commonly be needed by platforms to be converted to multiplatform
> > 
> > Russell,
> > 
> > I will put it into patch system if I do not receive any comment
> > tomorrow.
> 
> This doesn't address the problem with OMAP, which is that the OMAP debug
> code places data into the .data section, and that is not allowed in the
> decompressor.

My patches are based on v3.8-rc where OMAP hasn't been converted to
multiplatform.  But you are right, when the patches get into linux-next
it will cause problem for OMAP, since multiplatform is enabled for OMAP
on linux-next.  So should I base my patches on linux-next and fold a
fix for OMAP into the series?

Shawn

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

* [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build
  2013-02-07  5:04           ` Shawn Guo
  2013-02-07 16:36             ` Stephen Warren
@ 2013-02-08 12:59             ` Russell King - ARM Linux
  1 sibling, 0 replies; 22+ messages in thread
From: Russell King - ARM Linux @ 2013-02-08 12:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 07, 2013 at 01:04:36PM +0800, Shawn Guo wrote:
> === omap ===
> 
>   AS      arch/arm/boot/compressed/debug.o
>   LD      arch/arm/boot/compressed/vmlinux
> `.data' referenced in section `.text' of arch/arm/boot/compressed/debug.o: defined in discarded section `.data' of arch/arm/boot/compressed/debug.o
> make[3]: *** [arch/arm/boot/compressed/vmlinux] Error 1
> 
> The following change moving the variables out of stack section seems
> fixing the failure, but I'm not quite sure if it works.
> 
> 8<---
> diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug
> index cfaed13..7b2877e 100644
> --- a/arch/arm/mach-omap2/include/mach/debug-macro.S
> +++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
> @@ -17,11 +17,9 @@
> 
>  #define UART_OFFSET(addr)      ((addr) & 0x00ffffff)
> 
> -               .pushsection .data
>  omap_uart_phys:        .word   0
>  omap_uart_virt:        .word   0
>  omap_uart_lsr: .word   0
> -               .popsection

No, this won't work, because now these variables are located in the text
section which may not be writable.  I don't know what the answer is to
this, but as things stand it's not something that can go into v3.8 until
these problems are addressed (because if it does it _will_ cause
regressions.)

We're basically on the last day of -rc6, so I think it's all too late to
try and get this sorted for this merge window.

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

end of thread, other threads:[~2013-02-08 12:59 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-17 15:21 [PATCH 0/2] Uncompress debug for multiplatform Shawn Guo
2013-01-17 15:21 ` [PATCH 1/2] ARM: use Kconfig to select uncompress.h Shawn Guo
2013-01-17 16:00   ` Arnd Bergmann
2013-01-17 15:21 ` [PATCH 2/2] ARM: use DEBUG_LL infrastructural for multiplatform uncompress debug Shawn Guo
2013-01-17 15:33   ` Shawn Guo
2013-01-17 16:25   ` Arnd Bergmann
2013-01-18  2:49     ` Shawn Guo
2013-01-18  2:45   ` [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
2013-01-18  8:47     ` Arnd Bergmann
2013-01-18 10:42       ` Russell King - ARM Linux
2013-01-18 11:15       ` Shawn Guo
2013-01-18 18:03     ` Olof Johansson
2013-02-04 16:01     ` Russell King - ARM Linux
2013-02-06  9:32       ` Russell King - ARM Linux
2013-02-06 19:04         ` Stephen Warren
2013-02-07  5:04           ` Shawn Guo
2013-02-07 16:36             ` Stephen Warren
2013-02-08 12:59             ` Russell King - ARM Linux
2013-02-08 11:44         ` [PATCH v3 " Shawn Guo
2013-02-08 12:27           ` Russell King - ARM Linux
2013-02-08 12:45             ` Shawn Guo
     [not found] ` <20130128141947.GA11626@S2101-09.ap.freescale.net>
2013-01-28 14:22   ` [PATCH 0/2] Uncompress debug for multiplatform Shawn Guo

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.