dmitry pervushin | e317872 | 2009-04-22 23:55:23 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Debugging macro include header |
| 3 | * |
| 4 | * Embedded Alley Solutions, Inc <source@embeddedalley.com> |
| 5 | * |
| 6 | * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. |
| 7 | * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. |
| 8 | */ |
| 9 | |
| 10 | /* |
| 11 | * The code contained herein is licensed under the GNU General Public |
| 12 | * License. You may obtain a copy of the GNU General Public License |
| 13 | * Version 2 or later at the following locations: |
| 14 | * |
| 15 | * http://www.opensource.org/licenses/gpl-license.html |
| 16 | * http://www.gnu.org/copyleft/gpl.html |
| 17 | */ |
| 18 | |
Tony Lindgren | 4e6d488 | 2010-02-01 23:26:53 +0100 | [diff] [blame] | 19 | .macro addruart, rx, tmp |
dmitry pervushin | e317872 | 2009-04-22 23:55:23 +0100 | [diff] [blame] | 20 | mrc p15, 0, \rx, c1, c0 |
| 21 | tst \rx, #1 @ MMU enabled? |
| 22 | moveq \rx, #0x80000000 @ physical base address |
| 23 | addeq \rx, \rx, #0x00070000 |
| 24 | movne \rx, #0xf0000000 @ virtual base |
| 25 | addne \rx, \rx, #0x00070000 |
| 26 | .endm |
| 27 | |
| 28 | .macro senduart,rd,rx |
| 29 | strb \rd, [\rx, #0] @ data register at 0 |
| 30 | .endm |
| 31 | |
| 32 | .macro waituart,rd,rx |
| 33 | 1001: ldr \rd, [\rx, #0x18] @ UARTFLG |
| 34 | tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full |
| 35 | bne 1001b |
| 36 | .endm |
| 37 | |
| 38 | .macro busyuart,rd,rx |
| 39 | 1001: ldr \rd, [\rx, #0x18] @ UARTFLG |
| 40 | tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy |
| 41 | bne 1001b |
| 42 | .endm |