]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/asm-arm/arch-s3c2410/debug-macro.S
[ARM] 4511/1: S3C: updated LLSERIAL Kconfig defines for CPU support
[net-next-2.6.git] / include / asm-arm / arch-s3c2410 / debug-macro.S
CommitLineData
1da177e4
LT
1/* linux/include/asm-arm/arch-s3c2410/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Copyright (C) 2005 Simtec Electronics
7 *
8 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
9 *
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.
1da177e4
LT
13*/
14
15#include <asm/arch/map.h>
1da177e4
LT
16#include <asm/arch/regs-gpio.h>
17
498e03b6
BD
18#include <asm/plat-s3c/regs-serial.h>
19#include <asm/plat-s3c/debug-macro.S>
20
1da177e4
LT
21#define S3C2410_UART1_OFF (0x4000)
22#define SHIFT_2440TXF (14-9)
23
498e03b6 24 .macro addruart, rx
1da177e4
LT
25 mrc p15, 0, \rx, c1, c0
26 tst \rx, #1
0367a8d3 27 ldreq \rx, = S3C24XX_PA_UART
1da177e4
LT
28 ldrne \rx, = S3C24XX_VA_UART
29#if CONFIG_DEBUG_S3C2410_UART != 0
30 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART)
31#endif
498e03b6 32 .endm
1da177e4 33
498e03b6 34 .macro fifo_full rd, rx
68d9ab39
BD
35 @ check for arm920 vs arm926. currently assume all arm926
36 @ devices have an 64 byte FIFO identical to the s3c2440
37 mrc p15, 0, \rd, c0, c0
38 and \rd, \rd, #0xff0
39 teq \rd, #0x260
40 beq 1004f
1da177e4
LT
41 mrc p15, 0, \rd, c1, c0
42 tst \rd, #1
0367a8d3 43 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
1da177e4
LT
44 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
45 bic \rd, \rd, #0xff000
46 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
47 and \rd, \rd, #0x00ff0000
48 teq \rd, #0x00440000 @ is it 2440?
68d9ab39 491004:
1da177e4
LT
50 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
51 moveq \rd, \rd, lsr #SHIFT_2440TXF
52 tst \rd, #S3C2410_UFSTAT_TXFULL
498e03b6 53 .endm
1da177e4 54
498e03b6 55 .macro fifo_level rd, rx
1da177e4
LT
56 mrc p15, 0, \rd, c1, c0
57 tst \rd, #1
0367a8d3 58 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
1da177e4
LT
59 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
60 bic \rd, \rd, #0xff000
61 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
62 and \rd, \rd, #0x00ff0000
63 teq \rd, #0x00440000 @ is it 2440?
64
65 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
66 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
67 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
498e03b6 68 .endm