debug-macro.S 1.2 KB
Newer Older
1
/* arch/arm/mach-msm7200/include/mach/debug-macro.S
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 * Copyright (C) 2007 Google, Inc.
 * Author: Brian Swetland <swetland@google.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

17 18


19 20
#include <mach/hardware.h>
#include <mach/msm_iomap.h>
21

22
#ifdef CONFIG_HAS_MSM_DEBUG_UART_PHYS
23
	.macro	addruart, rx, tmp
24 25 26
	@ see if the MMU is enabled and select appropriate base address
	mrc	p15, 0, \rx, c1, c0
	tst	\rx, #1
27 28
	ldreq	\rx, =MSM_DEBUG_UART_PHYS
	ldrne	\rx, =MSM_DEBUG_UART_BASE
29 30 31
	.endm

	.macro	senduart,rd,rx
32 33
	teq	\rx, #0
	strne	\rd, [\rx, #0x0C]
34 35 36 37
	.endm

	.macro	waituart,rd,rx
	@ wait for TX_READY
38
1001:	ldr	\rd, [\rx, #0x08]
39
	tst	\rd, #0x04
40 41 42
	beq	1001b
	.endm
#else
43
	.macro	addruart, rx, tmp
44 45 46 47 48 49
	.endm

	.macro	senduart,rd,rx
	.endm

	.macro	waituart,rd,rx
50
	.endm
51
#endif
52 53 54

	.macro	busyuart,rd,rx
	.endm