Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 1 | /* 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 Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 17 | |
| 18 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 19 | #include <mach/hardware.h> |
| 20 | #include <mach/msm_iomap.h> |
| 21 | |
Pavel Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 22 | #ifdef CONFIG_MSM_DEBUG_UART |
Tony Lindgren | 4e6d488 | 2010-02-01 23:26:53 +0100 | [diff] [blame] | 23 | .macro addruart, rx, tmp |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 24 | @ see if the MMU is enabled and select appropriate base address |
| 25 | mrc p15, 0, \rx, c1, c0 |
| 26 | tst \rx, #1 |
Pavel Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 27 | ldreq \rx, =MSM_DEBUG_UART_PHYS |
| 28 | ldrne \rx, =MSM_DEBUG_UART_BASE |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 29 | .endm |
| 30 | |
| 31 | .macro senduart,rd,rx |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 32 | teq \rx, #0 |
| 33 | strne \rd, [\rx, #0x0C] |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 34 | .endm |
| 35 | |
| 36 | .macro waituart,rd,rx |
| 37 | @ wait for TX_READY |
Pavel Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 38 | 1001: ldr \rd, [\rx, #0x08] |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 39 | tst \rd, #0x04 |
Pavel Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 40 | beq 1001b |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 41 | .endm |
Pavel Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 42 | #else |
Tony Lindgren | 4e6d488 | 2010-02-01 23:26:53 +0100 | [diff] [blame] | 43 | .macro addruart, rx, tmp |
Pavel Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 44 | .endm |
| 45 | |
| 46 | .macro senduart,rd,rx |
| 47 | .endm |
| 48 | |
| 49 | .macro waituart,rd,rx |
| 50 | .endm |
| 51 | #endif |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 52 | |
| 53 | .macro busyuart,rd,rx |
| 54 | .endm |