ARM: move debug macros to common location
authorRob Herring <rob.herring@calxeda.com>
Fri, 31 Aug 2012 05:03:46 +0000 (00:03 -0500)
committerRob Herring <rob.herring@calxeda.com>
Fri, 14 Sep 2012 14:22:00 +0000 (09:22 -0500)
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>
Cc: Russell King <linux@arm.linux.org.uk>
arch/arm/Kconfig.debug
arch/arm/include/debug/icedcc.S [new file with mode: 0644]
arch/arm/kernel/debug.S
arch/arm/kernel/head.S

index f15f82bf3a50f808005af479ff9c334f100c1044..4f9760bd234e2a2e3c19fd15e98718137fd1b52a 100644 (file)
@@ -373,6 +373,11 @@ choice
 
 endchoice
 
+config DEBUG_LL_INCLUDE
+       string
+       default "debug/icedcc.S" if DEBUG_ICEDCC
+       default "mach/debug-macro.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 (file)
index 0000000..43afcb0
--- /dev/null
@@ -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 */
index c45522c36787fd3c62240076337a7cda2fee5489..66f711b2e0e856fa6485f96bc26f32f3c661c767 100644 (file)
  * 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
index 3db960e20cb8f0059adf749214849f4a9ba61c8c..9874d074119118f1d42abeee662beaa3433ca052 100644 (file)
@@ -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
 
 /*