xref: /linux/arch/arm/include/debug/icedcc.S (revision bb9707077b4ee5f77bc9939b057ff8a0d410296f)
1/*
2 *  arch/arm/include/debug/icedcc.S
3 *
4 *  Copyright (C) 1994-1999 Russell King
5 *
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.
9 *
10 */
11
12		@@ debug using ARM EmbeddedICE DCC channel
13
14		.macro	addruart, rp, rv, tmp
15		.endm
16
17#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
18
19		.macro	senduart, rd, rx
20		mcr	p14, 0, \rd, c0, c5, 0
21		.endm
22
23		.macro	busyuart, rd, rx
241001:
25		mrc	p14, 0, \rx, c0, c1, 0
26		tst	\rx, #0x20000000
27		beq	1001b
28		.endm
29
30		.macro	waituart, rd, rx
31		mov	\rd, #0x2000000
321001:
33		subs	\rd, \rd, #1
34		bmi	1002f
35		mrc	p14, 0, \rx, c0, c1, 0
36		tst	\rx, #0x20000000
37		bne	1001b
381002:
39		.endm
40
41#elif defined(CONFIG_CPU_XSCALE)
42
43		.macro	senduart, rd, rx
44		mcr	p14, 0, \rd, c8, c0, 0
45		.endm
46
47		.macro	busyuart, rd, rx
481001:
49		mrc	p14, 0, \rx, c14, c0, 0
50		tst	\rx, #0x10000000
51		beq	1001b
52		.endm
53
54		.macro	waituart, rd, rx
55		mov	\rd, #0x10000000
561001:
57		subs	\rd, \rd, #1
58		bmi	1002f
59		mrc	p14, 0, \rx, c14, c0, 0
60		tst	\rx, #0x10000000
61		bne	1001b
621002:
63		.endm
64
65#else
66
67		.macro	senduart, rd, rx
68		mcr	p14, 0, \rd, c1, c0, 0
69		.endm
70
71		.macro	busyuart, rd, rx
721001:
73		mrc	p14, 0, \rx, c0, c0, 0
74		tst	\rx, #2
75		beq	1001b
76
77		.endm
78
79		.macro	waituart, rd, rx
80		mov	\rd, #0x2000000
811001:
82		subs	\rd, \rd, #1
83		bmi	1002f
84		mrc	p14, 0, \rx, c0, c0, 0
85		tst	\rx, #2
86		bne	1001b
871002:
88		.endm
89
90#endif	/* CONFIG_CPU_V6 */
91