diff options
author | Tony Lindgren <tony@atomide.com> | 2006-09-20 08:03:34 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-25 05:36:09 -0400 |
commit | 7d95ded91149564100a3181d341361aedcfd5bf5 (patch) | |
tree | 5be7882a7cc3f3c646f12c2c60cb7a689d46d0ba | |
parent | baf97ce6eda5891ee45fae9c1b06db855bb697e1 (diff) |
[ARM] 3838/1: ARM: DCC debug console support for ARM11
Adds support for CONFIG_DEBUG_ICEDCC for ARM11.
Tested on ARM1136 (OMAP2420).
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/boot/compressed/head.S | 10 | ||||
-rw-r--r-- | arch/arm/boot/compressed/misc.c | 21 | ||||
-rw-r--r-- | arch/arm/kernel/debug.S | 35 |
3 files changed, 65 insertions, 1 deletions
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 987c44160496..75df1f764a10 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
@@ -20,11 +20,21 @@ | |||
20 | #ifdef DEBUG | 20 | #ifdef DEBUG |
21 | 21 | ||
22 | #if defined(CONFIG_DEBUG_ICEDCC) | 22 | #if defined(CONFIG_DEBUG_ICEDCC) |
23 | |||
24 | #ifdef CONFIG_CPU_V6 | ||
25 | .macro loadsp, rb | ||
26 | .endm | ||
27 | .macro writeb, ch, rb | ||
28 | mcr p14, 0, \ch, c0, c5, 0 | ||
29 | .endm | ||
30 | #else | ||
23 | .macro loadsp, rb | 31 | .macro loadsp, rb |
24 | .endm | 32 | .endm |
25 | .macro writeb, ch, rb | 33 | .macro writeb, ch, rb |
26 | mcr p14, 0, \ch, c0, c1, 0 | 34 | mcr p14, 0, \ch, c0, c1, 0 |
27 | .endm | 35 | .endm |
36 | #endif | ||
37 | |||
28 | #else | 38 | #else |
29 | 39 | ||
30 | #include <asm/arch/debug-macro.S> | 40 | #include <asm/arch/debug-macro.S> |
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c index ace3fb5835d9..283891c736c4 100644 --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c | |||
@@ -30,6 +30,25 @@ static void putstr(const char *ptr); | |||
30 | #include <asm/arch/uncompress.h> | 30 | #include <asm/arch/uncompress.h> |
31 | 31 | ||
32 | #ifdef CONFIG_DEBUG_ICEDCC | 32 | #ifdef CONFIG_DEBUG_ICEDCC |
33 | |||
34 | #ifdef CONFIG_CPU_V6 | ||
35 | |||
36 | static void icedcc_putc(int ch) | ||
37 | { | ||
38 | int status, i = 0x4000000; | ||
39 | |||
40 | do { | ||
41 | if (--i < 0) | ||
42 | return; | ||
43 | |||
44 | asm volatile ("mrc p14, 0, %0, c0, c1, 0" : "=r" (status)); | ||
45 | } while (status & (1 << 29)); | ||
46 | |||
47 | asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch)); | ||
48 | } | ||
49 | |||
50 | #else | ||
51 | |||
33 | static void icedcc_putc(int ch) | 52 | static void icedcc_putc(int ch) |
34 | { | 53 | { |
35 | int status, i = 0x4000000; | 54 | int status, i = 0x4000000; |
@@ -44,6 +63,8 @@ static void icedcc_putc(int ch) | |||
44 | asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch)); | 63 | asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch)); |
45 | } | 64 | } |
46 | 65 | ||
66 | #endif | ||
67 | |||
47 | #define putc(ch) icedcc_putc(ch) | 68 | #define putc(ch) icedcc_putc(ch) |
48 | #define flush() do { } while (0) | 69 | #define flush() do { } while (0) |
49 | #endif | 70 | #endif |
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S index a5747e58a9dc..5617566477b4 100644 --- a/arch/arm/kernel/debug.S +++ b/arch/arm/kernel/debug.S | |||
@@ -21,6 +21,36 @@ | |||
21 | 21 | ||
22 | #if defined(CONFIG_DEBUG_ICEDCC) | 22 | #if defined(CONFIG_DEBUG_ICEDCC) |
23 | @@ debug using ARM EmbeddedICE DCC channel | 23 | @@ debug using ARM EmbeddedICE DCC channel |
24 | |||
25 | #if defined(CONFIG_CPU_V6) | ||
26 | |||
27 | .macro addruart, rx | ||
28 | .endm | ||
29 | |||
30 | .macro senduart, rd, rx | ||
31 | mcr p14, 0, \rd, c0, c5, 0 | ||
32 | .endm | ||
33 | |||
34 | .macro busyuart, rd, rx | ||
35 | 1001: | ||
36 | mrc p14, 0, \rx, c0, c1, 0 | ||
37 | tst \rx, #0x20000000 | ||
38 | beq 1001b | ||
39 | .endm | ||
40 | |||
41 | .macro waituart, rd, rx | ||
42 | mov \rd, #0x2000000 | ||
43 | 1001: | ||
44 | subs \rd, \rd, #1 | ||
45 | bmi 1002f | ||
46 | mrc p14, 0, \rx, c0, c1, 0 | ||
47 | tst \rx, #0x20000000 | ||
48 | bne 1001b | ||
49 | 1002: | ||
50 | .endm | ||
51 | |||
52 | #else | ||
53 | |||
24 | .macro addruart, rx | 54 | .macro addruart, rx |
25 | .endm | 55 | .endm |
26 | 56 | ||
@@ -46,9 +76,12 @@ | |||
46 | bne 1001b | 76 | bne 1001b |
47 | 1002: | 77 | 1002: |
48 | .endm | 78 | .endm |
79 | |||
80 | #endif /* CONFIG_CPU_V6 */ | ||
81 | |||
49 | #else | 82 | #else |
50 | #include <asm/arch/debug-macro.S> | 83 | #include <asm/arch/debug-macro.S> |
51 | #endif | 84 | #endif /* CONFIG_DEBUG_ICEDCC */ |
52 | 85 | ||
53 | /* | 86 | /* |
54 | * Useful debugging routines | 87 | * Useful debugging routines |