aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-08-31 01:03:46 -0400
committerRob Herring <rob.herring@calxeda.com>2012-09-14 10:22:00 -0400
commit91a9fec022f5d98835e27d5307d487da3798040c (patch)
treefa2e41ee6bd1ae9ecd04e468c9e8918fc9891be8
parent01464226ac6089bd6a33f9899cc792c2355ebf39 (diff)
ARM: move debug macros to common location
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>
-rw-r--r--arch/arm/Kconfig.debug5
-rw-r--r--arch/arm/include/debug/icedcc.S90
-rw-r--r--arch/arm/kernel/debug.S87
-rw-r--r--arch/arm/kernel/head.S4
4 files changed, 100 insertions, 86 deletions
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index f15f82bf3a50..4f9760bd234e 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -373,6 +373,11 @@ choice
373 373
374endchoice 374endchoice
375 375
376config DEBUG_LL_INCLUDE
377 string
378 default "debug/icedcc.S" if DEBUG_ICEDCC
379 default "mach/debug-macro.S"
380
376config EARLY_PRINTK 381config EARLY_PRINTK
377 bool "Early printk" 382 bool "Early printk"
378 depends on DEBUG_LL 383 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 000000000000..43afcb021fa3
--- /dev/null
+++ b/arch/arm/include/debug/icedcc.S
@@ -0,0 +1,90 @@
1/*
2 * arch/arm/include/debug/icedcc.S
3 *
4 * Copyright (C) 1994-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12 @@ debug using ARM EmbeddedICE DCC channel
13
14 .macro addruart, rp, rv, tmp
15 .endm
16
17#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
18
19 .macro senduart, rd, rx
20 mcr p14, 0, \rd, c0, c5, 0
21 .endm
22
23 .macro busyuart, rd, rx
241001:
25 mrc p14, 0, \rx, c0, c1, 0
26 tst \rx, #0x20000000
27 beq 1001b
28 .endm
29
30 .macro waituart, rd, rx
31 mov \rd, #0x2000000
321001:
33 subs \rd, \rd, #1
34 bmi 1002f
35 mrc p14, 0, \rx, c0, c1, 0
36 tst \rx, #0x20000000
37 bne 1001b
381002:
39 .endm
40
41#elif defined(CONFIG_CPU_XSCALE)
42
43 .macro senduart, rd, rx
44 mcr p14, 0, \rd, c8, c0, 0
45 .endm
46
47 .macro busyuart, rd, rx
481001:
49 mrc p14, 0, \rx, c14, c0, 0
50 tst \rx, #0x10000000
51 beq 1001b
52 .endm
53
54 .macro waituart, rd, rx
55 mov \rd, #0x10000000
561001:
57 subs \rd, \rd, #1
58 bmi 1002f
59 mrc p14, 0, \rx, c14, c0, 0
60 tst \rx, #0x10000000
61 bne 1001b
621002:
63 .endm
64
65#else
66
67 .macro senduart, rd, rx
68 mcr p14, 0, \rd, c1, c0, 0
69 .endm
70
71 .macro busyuart, rd, rx
721001:
73 mrc p14, 0, \rx, c0, c0, 0
74 tst \rx, #2
75 beq 1001b
76
77 .endm
78
79 .macro waituart, rd, rx
80 mov \rd, #0x2000000
811001:
82 subs \rd, \rd, #1
83 bmi 1002f
84 mrc p14, 0, \rx, c0, c0, 0
85 tst \rx, #2
86 bne 1001b
871002:
88 .endm
89
90#endif /* CONFIG_CPU_V6 */
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index c45522c36787..66f711b2e0e8 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -20,90 +20,9 @@
20 * references to these in a production kernel! 20 * references to these in a production kernel!
21 */ 21 */
22 22
23#if defined(CONFIG_DEBUG_ICEDCC) 23#if !defined(CONFIG_DEBUG_SEMIHOSTING)
24 @@ debug using ARM EmbeddedICE DCC channel 24#include CONFIG_DEBUG_LL_INCLUDE
25 25#endif
26 .macro addruart, rp, rv, tmp
27 .endm
28
29#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
30
31 .macro senduart, rd, rx
32 mcr p14, 0, \rd, c0, c5, 0
33 .endm
34
35 .macro busyuart, rd, rx
361001:
37 mrc p14, 0, \rx, c0, c1, 0
38 tst \rx, #0x20000000
39 beq 1001b
40 .endm
41
42 .macro waituart, rd, rx
43 mov \rd, #0x2000000
441001:
45 subs \rd, \rd, #1
46 bmi 1002f
47 mrc p14, 0, \rx, c0, c1, 0
48 tst \rx, #0x20000000
49 bne 1001b
501002:
51 .endm
52
53#elif defined(CONFIG_CPU_XSCALE)
54
55 .macro senduart, rd, rx
56 mcr p14, 0, \rd, c8, c0, 0
57 .endm
58
59 .macro busyuart, rd, rx
601001:
61 mrc p14, 0, \rx, c14, c0, 0
62 tst \rx, #0x10000000
63 beq 1001b
64 .endm
65
66 .macro waituart, rd, rx
67 mov \rd, #0x10000000
681001:
69 subs \rd, \rd, #1
70 bmi 1002f
71 mrc p14, 0, \rx, c14, c0, 0
72 tst \rx, #0x10000000
73 bne 1001b
741002:
75 .endm
76
77#else
78
79 .macro senduart, rd, rx
80 mcr p14, 0, \rd, c1, c0, 0
81 .endm
82
83 .macro busyuart, rd, rx
841001:
85 mrc p14, 0, \rx, c0, c0, 0
86 tst \rx, #2
87 beq 1001b
88
89 .endm
90
91 .macro waituart, rd, rx
92 mov \rd, #0x2000000
931001:
94 subs \rd, \rd, #1
95 bmi 1002f
96 mrc p14, 0, \rx, c0, c0, 0
97 tst \rx, #2
98 bne 1001b
991002:
100 .endm
101
102#endif /* CONFIG_CPU_V6 */
103
104#elif !defined(CONFIG_DEBUG_SEMIHOSTING)
105#include <mach/debug-macro.S>
106#endif /* CONFIG_DEBUG_ICEDCC */
107 26
108#ifdef CONFIG_MMU 27#ifdef CONFIG_MMU
109 .macro addruart_current, rx, tmp1, tmp2 28 .macro addruart_current, rx, tmp1, tmp2
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 3db960e20cb8..9874d0741191 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -23,8 +23,8 @@
23#include <asm/thread_info.h> 23#include <asm/thread_info.h>
24#include <asm/pgtable.h> 24#include <asm/pgtable.h>
25 25
26#ifdef CONFIG_DEBUG_LL 26#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING)
27#include <mach/debug-macro.S> 27#include CONFIG_DEBUG_LL_INCLUDE
28#endif 28#endif
29 29
30/* 30/*