Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 1 | /* arch/arm/mach-imx/include/mach/debug-macro.S |
| 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 | |
Sascha Hauer | ccc1a6f | 2009-06-04 13:45:37 +0200 | [diff] [blame] | 14 | #ifdef CONFIG_ARCH_MX1 |
| 15 | #include <mach/mx1.h> |
| 16 | #define UART_PADDR UART1_BASE_ADDR |
| 17 | #define UART_VADDR IO_ADDRESS(UART1_BASE_ADDR) |
| 18 | #endif |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 19 | |
Sascha Hauer | 8c25c36 | 2009-06-04 11:32:12 +0200 | [diff] [blame] | 20 | #ifdef CONFIG_ARCH_MX25 |
| 21 | #ifdef UART_PADDR |
| 22 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" |
| 23 | #endif |
| 24 | #include <mach/mx25.h> |
| 25 | #define UART_PADDR UART1_BASE_ADDR |
| 26 | #define UART_VADDR MX25_AIPS1_IO_ADDRESS(UART1_BASE_ADDR) |
| 27 | #endif |
| 28 | |
Sascha Hauer | ccc1a6f | 2009-06-04 13:45:37 +0200 | [diff] [blame] | 29 | #ifdef CONFIG_ARCH_MX2 |
| 30 | #ifdef UART_PADDR |
| 31 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 32 | #endif |
Sascha Hauer | ccc1a6f | 2009-06-04 13:45:37 +0200 | [diff] [blame] | 33 | #include <mach/mx2x.h> |
| 34 | #define UART_PADDR UART1_BASE_ADDR |
| 35 | #define UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 36 | #endif |
Sascha Hauer | ccc1a6f | 2009-06-04 13:45:37 +0200 | [diff] [blame] | 37 | |
| 38 | #ifdef CONFIG_ARCH_MX3 |
| 39 | #ifdef UART_PADDR |
| 40 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 41 | #endif |
Sascha Hauer | ccc1a6f | 2009-06-04 13:45:37 +0200 | [diff] [blame] | 42 | #include <mach/mx3x.h> |
| 43 | #define UART_PADDR UART1_BASE_ADDR |
| 44 | #define UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 45 | #endif |
Sascha Hauer | ccc1a6f | 2009-06-04 13:45:37 +0200 | [diff] [blame] | 46 | |
Dmitriy Taychenachev | fd6ac7b | 2009-07-31 20:29:22 +0900 | [diff] [blame] | 47 | #ifdef CONFIG_ARCH_MXC91231 |
| 48 | #ifdef UART_PADDR |
| 49 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" |
| 50 | #endif |
| 51 | #include <mach/mxc91231.h> |
| 52 | #define UART_PADDR MXC91231_UART2_BASE_ADDR |
| 53 | #define UART_VADDR MXC91231_AIPS1_IO_ADDRESS(MXC91231_UART2_BASE_ADDR) |
| 54 | #endif |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 55 | .macro addruart,rx |
| 56 | mrc p15, 0, \rx, c1, c0 |
| 57 | tst \rx, #1 @ MMU enabled? |
Sascha Hauer | ccc1a6f | 2009-06-04 13:45:37 +0200 | [diff] [blame] | 58 | ldreq \rx, =UART_PADDR @ physical |
| 59 | ldrne \rx, =UART_VADDR @ virtual |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 60 | .endm |
| 61 | |
| 62 | .macro senduart,rd,rx |
| 63 | str \rd, [\rx, #0x40] @ TXDATA |
| 64 | .endm |
| 65 | |
| 66 | .macro waituart,rd,rx |
| 67 | .endm |
| 68 | |
| 69 | .macro busyuart,rd,rx |
| 70 | 1002: ldr \rd, [\rx, #0x98] @ SR2 |
| 71 | tst \rd, #1 << 3 @ TXDC |
| 72 | beq 1002b @ wait until transmit done |
| 73 | .endm |