Tony Lindgren | aca59b8 | 2009-10-19 17:26:17 -0700 | [diff] [blame] | 1 | /* arch/arm/mach-omap2/include/mach/debug-macro.S |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 2 | * |
| 3 | * Debugging macro include header |
| 4 | * |
| 5 | * Copyright (C) 1994-1999 Russell King |
| 6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | * |
| 12 | */ |
| 13 | |
Tony Lindgren | 4f2c49f | 2010-02-15 08:48:53 -0800 | [diff] [blame^] | 14 | #include <linux/serial_reg.h> |
| 15 | |
| 16 | #include <plat/serial.h> |
| 17 | |
Tony Lindgren | 4e6d488 | 2010-02-01 23:26:53 +0100 | [diff] [blame] | 18 | .macro addruart, rx, tmp |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 19 | mrc p15, 0, \rx, c1, c0 |
| 20 | tst \rx, #1 @ MMU enabled? |
Tony Lindgren | aca59b8 | 2009-10-19 17:26:17 -0700 | [diff] [blame] | 21 | #ifdef CONFIG_ARCH_OMAP2 |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 22 | moveq \rx, #0x48000000 @ physical base address |
Santosh Shilimkar | b4224b2 | 2009-10-19 17:25:55 -0700 | [diff] [blame] | 23 | movne \rx, #0xfa000000 @ virtual base |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 24 | orr \rx, \rx, #0x0006a000 |
| 25 | #ifdef CONFIG_OMAP_LL_DEBUG_UART2 |
| 26 | add \rx, \rx, #0x00002000 @ UART 2 |
| 27 | #endif |
| 28 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 |
| 29 | add \rx, \rx, #0x00004000 @ UART 3 |
| 30 | #endif |
Syed Mohammed, Khasim | cc26b3b | 2008-10-09 17:51:41 +0300 | [diff] [blame] | 31 | |
Santosh Shilimkar | 4416907 | 2009-05-28 14:16:04 -0700 | [diff] [blame] | 32 | #elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
Syed Mohammed, Khasim | cc26b3b | 2008-10-09 17:51:41 +0300 | [diff] [blame] | 33 | moveq \rx, #0x48000000 @ physical base address |
Santosh Shilimkar | b4224b2 | 2009-10-19 17:25:55 -0700 | [diff] [blame] | 34 | movne \rx, #0xfa000000 @ virtual base |
Syed Mohammed, Khasim | cc26b3b | 2008-10-09 17:51:41 +0300 | [diff] [blame] | 35 | orr \rx, \rx, #0x0006a000 |
| 36 | #ifdef CONFIG_OMAP_LL_DEBUG_UART2 |
| 37 | add \rx, \rx, #0x00002000 @ UART 2 |
| 38 | #endif |
| 39 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 |
| 40 | add \rx, \rx, #0x00fb0000 @ UART 3 |
| 41 | add \rx, \rx, #0x00006000 |
| 42 | #endif |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 43 | #endif |
| 44 | .endm |
| 45 | |
| 46 | .macro senduart,rd,rx |
| 47 | strb \rd, [\rx] |
| 48 | .endm |
| 49 | |
| 50 | .macro busyuart,rd,rx |
Tony Lindgren | 4f2c49f | 2010-02-15 08:48:53 -0800 | [diff] [blame^] | 51 | 1001: ldrb \rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)] |
| 52 | and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE) |
| 53 | teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 54 | bne 1001b |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 55 | .endm |
| 56 | |
| 57 | .macro waituart,rd,rx |
| 58 | .endm |