ARM: 7672/1: uncompress debug support for multiplatform build
authorShawn Guo <shawn.guo@linaro.org>
Thu, 14 Mar 2013 07:48:06 +0000 (08:48 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 15 Mar 2013 17:18:52 +0000 (17:18 +0000)
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.

OMAP and Tegra are exceptions here.  OMAP low-level debug code places
data in the .data section, and that is not allowed in decompressor.
And Tegra code has reference to variable that's unavailable in
decompressor but only in kernel.  That's why Kconfig symbol
DEBUG_UNCOMPRESS controlling multiplatform uncompress debug support is
defined with !DEBUG_OMAP2PLUS_UART && !DEBUG_TEGRA_UART.

It creates arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
included there, implements a generic putc() using those macros, which
will be built when DEBUG_UNCOMPRESS is defined.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Kconfig.debug
arch/arm/boot/compressed/Makefile
arch/arm/boot/compressed/debug.S [new file with mode: 0644]
arch/arm/include/debug/uncompress.h

index fc54a5bcf5abd063599c6f45e49217451eedd119..7aa30e43cb8e59630ab6699f4fe600eea284575a 100644 (file)
@@ -601,6 +601,12 @@ config DEBUG_LL_INCLUDE
        default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
        default "mach/debug-macro.S"
 
+config DEBUG_UNCOMPRESS
+       bool
+       default y if ARCH_MULTIPLATFORM && DEBUG_LL && \
+                    !DEBUG_OMAP2PLUS_UART && \
+                    !DEBUG_TEGRA_UART
+
 config UNCOMPRESS_INCLUDE
        string
        default "debug/uncompress.h" if ARCH_MULTIPLATFORM
index afed28e37ea5776073c9bace41d644b4bd6dda44..3580d57ea21841285bc687d928f39268a325edc1 100644 (file)
@@ -24,6 +24,9 @@ endif
 AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
 HEAD   = head.o
 OBJS   += misc.o decompress.o
+ifeq ($(CONFIG_DEBUG_UNCOMPRESS),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 (file)
index 0000000..6e8382d
--- /dev/null
@@ -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)
index e19955d9e02e23e630afaf0554481da42e3d6f5d..0e2949b0fae9576033705aa969fb21583004b66c 100644 (file)
@@ -1,3 +1,7 @@
+#ifdef CONFIG_DEBUG_UNCOMPRESS
+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) {}