blob: 75b05ad0fbad4d6e2b259ceaa59730bab611f71f [file] [log] [blame]
viresh kumarbf976b52010-04-01 12:30:42 +01001/*
2 * arch/arm/plat-spear/include/plat/debug-macro.S
3 *
4 * Debugging macro include header for spear platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
Viresh Kumar10d89352012-06-20 12:53:02 -07007 * Viresh Kumar <viresh.linux@gmail.com>
viresh kumarbf976b52010-04-01 12:30:42 +01008 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/amba/serial.h>
Arnd Bergmann5019f0b2012-04-11 17:30:11 +000015#include <mach/spear.h>
viresh kumarbf976b52010-04-01 12:30:42 +010016
Nicolas Pitre639da5e2011-08-31 22:55:46 -040017 .macro addruart, rp, rv, tmp
Jeremy Kerr0ea12932010-07-06 18:30:06 +080018 mov \rp, #SPEAR_DBG_UART_BASE @ Physical base
19 mov \rv, #VA_SPEAR_DBG_UART_BASE @ Virtual base
viresh kumarbf976b52010-04-01 12:30:42 +010020 .endm
21
22 .macro senduart, rd, rx
23 strb \rd, [\rx, #UART01x_DR] @ ASC_TX_BUFFER
24 .endm
25
26 .macro waituart, rd, rx
271001: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
28 tst \rd, #UART01x_FR_TXFF @ TX_FULL
29 bne 1001b
30 .endm
31
32 .macro busyuart, rd, rx
331002: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
34 tst \rd, #UART011_FR_TXFE @ TX_EMPTY
35 beq 1002b
36 .endm