Ben Dooks | 498e03b | 2007-07-22 16:08:48 +0100 | [diff] [blame^] | 1 | /* linux/include/asm-arm/plat-s3c/debug-macro.S |
| 2 | * |
| 3 | * Copyright 2005, 2007 Simtec Electronics |
| 4 | * http://armlinux.simtec.co.uk/ |
| 5 | * Ben Dooks <ben@simtec.co.uk> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | */ |
| 11 | |
| 12 | #include <asm/plat-s3c/regs-serial.h> |
| 13 | |
| 14 | #define S3C2410_UART1_OFF (0x4000) |
| 15 | |
| 16 | .macro senduart,rd,rx |
| 17 | strb \rd, [\rx, # S3C2410_UTXH ] |
| 18 | .endm |
| 19 | |
| 20 | .macro busyuart, rd, rx |
| 21 | ldr \rd, [ \rx, # S3C2410_UFCON ] |
| 22 | tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? |
| 23 | beq 1001f @ |
| 24 | @ FIFO enabled... |
| 25 | 1003: |
| 26 | fifo_full \rd, \rx |
| 27 | bne 1003b |
| 28 | b 1002f |
| 29 | |
| 30 | 1001: |
| 31 | @ busy waiting for non fifo |
| 32 | ldr \rd, [ \rx, # S3C2410_UTRSTAT ] |
| 33 | tst \rd, #S3C2410_UTRSTAT_TXFE |
| 34 | beq 1001b |
| 35 | |
| 36 | 1002: @ exit busyuart |
| 37 | .endm |
| 38 | |
| 39 | .macro waituart,rd,rx |
| 40 | |
| 41 | ldr \rd, [ \rx, # S3C2410_UFCON ] |
| 42 | tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? |
| 43 | beq 1001f @ |
| 44 | @ FIFO enabled... |
| 45 | 1003: |
| 46 | fifo_level \rd, \rx |
| 47 | teq \rd, #0 |
| 48 | bne 1003b |
| 49 | b 1002f |
| 50 | 1001: |
| 51 | @ idle waiting for non fifo |
| 52 | ldr \rd, [ \rx, # S3C2410_UTRSTAT ] |
| 53 | tst \rd, #S3C2410_UTRSTAT_TXFE |
| 54 | beq 1001b |
| 55 | |
| 56 | 1002: @ exit busyuart |
| 57 | .endm |