Skip to content

Commit 7d95ded

Browse files
tmlindRussell King
authored andcommitted
[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>
1 parent baf97ce commit 7d95ded

3 files changed

Lines changed: 65 additions & 1 deletion

File tree

‎arch/arm/boot/compressed/head.S‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@
2020
#ifdef DEBUG
2121

2222
#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
2331
.macro loadsp, rb
2432
.endm
2533
.macro writeb, ch, rb
2634
mcr p14, 0, \ch, c0, c1, 0
2735
.endm
36+
#endif
37+
2838
#else
2939

3040
#include <asm/arch/debug-macro.S>

‎arch/arm/boot/compressed/misc.c‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,25 @@ static void putstr(const char *ptr);
3030
#include <asm/arch/uncompress.h>
3131

3232
#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+
3352
static void icedcc_putc(int ch)
3453
{
3554
int status, i = 0x4000000;
@@ -44,6 +63,8 @@ static void icedcc_putc(int ch)
4463
asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch));
4564
}
4665

66+
#endif
67+
4768
#define putc(ch) icedcc_putc(ch)
4869
#define flush() do { } while (0)
4970
#endif

‎arch/arm/kernel/debug.S‎

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,36 @@
2121

2222
#if defined(CONFIG_DEBUG_ICEDCC)
2323
@@ 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+
2454
.macro addruart, rx
2555
.endm
2656

@@ -46,9 +76,12 @@
4676
bne 1001b
4777
1002:
4878
.endm
79+
80+
#endif /* CONFIG_CPU_V6 */
81+
4982
#else
5083
#include <asm/arch/debug-macro.S>
51-
#endif
84+
#endif /* CONFIG_DEBUG_ICEDCC */
5285

5386
/*
5487
* Useful debugging routines

0 commit comments

Comments
 (0)