2 * linux/arch/arm/kernel/debug-armv.S
4 * Copyright (C) 1994-1999 Russell King
6 * 32-bit debugging code
8 #include <linux/config.h>
9 #include <linux/linkage.h>
10 #include <asm/hardware.h>
11 #include <asm/dec21285.h>
16 * Some debugging routines (useful if you've got MM problems and
17 * printk isn't working). For DEBUGGING ONLY!!! Do not leave
18 * references to these in a production kernel!
20 #if defined(CONFIG_ARCH_RPC)
23 orr \rx, \rx, #0x00010000
24 orr \rx, \rx, #0x00000fe0
32 1002: ldrb \rd, [\rx, #0x14]
39 1001: ldrb \rd, [\rx, #0x18]
44 #elif defined(CONFIG_ARCH_EBSA110)
47 orr \rx, \rx, #0x00000be0
55 1002: ldrb \rd, [\rx, #0x14]
62 1001: ldrb \rd, [\rx, #0x18]
67 #elif defined(CONFIG_HOST_FOOTBRIDGE) || defined(CONFIG_ADDIN_FOOTBRIDGE)
68 #ifndef CONFIG_DEBUG_DC21285_PORT
69 /* For NetWinder debugging */
72 orr \rx, \rx, #0x000003f8
80 1002: ldrb \rd, [\rx, #0x5]
87 1001: ldrb \rd, [\rx, #0x6]
92 /* For EBSA285 debugging */
93 .equ dc21285_high, ARMCSR_BASE & 0xff000000
94 .equ dc21285_low, ARMCSR_BASE & 0x00ffffff
97 mov \rx, #dc21285_high
99 orr \rx, \rx, #dc21285_low
103 .macro senduart,rd,rx
104 str \rd, [\rx, #0x160] @ UARTDR
107 .macro busyuart,rd,rx
108 1001: ldr \rd, [\rx, #0x178] @ UARTFLG
113 .macro waituart,rd,rx
116 #elif defined(CONFIG_ARCH_NEXUSPCI)
121 .macro senduart,rd,rx
125 .macro busyuart,rd,rx
126 1001: ldr \rd, [\rx, #0x4]
131 .macro waituart,rd,rx
134 #elif defined(CONFIG_ARCH_SA1100)
137 add \rx, \rx, #0x00050000 @ Ser3
138 @add \rx, \rx, #0x00010000 @ Ser1
141 .macro senduart,rd,rx
142 str \rd, [\rx, #0x14] @ UTDR
145 .macro waituart,rd,rx
146 1001: ldr \rd, [\rx, #0x20] @ UTSR1
147 tst \rd, #1 << 2 @ UTSR1_TNF
151 .macro busyuart,rd,rx
152 1001: ldr \rd, [\rx, #0x20] @ UTSR1
153 tst \rd, #1 << 0 @ UTSR1_TBY
158 #error Unknown architecture
162 * Useful debugging routines
174 printhex: ldr r2, =hexbuf
182 addge r1, r1, #'a' - 10