blob: 81e1b2af70f7ba1d0c63fdecf22d69ee01596762 [file] [log] [blame]
Daniel Thompson4d31e662015-01-09 18:34:03 +01001/*
Russell Kinga09e64f2008-08-05 16:14:15 +01002 * 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
Daniel Thompson4d31e662015-01-09 18:34:03 +010013#define UART_DATA 0
14#define UART_FLAG 0x18
15#define UART_FLAG_BUSY (1 << 3)
Russell Kinga09e64f2008-08-05 16:14:15 +010016
Nicolas Pitre639da5e2011-08-31 22:55:46 -040017 .macro addruart, rp, rv, tmp
Daniel Thompson4d31e662015-01-09 18:34:03 +010018 ldr \rp, =CONFIG_DEBUG_UART_PHYS
19 ldr \rv, =CONFIG_DEBUG_UART_VIRT
Russell Kinga09e64f2008-08-05 16:14:15 +010020 .endm
21
22 .macro senduart,rd,rx
Daniel Thompson4d31e662015-01-09 18:34:03 +010023 str \rd, [\rx, #UART_DATA]
Russell Kinga09e64f2008-08-05 16:14:15 +010024 .endm
25
26 .macro busyuart,rd,rx
Daniel Thompson4d31e662015-01-09 18:34:03 +0100271002: ldr \rd, [\rx, #UART_FLAG]
28 tst \rd, #UART_FLAG_BUSY
Russell Kinga09e64f2008-08-05 16:14:15 +010029 bne 1002b
30 .endm
31
32 .macro waituart,rd,rx
Daniel Thompson4d31e662015-01-09 18:34:03 +0100331001: ldr \rd, [\rx, #UART_FLAG]
34 tst \rd, #UART_FLAG_BUSY
Russell Kinga09e64f2008-08-05 16:14:15 +010035 bne 1001b
36 .endm