Commit | Line | Data |
---|---|---|
4d31e664 | 1 | /* |
bb6d8c88 SH |
2 | * Debugging macro include header |
3 | * | |
4 | * Copyright (C) 1994-1999 Russell King | |
5 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | |
6 | * | |
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. | |
10 | * | |
11 | */ | |
12 | ||
4d31e664 DT |
13 | #define UART_DATA 0 |
14 | #define UART_FLAG 0x18 | |
15 | #define UART_FLAG_BUSY (1 << 3) | |
bb6d8c88 | 16 | |
639da5ee | 17 | .macro addruart, rp, rv, tmp |
4d31e664 DT |
18 | ldr \rp, =CONFIG_DEBUG_UART_PHYS |
19 | ldr \rv, =CONFIG_DEBUG_UART_VIRT | |
bb6d8c88 SH |
20 | .endm |
21 | ||
22 | .macro senduart,rd,rx | |
4d31e664 | 23 | str \rd, [\rx, #UART_DATA] |
bb6d8c88 SH |
24 | .endm |
25 | ||
26 | .macro busyuart,rd,rx | |
4d31e664 DT |
27 | 1002: ldr \rd, [\rx, #UART_FLAG] |
28 | tst \rd, #UART_FLAG_BUSY | |
bb6d8c88 SH |
29 | bne 1002b |
30 | .endm | |
31 | ||
32 | .macro waituart,rd,rx | |
4d31e664 DT |
33 | 1001: ldr \rd, [\rx, #UART_FLAG] |
34 | tst \rd, #UART_FLAG_BUSY | |
bb6d8c88 SH |
35 | bne 1001b |
36 | .endm |