blob: 1b9348bf0e4926b542bea6d1bfcc4a9cd2e29440 [file] [log] [blame]
dmitry pervushine3178722009-04-22 23:55:23 +01001/*
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 Lindgren4e6d4882010-02-01 23:26:53 +010019 .macro addruart, rx, tmp
dmitry pervushine3178722009-04-22 23:55:23 +010020 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
331001: 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
391001: ldr \rd, [\rx, #0x18] @ UARTFLG
40 tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
41 bne 1001b
42 .endm