Andrew Victor | c53c9cf | 2007-05-11 21:01:28 +0100 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-arm/arch-ks8695/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 <asm/hardware.h> |
| 15 | #include <asm/arch/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 |