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.
15 #include <asm/arch/map.h>
16 #include <asm/arch/regs-serial.h>
17 #include <asm/arch/regs-gpio.h>
19 #define S3C2410_UART1_OFF (0x4000)
20 #define SHIFT_2440TXF (14-9)
23 mrc p15, 0, \rx, c1, c0
25 ldreq \rx, = S3C24XX_PA_UART
26 ldrne \rx, = S3C24XX_VA_UART
27 #if CONFIG_DEBUG_S3C2410_UART != 0
28 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART)
33 strb \rd, [\rx, # S3C2410_UTXH ]
36 .macro busyuart, rd, rx
37 ldr \rd, [ \rx, # S3C2410_UFCON ]
38 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
42 @ check for arm920 vs arm926. currently assume all arm926
43 @ devices have an 64 byte FIFO identical to the s3c2440
44 mrc p15, 0, \rd, c0, c0
48 mrc p15, 0, \rd, c1, c0
50 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
51 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
52 bic \rd, \rd, #0xff000
53 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
54 and \rd, \rd, #0x00ff0000
55 teq \rd, #0x00440000 @ is it 2440?
57 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
58 moveq \rd, \rd, lsr #SHIFT_2440TXF
59 tst \rd, #S3C2410_UFSTAT_TXFULL
64 @ busy waiting for non fifo
65 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
66 tst \rd, #S3C2410_UTRSTAT_TXFE
74 ldr \rd, [ \rx, # S3C2410_UFCON ]
75 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
79 mrc p15, 0, \rd, c1, c0
81 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
82 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
83 bic \rd, \rd, #0xff000
84 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
85 and \rd, \rd, #0x00ff0000
86 teq \rd, #0x00440000 @ is it 2440?
88 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
89 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
90 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
96 @ idle waiting for non fifo
97 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
98 tst \rd, #S3C2410_UTRSTAT_TXFE
101 1002: @ exit busyuart