blob: 528750f307e9428433c97101153be1933d495ba8 [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/* arch/arm/mach-msm7200/include/mach/debug-macro.S
2 *
3 * Copyright (C) 2007 Google, Inc.
4 * Author: Brian Swetland <swetland@google.com>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
Pavel Machek6339f662009-11-02 11:48:29 +010017
18
Russell Kinga09e64f2008-08-05 16:14:15 +010019#include <mach/hardware.h>
20#include <mach/msm_iomap.h>
21
Pavel Machek6339f662009-11-02 11:48:29 +010022#ifdef CONFIG_MSM_DEBUG_UART
Tony Lindgren4e6d4882010-02-01 23:26:53 +010023 .macro addruart, rx, tmp
Russell Kinga09e64f2008-08-05 16:14:15 +010024 @ see if the MMU is enabled and select appropriate base address
25 mrc p15, 0, \rx, c1, c0
26 tst \rx, #1
Pavel Machek6339f662009-11-02 11:48:29 +010027 ldreq \rx, =MSM_DEBUG_UART_PHYS
28 ldrne \rx, =MSM_DEBUG_UART_BASE
Russell Kinga09e64f2008-08-05 16:14:15 +010029 .endm
30
31 .macro senduart,rd,rx
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070032 teq \rx, #0
33 strne \rd, [\rx, #0x0C]
Russell Kinga09e64f2008-08-05 16:14:15 +010034 .endm
35
36 .macro waituart,rd,rx
37 @ wait for TX_READY
Pavel Machek6339f662009-11-02 11:48:29 +0100381001: ldr \rd, [\rx, #0x08]
Russell Kinga09e64f2008-08-05 16:14:15 +010039 tst \rd, #0x04
Pavel Machek6339f662009-11-02 11:48:29 +010040 beq 1001b
Russell Kinga09e64f2008-08-05 16:14:15 +010041 .endm
Pavel Machek6339f662009-11-02 11:48:29 +010042#else
Tony Lindgren4e6d4882010-02-01 23:26:53 +010043 .macro addruart, rx, tmp
Pavel Machek6339f662009-11-02 11:48:29 +010044 .endm
45
46 .macro senduart,rd,rx
47 .endm
48
49 .macro waituart,rd,rx
50 .endm
51#endif
Russell Kinga09e64f2008-08-05 16:14:15 +010052
53 .macro busyuart,rd,rx
54 .endm