* [PATCH v4 1/2] ARM: use Kconfig to select uncompress.h
2013-03-11 11:35 [PATCH v4 0/2] Uncompress debug for multiplatform Shawn Guo
@ 2013-03-11 11:35 ` Shawn Guo
2013-03-11 11:35 ` [PATCH v4 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
2013-03-11 17:03 ` [PATCH v4 0/2] Uncompress debug for multiplatform Russell King - ARM Linux
2 siblings, 0 replies; 11+ messages in thread
From: Shawn Guo @ 2013-03-11 11:35 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>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
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 acdddda..fc54a5b 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -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
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] 11+ messages in thread* [PATCH v4 2/2] ARM: uncompress debug support for multiplatform build
2013-03-11 11:35 [PATCH v4 0/2] Uncompress debug for multiplatform Shawn Guo
2013-03-11 11:35 ` [PATCH v4 1/2] ARM: use Kconfig to select uncompress.h Shawn Guo
@ 2013-03-11 11:35 ` Shawn Guo
2013-03-11 17:36 ` Tony Lindgren
2013-03-13 3:18 ` [PATCH v5 " Shawn Guo
2013-03-11 17:03 ` [PATCH v4 0/2] Uncompress debug for multiplatform Russell King - ARM Linux
2 siblings, 2 replies; 11+ messages in thread
From: Shawn Guo @ 2013-03-11 11:35 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.
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.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
---
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
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index fc54a5b..559228c 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -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
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 5cad8a6..e3238bc 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_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
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..0e2949b 100644
--- a/arch/arm/include/debug/uncompress.h
+++ b/arch/arm/include/debug/uncompress.h
@@ -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) {}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v4 2/2] ARM: uncompress debug support for multiplatform build
2013-03-11 11:35 ` [PATCH v4 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
@ 2013-03-11 17:36 ` Tony Lindgren
2013-03-13 3:18 ` [PATCH v5 " Shawn Guo
1 sibling, 0 replies; 11+ messages in thread
From: Tony Lindgren @ 2013-03-11 17:36 UTC (permalink / raw)
To: linux-arm-kernel
* Shawn Guo <shawn.guo@linaro.org> [130311 04:39]:
> 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:
Acked-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v5 2/2] ARM: uncompress debug support for multiplatform build
2013-03-11 11:35 ` [PATCH v4 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
2013-03-11 17:36 ` Tony Lindgren
@ 2013-03-13 3:18 ` Shawn Guo
2013-03-13 11:19 ` Arnd Bergmann
1 sibling, 1 reply; 11+ messages in thread
From: Shawn Guo @ 2013-03-13 3:18 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.
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>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Tony Lindgren <tony@atomide.com>
---
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
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index fc54a5b..7aa30e4 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -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
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 5cad8a6..e3238bc 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_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
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..0e2949b 100644
--- a/arch/arm/include/debug/uncompress.h
+++ b/arch/arm/include/debug/uncompress.h
@@ -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) {}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v5 2/2] ARM: uncompress debug support for multiplatform build
2013-03-13 3:18 ` [PATCH v5 " Shawn Guo
@ 2013-03-13 11:19 ` Arnd Bergmann
0 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2013-03-13 11:19 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 13 March 2013, Shawn Guo wrote:
> 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>
> Acked-by: Olof Johansson <olof@lixom.net>
> Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 0/2] Uncompress debug for multiplatform
2013-03-11 11:35 [PATCH v4 0/2] Uncompress debug for multiplatform Shawn Guo
2013-03-11 11:35 ` [PATCH v4 1/2] ARM: use Kconfig to select uncompress.h Shawn Guo
2013-03-11 11:35 ` [PATCH v4 2/2] ARM: uncompress debug support for multiplatform build Shawn Guo
@ 2013-03-11 17:03 ` Russell King - ARM Linux
2013-03-11 17:30 ` Stephen Warren
2 siblings, 1 reply; 11+ messages in thread
From: Russell King - ARM Linux @ 2013-03-11 17:03 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 11, 2013 at 07:35:35PM +0800, Shawn Guo wrote:
> 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.
Wasn't Tegra also having problems with this as well?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 0/2] Uncompress debug for multiplatform
2013-03-11 17:03 ` [PATCH v4 0/2] Uncompress debug for multiplatform Russell King - ARM Linux
@ 2013-03-11 17:30 ` Stephen Warren
2013-03-12 4:02 ` Shawn Guo
0 siblings, 1 reply; 11+ messages in thread
From: Stephen Warren @ 2013-03-11 17:30 UTC (permalink / raw)
To: linux-arm-kernel
On 03/11/2013 11:03 AM, Russell King - ARM Linux wrote:
> On Mon, Mar 11, 2013 at 07:35:35PM +0800, Shawn Guo wrote:
>> 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.
>
> 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).
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 0/2] Uncompress debug for multiplatform
2013-03-11 17:30 ` Stephen Warren
@ 2013-03-12 4:02 ` Shawn Guo
2013-03-12 18:23 ` Stephen Warren
0 siblings, 1 reply; 11+ messages in thread
From: Shawn Guo @ 2013-03-12 4:02 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 11, 2013 at 11:30:02AM -0600, Stephen Warren wrote:
> On 03/11/2013 11:03 AM, Russell King - ARM Linux wrote:
> > On Mon, Mar 11, 2013 at 07:35:35PM +0800, Shawn Guo wrote:
> >> 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.
> >
> > 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
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v4 0/2] Uncompress debug for multiplatform
2013-03-12 4:02 ` Shawn Guo
@ 2013-03-12 18:23 ` Stephen Warren
2013-03-13 2:21 ` Shawn Guo
0 siblings, 1 reply; 11+ messages in thread
From: Stephen Warren @ 2013-03-12 18:23 UTC (permalink / raw)
To: linux-arm-kernel
On 03/11/2013 10:02 PM, Shawn Guo wrote:
> On Mon, Mar 11, 2013 at 11:30:02AM -0600, Stephen Warren wrote:
>> On 03/11/2013 11:03 AM, Russell King - ARM Linux wrote:
>>> On Mon, Mar 11, 2013 at 07:35:35PM +0800, Shawn Guo wrote:
>>>> 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.
>>>
>>> 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.
Was that because the code touches .data? Perhaps I can get away with
using some hard-coded IRAM location or something.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 0/2] Uncompress debug for multiplatform
2013-03-12 18:23 ` Stephen Warren
@ 2013-03-13 2:21 ` Shawn Guo
0 siblings, 0 replies; 11+ messages in thread
From: Shawn Guo @ 2013-03-13 2:21 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Mar 12, 2013 at 12:23:32PM -0600, Stephen Warren wrote:
> > 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
^ permalink raw reply [flat|nested] 11+ messages in thread