* [PATCH 1/3] ARM: move debug macros to common location
@ 2012-08-31 18:29 Rob Herring
2012-09-01 18:22 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2012-08-31 18:29 UTC (permalink / raw)
To: linux-arm-kernel
From: Rob Herring <rob.herring@calxeda.com>
Based on suggestion by Russell King, create a common location for debug
macros and select the included debug macro file using config option.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/Kconfig.debug | 5 +++
arch/arm/include/debug/icedcc.S | 90 +++++++++++++++++++++++++++++++++++++++
arch/arm/kernel/debug.S | 87 ++-----------------------------------
arch/arm/kernel/head.S | 4 +-
4 files changed, 100 insertions(+), 86 deletions(-)
create mode 100644 arch/arm/include/debug/icedcc.S
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index f15f82b..71bbda2 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -373,6 +373,11 @@ choice
endchoice
+config DEBUG_LL_INCLUDE
+ string
+ default "debug/icedcc.S" if DEBUG_ICEDCC
+ default "mach/debug-macros.S"
+
config EARLY_PRINTK
bool "Early printk"
depends on DEBUG_LL
diff --git a/arch/arm/include/debug/icedcc.S b/arch/arm/include/debug/icedcc.S
new file mode 100644
index 0000000..43afcb0
--- /dev/null
+++ b/arch/arm/include/debug/icedcc.S
@@ -0,0 +1,90 @@
+/*
+ * arch/arm/include/debug/icedcc.S
+ *
+ * Copyright (C) 1994-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+ @@ debug using ARM EmbeddedICE DCC channel
+
+ .macro addruart, rp, rv, tmp
+ .endm
+
+#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
+
+ .macro senduart, rd, rx
+ mcr p14, 0, \rd, c0, c5, 0
+ .endm
+
+ .macro busyuart, rd, rx
+1001:
+ mrc p14, 0, \rx, c0, c1, 0
+ tst \rx, #0x20000000
+ beq 1001b
+ .endm
+
+ .macro waituart, rd, rx
+ mov \rd, #0x2000000
+1001:
+ subs \rd, \rd, #1
+ bmi 1002f
+ mrc p14, 0, \rx, c0, c1, 0
+ tst \rx, #0x20000000
+ bne 1001b
+1002:
+ .endm
+
+#elif defined(CONFIG_CPU_XSCALE)
+
+ .macro senduart, rd, rx
+ mcr p14, 0, \rd, c8, c0, 0
+ .endm
+
+ .macro busyuart, rd, rx
+1001:
+ mrc p14, 0, \rx, c14, c0, 0
+ tst \rx, #0x10000000
+ beq 1001b
+ .endm
+
+ .macro waituart, rd, rx
+ mov \rd, #0x10000000
+1001:
+ subs \rd, \rd, #1
+ bmi 1002f
+ mrc p14, 0, \rx, c14, c0, 0
+ tst \rx, #0x10000000
+ bne 1001b
+1002:
+ .endm
+
+#else
+
+ .macro senduart, rd, rx
+ mcr p14, 0, \rd, c1, c0, 0
+ .endm
+
+ .macro busyuart, rd, rx
+1001:
+ mrc p14, 0, \rx, c0, c0, 0
+ tst \rx, #2
+ beq 1001b
+
+ .endm
+
+ .macro waituart, rd, rx
+ mov \rd, #0x2000000
+1001:
+ subs \rd, \rd, #1
+ bmi 1002f
+ mrc p14, 0, \rx, c0, c0, 0
+ tst \rx, #2
+ bne 1001b
+1002:
+ .endm
+
+#endif /* CONFIG_CPU_V6 */
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index c45522c..66f711b 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -20,90 +20,9 @@
* references to these in a production kernel!
*/
-#if defined(CONFIG_DEBUG_ICEDCC)
- @@ debug using ARM EmbeddedICE DCC channel
-
- .macro addruart, rp, rv, tmp
- .endm
-
-#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
-
- .macro senduart, rd, rx
- mcr p14, 0, \rd, c0, c5, 0
- .endm
-
- .macro busyuart, rd, rx
-1001:
- mrc p14, 0, \rx, c0, c1, 0
- tst \rx, #0x20000000
- beq 1001b
- .endm
-
- .macro waituart, rd, rx
- mov \rd, #0x2000000
-1001:
- subs \rd, \rd, #1
- bmi 1002f
- mrc p14, 0, \rx, c0, c1, 0
- tst \rx, #0x20000000
- bne 1001b
-1002:
- .endm
-
-#elif defined(CONFIG_CPU_XSCALE)
-
- .macro senduart, rd, rx
- mcr p14, 0, \rd, c8, c0, 0
- .endm
-
- .macro busyuart, rd, rx
-1001:
- mrc p14, 0, \rx, c14, c0, 0
- tst \rx, #0x10000000
- beq 1001b
- .endm
-
- .macro waituart, rd, rx
- mov \rd, #0x10000000
-1001:
- subs \rd, \rd, #1
- bmi 1002f
- mrc p14, 0, \rx, c14, c0, 0
- tst \rx, #0x10000000
- bne 1001b
-1002:
- .endm
-
-#else
-
- .macro senduart, rd, rx
- mcr p14, 0, \rd, c1, c0, 0
- .endm
-
- .macro busyuart, rd, rx
-1001:
- mrc p14, 0, \rx, c0, c0, 0
- tst \rx, #2
- beq 1001b
-
- .endm
-
- .macro waituart, rd, rx
- mov \rd, #0x2000000
-1001:
- subs \rd, \rd, #1
- bmi 1002f
- mrc p14, 0, \rx, c0, c0, 0
- tst \rx, #2
- bne 1001b
-1002:
- .endm
-
-#endif /* CONFIG_CPU_V6 */
-
-#elif !defined(CONFIG_DEBUG_SEMIHOSTING)
-#include <mach/debug-macro.S>
-#endif /* CONFIG_DEBUG_ICEDCC */
+#if !defined(CONFIG_DEBUG_SEMIHOSTING)
+#include CONFIG_DEBUG_LL_INCLUDE
+#endif
#ifdef CONFIG_MMU
.macro addruart_current, rx, tmp1, tmp2
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 3db960e..9874d07 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -23,8 +23,8 @@
#include <asm/thread_info.h>
#include <asm/pgtable.h>
-#ifdef CONFIG_DEBUG_LL
-#include <mach/debug-macro.S>
+#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING)
+#include CONFIG_DEBUG_LL_INCLUDE
#endif
/*
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 1/3] ARM: move debug macros to common location
@ 2012-09-01 8:53 Andrew Lunn
2012-09-04 22:02 ` Rob Herring
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2012-09-01 8:53 UTC (permalink / raw)
To: linux-arm-kernel
> From: Rob Herring <rob.herring@calxeda.com>
>
> Based on suggestion by Russell King, create a common location for debug
> macros and select the included debug macro file using config option.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
> arch/arm/Kconfig.debug | 5 +++
> arch/arm/include/debug/icedcc.S | 90 +++++++++++++++++++++++++++++++++++++++
> arch/arm/kernel/debug.S | 87 ++-----------------------------------
> arch/arm/kernel/head.S | 4 +-
> 4 files changed, 100 insertions(+), 86 deletions(-)
> create mode 100644 arch/arm/include/debug/icedcc.S
Hi Rob
What about arch/arm/include/asm/hardware/debug-8250.S and
arch/arm/include/asm/hardware/debug-pl01x.S?
Might be nice to have these two also in arch/arm/include/debug/, or
follow the naming convention set by these two and have
arch/arm/include/asm/hardware/debug-icedcc.S?
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] ARM: move debug macros to common location
2012-08-31 18:29 Rob Herring
@ 2012-09-01 18:22 ` Arnd Bergmann
0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2012-09-01 18:22 UTC (permalink / raw)
To: linux-arm-kernel
On Friday 31 August 2012, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
>
> Based on suggestion by Russell King, create a common location for debug
> macros and select the included debug macro file using config option.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
> arch/arm/Kconfig.debug | 5 +++
> arch/arm/include/debug/icedcc.S | 90 +++++++++++++++++++++++++++++++++++++++
> arch/arm/kernel/debug.S | 87 ++-----------------------------------
> arch/arm/kernel/head.S | 4 +-
> 4 files changed, 100 insertions(+), 86 deletions(-)
> create mode 100644 arch/arm/include/debug/icedcc.S
I haven't followed that discussion, but it sure sounds like a good idea.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Any preference which tree to use for merging this?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] ARM: move debug macros to common location
2012-09-01 8:53 [PATCH 1/3] ARM: move debug macros to common location Andrew Lunn
@ 2012-09-04 22:02 ` Rob Herring
0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2012-09-04 22:02 UTC (permalink / raw)
To: linux-arm-kernel
On 09/01/2012 03:53 AM, Andrew Lunn wrote:
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> Based on suggestion by Russell King, create a common location for debug
>> macros and select the included debug macro file using config option.
>>
>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>> ---
>> arch/arm/Kconfig.debug | 5 +++
>> arch/arm/include/debug/icedcc.S | 90 +++++++++++++++++++++++++++++++++++++++
>> arch/arm/kernel/debug.S | 87 ++-----------------------------------
>> arch/arm/kernel/head.S | 4 +-
>> 4 files changed, 100 insertions(+), 86 deletions(-)
>> create mode 100644 arch/arm/include/debug/icedcc.S
>
> Hi Rob
>
> What about arch/arm/include/asm/hardware/debug-8250.S and
> arch/arm/include/asm/hardware/debug-pl01x.S?
>
> Might be nice to have these two also in arch/arm/include/debug/, or
> follow the naming convention set by these two and have
> arch/arm/include/asm/hardware/debug-icedcc.S?
I agree we should move those, but would rather do it after moving all
the debug-macro.S files into include/debug. As I mentioned in the
multi-platform thread, I think there are further improvements we can do
and eliminate many of the debug-macro.S files.
Rob
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-04 22:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-01 8:53 [PATCH 1/3] ARM: move debug macros to common location Andrew Lunn
2012-09-04 22:02 ` Rob Herring
-- strict thread matches above, loose matches on Subject: below --
2012-08-31 18:29 Rob Herring
2012-09-01 18:22 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).