2 * linux/arch/arm/kernel/debug.S
4 * Copyright (C) 1994-1999 Russell King
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.
10 * 32-bit debugging code
12 #include <linux/linkage.h>
17 * Some debugging routines (useful if you've got MM problems and
18 * printk isn't working). For DEBUGGING ONLY!!! Do not leave
19 * references to these in a production kernel!
22 #if defined(CONFIG_DEBUG_ICEDCC)
23 @@ debug using ARM EmbeddedICE DCC channel
25 .macro addruart, rp, rv
28 #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
30 .macro senduart, rd, rx
31 mcr p14, 0, \rd, c0, c5, 0
34 .macro busyuart, rd, rx
36 mrc p14, 0, \rx, c0, c1, 0
41 .macro waituart, rd, rx
46 mrc p14, 0, \rx, c0, c1, 0
52 #elif defined(CONFIG_CPU_V7)
54 .macro senduart, rd, rx
55 mcr p14, 0, \rd, c0, c5, 0
58 .macro busyuart, rd, rx
59 busy: mrc p14, 0, pc, c0, c1, 0
63 .macro waituart, rd, rx
64 wait: mrc p14, 0, pc, c0, c1, 0
69 #elif defined(CONFIG_CPU_XSCALE)
71 .macro senduart, rd, rx
72 mcr p14, 0, \rd, c8, c0, 0
75 .macro busyuart, rd, rx
77 mrc p14, 0, \rx, c14, c0, 0
82 .macro waituart, rd, rx
87 mrc p14, 0, \rx, c14, c0, 0
95 .macro senduart, rd, rx
96 mcr p14, 0, \rd, c1, c0, 0
99 .macro busyuart, rd, rx
101 mrc p14, 0, \rx, c0, c0, 0
107 .macro waituart, rd, rx
112 mrc p14, 0, \rx, c0, c0, 0
118 #endif /* CONFIG_CPU_V6 */
121 #include <mach/debug-macro.S>
122 #endif /* CONFIG_DEBUG_ICEDCC */
125 .macro addruart_current, rx, tmp1, tmp2
126 addruart \tmp1, \tmp2
127 mrc p15, 0, \rx, c1, c0
133 #else /* !CONFIG_MMU */
134 .macro addruart_current, rx, tmp1, tmp2
138 #endif /* CONFIG_MMU */
141 * Useful debugging routines
155 printhex: adr r2, hexbuf
163 addge r1, r1, #'a' - 10
174 addruart_current r3, r1, r2
190 addruart_current r3, r1, r2