1 /* linux/include/asm-arm/arch-s3c2410/debug-macro.S
3 * Debugging macro include header
5 * Copyright (C) 1994-1999 Russell King
6 * Copyright (C) 2005 Simtec Electronics
8 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
16 #include <asm/arch/map.h>
17 #include <asm/arch/regs-serial.h>
18 #include <asm/arch/regs-gpio.h>
20 #define S3C2410_UART1_OFF (0x4000)
21 #define SHIFT_2440TXF (14-9)
24 mrc p15, 0, \rx, c1, c0
26 ldreq \rx, = S3C2410_PA_UART
27 ldrne \rx, = S3C2410_VA_UART
28 #if CONFIG_DEBUG_S3C2410_UART != 0
29 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART)
34 str \rd, [\rx, # S3C2410_UTXH ]
37 .macro busyuart, rd, rx
38 ldr \rd, [ \rx, # S3C2410_UFCON ]
39 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
43 mrc p15, 0, \rd, c1, c0
45 addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART)
46 addne \rd, \rx, #(S3C2410_VA_GPIO - S3C2410_VA_UART)
47 bic \rd, \rd, #0xff000
48 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
49 and \rd, \rd, #0x00ff0000
50 teq \rd, #0x00440000 @ is it 2440?
52 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
53 moveq \rd, \rd, lsr #SHIFT_2440TXF
54 tst \rd, #S3C2410_UFSTAT_TXFULL
59 @ busy waiting for non fifo
60 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
61 tst \rd, #S3C2410_UTRSTAT_TXFE
69 ldr \rd, [ \rx, # S3C2410_UFCON ]
70 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
74 mrc p15, 0, \rd, c1, c0
76 addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART)
77 addne \rd, \rx, #(S3C2410_VA_GPIO - S3C2410_VA_UART)
78 bic \rd, \rd, #0xff000
79 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
80 and \rd, \rd, #0x00ff0000
81 teq \rd, #0x00440000 @ is it 2440?
83 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
84 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
85 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
91 @ idle waiting for non fifo
92 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
93 tst \rd, #S3C2410_UTRSTAT_TXFE