diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-arm/arch-s3c2410/debug-macro.S |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-arm/arch-s3c2410/debug-macro.S')
-rw-r--r-- | include/asm-arm/arch-s3c2410/debug-macro.S | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S new file mode 100644 index 000000000000..abfbe45cd17c --- /dev/null +++ b/include/asm-arm/arch-s3c2410/debug-macro.S | |||
@@ -0,0 +1,99 @@ | |||
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. | ||
13 | * | ||
14 | * Modifications: | ||
15 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA | ||
16 | */ | ||
17 | |||
18 | #include <asm/arch/map.h> | ||
19 | #include <asm/arch/regs-serial.h> | ||
20 | #include <asm/arch/regs-gpio.h> | ||
21 | |||
22 | #define S3C2410_UART1_OFF (0x4000) | ||
23 | #define SHIFT_2440TXF (14-9) | ||
24 | |||
25 | .macro addruart, rx | ||
26 | mrc p15, 0, \rx, c1, c0 | ||
27 | tst \rx, #1 | ||
28 | ldreq \rx, = S3C2410_PA_UART | ||
29 | ldrne \rx, = S3C24XX_VA_UART | ||
30 | #if CONFIG_DEBUG_S3C2410_UART != 0 | ||
31 | add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) | ||
32 | #endif | ||
33 | .endm | ||
34 | |||
35 | .macro senduart,rd,rx | ||
36 | str \rd, [\rx, # S3C2410_UTXH ] | ||
37 | .endm | ||
38 | |||
39 | .macro busyuart, rd, rx | ||
40 | ldr \rd, [ \rx, # S3C2410_UFCON ] | ||
41 | tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? | ||
42 | beq 1001f @ | ||
43 | @ FIFO enabled... | ||
44 | 1003: | ||
45 | mrc p15, 0, \rd, c1, c0 | ||
46 | tst \rd, #1 | ||
47 | addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) | ||
48 | addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) | ||
49 | bic \rd, \rd, #0xff000 | ||
50 | ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] | ||
51 | and \rd, \rd, #0x00ff0000 | ||
52 | teq \rd, #0x00440000 @ is it 2440? | ||
53 | |||
54 | ldr \rd, [ \rx, # S3C2410_UFSTAT ] | ||
55 | moveq \rd, \rd, lsr #SHIFT_2440TXF | ||
56 | tst \rd, #S3C2410_UFSTAT_TXFULL | ||
57 | bne 1003b | ||
58 | b 1002f | ||
59 | |||
60 | 1001: | ||
61 | @ busy waiting for non fifo | ||
62 | ldr \rd, [ \rx, # S3C2410_UTRSTAT ] | ||
63 | tst \rd, #S3C2410_UTRSTAT_TXFE | ||
64 | beq 1001b | ||
65 | |||
66 | 1002: @ exit busyuart | ||
67 | .endm | ||
68 | |||
69 | .macro waituart,rd,rx | ||
70 | |||
71 | ldr \rd, [ \rx, # S3C2410_UFCON ] | ||
72 | tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? | ||
73 | beq 1001f @ | ||
74 | @ FIFO enabled... | ||
75 | 1003: | ||
76 | mrc p15, 0, \rd, c1, c0 | ||
77 | tst \rd, #1 | ||
78 | addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) | ||
79 | addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) | ||
80 | bic \rd, \rd, #0xff000 | ||
81 | ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] | ||
82 | and \rd, \rd, #0x00ff0000 | ||
83 | teq \rd, #0x00440000 @ is it 2440? | ||
84 | |||
85 | ldr \rd, [ \rx, # S3C2410_UFSTAT ] | ||
86 | andne \rd, \rd, #S3C2410_UFSTAT_TXMASK | ||
87 | andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK | ||
88 | teq \rd, #0 | ||
89 | bne 1003b | ||
90 | b 1002f | ||
91 | |||
92 | 1001: | ||
93 | @ idle waiting for non fifo | ||
94 | ldr \rd, [ \rx, # S3C2410_UTRSTAT ] | ||
95 | tst \rd, #S3C2410_UTRSTAT_TXFE | ||
96 | beq 1001b | ||
97 | |||
98 | 1002: @ exit busyuart | ||
99 | .endm | ||