Commit 7d95ded9 authored by Tony Lindgren's avatar Tony Lindgren Committed by Russell King

[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: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent baf97ce6
...@@ -20,11 +20,21 @@ ...@@ -20,11 +20,21 @@
#ifdef DEBUG #ifdef DEBUG
#if defined(CONFIG_DEBUG_ICEDCC) #if defined(CONFIG_DEBUG_ICEDCC)
#ifdef CONFIG_CPU_V6
.macro loadsp, rb
.endm
.macro writeb, ch, rb
mcr p14, 0, \ch, c0, c5, 0
.endm
#else
.macro loadsp, rb .macro loadsp, rb
.endm .endm
.macro writeb, ch, rb .macro writeb, ch, rb
mcr p14, 0, \ch, c0, c1, 0 mcr p14, 0, \ch, c0, c1, 0
.endm .endm
#endif
#else #else
#include <asm/arch/debug-macro.S> #include <asm/arch/debug-macro.S>
......
...@@ -30,6 +30,25 @@ static void putstr(const char *ptr); ...@@ -30,6 +30,25 @@ static void putstr(const char *ptr);
#include <asm/arch/uncompress.h> #include <asm/arch/uncompress.h>
#ifdef CONFIG_DEBUG_ICEDCC #ifdef CONFIG_DEBUG_ICEDCC
#ifdef CONFIG_CPU_V6
static void icedcc_putc(int ch)
{
int status, i = 0x4000000;
do {
if (--i < 0)
return;
asm volatile ("mrc p14, 0, %0, c0, c1, 0" : "=r" (status));
} while (status & (1 << 29));
asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch));
}
#else
static void icedcc_putc(int ch) static void icedcc_putc(int ch)
{ {
int status, i = 0x4000000; int status, i = 0x4000000;
...@@ -44,6 +63,8 @@ static void icedcc_putc(int ch) ...@@ -44,6 +63,8 @@ static void icedcc_putc(int ch)
asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch)); asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch));
} }
#endif
#define putc(ch) icedcc_putc(ch) #define putc(ch) icedcc_putc(ch)
#define flush() do { } while (0) #define flush() do { } while (0)
#endif #endif
......
...@@ -21,6 +21,36 @@ ...@@ -21,6 +21,36 @@
#if defined(CONFIG_DEBUG_ICEDCC) #if defined(CONFIG_DEBUG_ICEDCC)
@@ debug using ARM EmbeddedICE DCC channel @@ debug using ARM EmbeddedICE DCC channel
#if defined(CONFIG_CPU_V6)
.macro addruart, rx
.endm
.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
#else
.macro addruart, rx .macro addruart, rx
.endm .endm
...@@ -46,9 +76,12 @@ ...@@ -46,9 +76,12 @@
bne 1001b bne 1001b
1002: 1002:
.endm .endm
#endif /* CONFIG_CPU_V6 */
#else #else
#include <asm/arch/debug-macro.S> #include <asm/arch/debug-macro.S>
#endif #endif /* CONFIG_DEBUG_ICEDCC */
/* /*
* Useful debugging routines * Useful debugging routines
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment