Skip to contentSkip to conversation

Uncompress debug for multiplatform

PATCH Superseded Shawn Guo 5 participants 11 messages Mar 11, 2013 – Mar 13, 2013 Arm (32-bit)

lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

v4 cover Uncompress debug for multiplatform

Instead of giving zero support of uncompress debug for multiplatform build, the series 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 is an exception here. OMAP low-level debug code places data in the .data section, and that is allowed in decompressor. That's why Kconfig symbol DEBUG_UNCOMPRESS that controls multiplatform uncompress debug support is defined with !DEBUG_OMAP2PLUS_UART.

Changes since v3:
- Create Kconfig symbol DEBUG_UNCOMPRESS for building in multiplatform uncompress debug support, so that we can leave out the platform which is part of multiplatform but not ready for being part of uncompress debug like OMAP example.

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

 arch/arm/Kconfig.debug              |    9 +++++++++
 arch/arm/boot/compressed/Makefile   |    3 +++
 arch/arm/boot/compressed/debug.S    |   12 ++++++++++++
 arch/arm/boot/compressed/misc.c     |    8 +-------
 arch/arm/include/debug/uncompress.h |    7 +++++++
 5 files changed, 32 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/boot/compressed/debug.S
 create mode 100644 arch/arm/include/debug/uncompress.h
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v4 1/2 ARM: use Kconfig to select uncompress.h

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.

---
 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
arch/arm/Kconfig.debug +5 -0
index acdddda..fc54a5b 100644
@@ -601,6 +601,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
arch/arm/boot/compressed/misc.c +1 -7
index df89983..31bd43b 100644
@@ -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
 
arch/arm/include/debug/uncompress.h new file +3 -0
new file mode 100644
index 0000000..e19955d
@@ -0,0 +1,3 @@
+static inline void putc(int c) {}
+static inline void flush(void) {}
+static inline void arch_decomp_setup(void) {}
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH v4 2/2 ARM: uncompress debug support for multiplatform build

In reply to Shawn Guo

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 is an exception here. OMAP low-level debug code places data in the .data section, and that is allowed in decompressor. That's why Kconfig symbol DEBUG_UNCOMPRESS that controls multiplatform uncompress debug support is defined with !DEBUG_OMAP2PLUS_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.

---
 arch/arm/Kconfig.debug              |    4 ++++
 arch/arm/boot/compressed/Makefile   |    3 +++
 arch/arm/boot/compressed/debug.S    |   12 ++++++++++++
 arch/arm/include/debug/uncompress.h |    4 ++++
 4 files changed, 23 insertions(+)
 create mode 100644 arch/arm/boot/compressed/debug.S
arch/arm/Kconfig.debug +4 -0
index fc54a5b..559228c 100644
@@ -601,6 +601,10 @@ 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
+
 config UNCOMPRESS_INCLUDE
 	string
 	default "debug/uncompress.h" if ARCH_MULTIPLATFORM
arch/arm/boot/compressed/Makefile +3 -0
index 5cad8a6..e3238bc 100644
@@ -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)
arch/arm/boot/compressed/debug.S new file +12 -0
new file mode 100644
index 0000000..6e8382d
@@ -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)
arch/arm/include/debug/uncompress.h +4 -0
index e19955d..0e2949b 100644
@@ -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) {}
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v4 2/2 ARM: uncompress debug support for multiplatform build

Quoted 9 lines · Shawn Guo

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 is an exception here. OMAP low-level debug code places data in the .data section, and that is allowed in decompressor. That's why Kconfig symbol DEBUG_UNCOMPRESS that controls multiplatform uncompress debug support is defined with !DEBUG_OMAP2PLUS_UART.

This seems like a good solution for now. Later on we can rip out the use .data for omap and just rely on ifdefs for all the port variables if we conclude that we won't try to attempt any runtime autodetection for omaps. So for both patches:

author
#4 lore raw

PATCH v5 2/2 ARM: uncompress debug support for multiplatform build

In reply to Shawn Guo

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.

---
Changes since v4:
- Mark DEBUG_TEGRA_UART as another exception, as the debug code refers to tegra_uart_config which is only accessible in kernel.

 arch/arm/Kconfig.debug              |    6 ++++++
 arch/arm/boot/compressed/Makefile   |    3 +++
 arch/arm/boot/compressed/debug.S    |   12 ++++++++++++
 arch/arm/include/debug/uncompress.h |    4 ++++
 4 files changed, 25 insertions(+)
 create mode 100644 arch/arm/boot/compressed/debug.S
arch/arm/Kconfig.debug +6 -0
index fc54a5b..7aa30e4 100644
@@ -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
arch/arm/boot/compressed/Makefile +3 -0
index 5cad8a6..e3238bc 100644
@@ -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)
arch/arm/boot/compressed/debug.S new file +12 -0
new file mode 100644
index 0000000..6e8382d
@@ -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)
arch/arm/include/debug/uncompress.h +4 -0
index e19955d..0e2949b 100644
@@ -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) {}
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v5 2/2 ARM: uncompress debug support for multiplatform build

Quoted 11 lines · Shawn Guo

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.

Quoted 7 lines

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.

#6 lore raw

v4 cover Uncompress debug for multiplatform

In reply to Shawn Guo
Quoted 10 lines · Shawn Guo

Instead of giving zero support of uncompress debug for multiplatform build, the series 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 is an exception here. OMAP low-level debug code places data in the .data section, and that is allowed in decompressor. That's why Kconfig symbol DEBUG_UNCOMPRESS that controls multiplatform uncompress debug support is defined with !DEBUG_OMAP2PLUS_UART.

Quoted 5 lines

Changes since v3:
- Create Kconfig symbol DEBUG_UNCOMPRESS for building in multiplatform uncompress debug support, so that we can leave out the platform which is part of multiplatform but not ready for being part of uncompress debug like OMAP example.

Wasn't Tegra also having problems with this as well?

#7 lore raw

v4 cover Uncompress debug for multiplatform

Quoted 11 lines · Russell King - ARM Linux
Quoted 10 lines · Shawn Guo

Instead of giving zero support of uncompress debug for multiplatform build, the series 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 is an exception here. OMAP low-level debug code places data in the .data section, and that is allowed in decompressor. That's why Kconfig symbol DEBUG_UNCOMPRESS that controls multiplatform uncompress debug support is defined with !DEBUG_OMAP2PLUS_UART.

Quoted 7 lines
Quoted 5 lines

Changes since v3:
- Create Kconfig symbol DEBUG_UNCOMPRESS for building in multiplatform uncompress debug support, so that we can leave out the platform which is part of multiplatform but not ready for being part of uncompress debug like OMAP example.

Wasn't Tegra also having problems with this as well?

Tegra isn't converted to multi-platform yet. I hope to in 3.10. If this series is something that could be put into an arm-soc topic branch for me to build on during the Tegra conversion, that might be useful (although I haven't looked at the series to be sure).

author
#8 lore raw

v4 cover Uncompress debug for multiplatform

Quoted 18 lines · Stephen Warren
Quoted 17 lines · Russell King - ARM Linux
Quoted 15 lines · Shawn Guo

Instead of giving zero support of uncompress debug for multiplatform build, the series 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 is an exception here. OMAP low-level debug code places data in the .data section, and that is allowed in decompressor. That's why Kconfig symbol DEBUG_UNCOMPRESS that controls multiplatform uncompress debug support is defined with !DEBUG_OMAP2PLUS_UART.

Changes since v3:
- Create Kconfig symbol DEBUG_UNCOMPRESS for building in multiplatform uncompress debug support, so that we can leave out the platform which is part of multiplatform but not ready for being part of uncompress debug like OMAP example.

Quoted 3 lines
Quoted 1 line

Wasn't Tegra also having problems with this as well?

Tegra isn't converted to multi-platform yet. I hope to in 3.10.

Yeah, that's why I did not touch Tegra as the series is based on v3.9-rc1 where Tegra hasn't been part of multi-platform yet.

But I just noticed that debug-macro.S for Tegra has been renamed to debug/tegra.S, and we already know it will be broken when multi-platform is enabled together with this series for Tegra. I should probably just take a further step to mark Tegra as another exception right now, to ensure the series will not break thing when getting merged together with Tegra multi-platform work. Something like the following:

config DEBUG_UNCOMPRESS

        bool
        default y if ARCH_MULTIPLATFORM && DEBUG_LL && \
                     !DEBUG_OMAP2PLUS_UART && \
                     !DEBUG_TEGRA_UART

Shawn

#9 lore raw

v4 cover Uncompress debug for multiplatform

Quoted 21 lines · Shawn Guo
Quoted 20 lines · Stephen Warren
Quoted 18 lines · Russell King - ARM Linux
Quoted 10 lines · Shawn Guo

Instead of giving zero support of uncompress debug for multiplatform build, the series 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 is an exception here. OMAP low-level debug code places data in the .data section, and that is allowed in decompressor. That's why Kconfig symbol DEBUG_UNCOMPRESS that controls multiplatform uncompress debug support is defined with !DEBUG_OMAP2PLUS_UART.

Quoted 5 lines

Changes since v3:
- Create Kconfig symbol DEBUG_UNCOMPRESS for building in multiplatform uncompress debug support, so that we can leave out the platform which is part of multiplatform but not ready for being part of uncompress debug like OMAP example.

Wasn't Tegra also having problems with this as well?

Quoted 8 lines
Quoted 1 line

Tegra isn't converted to multi-platform yet. I hope to in 3.10.

Yeah, that's why I did not touch Tegra as the series is based on v3.9-rc1 where Tegra hasn't been part of multi-platform yet.

But I just noticed that debug-macro.S for Tegra has been renamed to debug/tegra.S, and we already know it will be broken when multi-platform is enabled together with this series for Tegra.

Was that because the code touches .data? Perhaps I can get away with using some hard-coded IRAM location or something.

author
#10 lore raw

v4 cover Uncompress debug for multiplatform

Quoted 9 lines · Stephen Warren
Quoted 6 lines

Yeah, that's why I did not touch Tegra as the series is based on v3.9-rc1 where Tegra hasn't been part of multi-platform yet.

But I just noticed that debug-macro.S for Tegra has been renamed to debug/tegra.S, and we already know it will be broken when multi-platform is enabled together with this series for Tegra.

Was that because the code touches .data? Perhaps I can get away with using some hard-coded IRAM location or something.

Even worse. It has the reference to tegra_uart_config which will be unavailable in decompressor.

Shawn