Merge branch 'x86/pebs' into x86/unify-cpu-detect
[linux-2.6] / arch / arm / mach-ks8695 / include / mach / debug-macro.S
1 /*
2  * arch/arm/mach-ks8695/include/mach/debug-macro.S
3  *
4  * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
5  * Copyright (C) 2006 Simtec Electronics
6  *
7  * KS8695 - Debug macros
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  */
13
14 #include <mach/hardware.h>
15 #include <mach/regs-uart.h>
16
17         .macro  addruart, rx
18                 mrc     p15, 0, \rx, c1, c0
19                 tst     \rx, #1                         @ MMU enabled?
20                 ldreq   \rx, =KS8695_UART_PA            @ physical base address
21                 ldrne   \rx, =KS8695_UART_VA            @ virtual base address
22         .endm
23
24         .macro  senduart, rd, rx
25                 str     \rd, [\rx, #KS8695_URTH]        @ Write to Transmit Holding Register
26         .endm
27
28         .macro  busyuart, rd, rx
29 1001:           ldr     \rd, [\rx, #KS8695_URLS]        @ Read Line Status Register
30                 tst     \rd, #URLS_URTE                 @ Holding & Shift registers empty?
31                 beq     1001b
32         .endm
33
34         .macro  waituart, rd, rx
35 1001:           ldr     \rd, [\rx, #KS8695_URLS]        @ Read Line Status Register
36                 tst     \rd, #URLS_URTHRE               @ Holding Register empty?
37                 beq     1001b
38         .endm