1 /* Modified by Broadcom Corp. Portions Copyright (c) Broadcom Corp, 2012. */
3 * linux/arch/arm/kernel/debug.S
5 * Copyright (C) 1994-1999 Russell King
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * 32-bit debugging code
13 #include <linux/linkage.h>
14 #include <asm/memory.h>
19 * Some debugging routines (useful if you've got MM problems and
20 * printk isn't working). For DEBUGGING ONLY!!! Do not leave
21 * references to these in a production kernel!
24 #if defined(CONFIG_DEBUG_ICEDCC)
25 @@ debug using ARM EmbeddedICE DCC channel
27 #if defined(CONFIG_CPU_V6)
29 .macro addruart, rx, tmp
32 .macro senduart, rd, rx
33 mcr p14, 0, \rd, c0, c5, 0
36 .macro busyuart, rd, rx
38 mrc p14, 0, \rx, c0, c1, 0
43 .macro waituart, rd, rx
48 mrc p14, 0, \rx, c0, c1, 0
54 #elif defined(CONFIG_CPU_V7)
56 .macro addruart, rx, tmp
59 .macro senduart, rd, rx
60 mcr p14, 0, \rd, c0, c5, 0
63 .macro busyuart, rd, rx
64 busy: mrc p14, 0, pc, c0, c1, 0
68 .macro waituart, rd, rx
69 wait: mrc p14, 0, pc, c0, c1, 0
74 #elif defined(CONFIG_CPU_XSCALE)
76 .macro addruart, rx, tmp
79 .macro senduart, rd, rx
80 mcr p14, 0, \rd, c8, c0, 0
83 .macro busyuart, rd, rx
85 mrc p14, 0, \rx, c14, c0, 0
90 .macro waituart, rd, rx
95 mrc p14, 0, \rx, c14, c0, 0
103 .macro addruart, rx, tmp
106 .macro senduart, rd, rx
107 mcr p14, 0, \rd, c1, c0, 0
110 .macro busyuart, rd, rx
112 mrc p14, 0, \rx, c0, c0, 0
118 .macro waituart, rd, rx
123 mrc p14, 0, \rx, c0, c0, 0
129 #endif /* CONFIG_CPU_V6 */
132 #include <mach/debug-macro.S>
133 #endif /* CONFIG_DEBUG_ICEDCC */
136 * Useful debugging routines
151 mrc p15, 0, r2, c1, c0 @ read SysCtrl
152 tst r2, #1 @ MMU enabled?
153 ldrne r2, =hexbuf @ =1 virtual
154 ldreq r2, =__virt_to_phys(hexbuf) @ =0 physical
162 addge r1, r1, #'a' - 10