diff options
-rw-r--r-- | include/asm-arm/arch-s3c2410/debug-macro.S | 52 | ||||
-rw-r--r-- | include/asm-arm/plat-s3c/debug-macro.S | 57 |
2 files changed, 66 insertions, 43 deletions
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S index 90dfba45a291..b0a44178b14e 100644 --- a/include/asm-arm/arch-s3c2410/debug-macro.S +++ b/include/asm-arm/arch-s3c2410/debug-macro.S | |||
@@ -13,13 +13,15 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <asm/arch/map.h> | 15 | #include <asm/arch/map.h> |
16 | #include <asm/plat-s3c/regs-serial.h> | ||
17 | #include <asm/arch/regs-gpio.h> | 16 | #include <asm/arch/regs-gpio.h> |
18 | 17 | ||
18 | #include <asm/plat-s3c/regs-serial.h> | ||
19 | #include <asm/plat-s3c/debug-macro.S> | ||
20 | |||
19 | #define S3C2410_UART1_OFF (0x4000) | 21 | #define S3C2410_UART1_OFF (0x4000) |
20 | #define SHIFT_2440TXF (14-9) | 22 | #define SHIFT_2440TXF (14-9) |
21 | 23 | ||
22 | .macro addruart, rx | 24 | .macro addruart, rx |
23 | mrc p15, 0, \rx, c1, c0 | 25 | mrc p15, 0, \rx, c1, c0 |
24 | tst \rx, #1 | 26 | tst \rx, #1 |
25 | ldreq \rx, = S3C24XX_PA_UART | 27 | ldreq \rx, = S3C24XX_PA_UART |
@@ -27,18 +29,9 @@ | |||
27 | #if CONFIG_DEBUG_S3C2410_UART != 0 | 29 | #if CONFIG_DEBUG_S3C2410_UART != 0 |
28 | add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) | 30 | add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) |
29 | #endif | 31 | #endif |
30 | .endm | 32 | .endm |
31 | 33 | ||
32 | .macro senduart,rd,rx | 34 | .macro fifo_full rd, rx |
33 | strb \rd, [\rx, # S3C2410_UTXH ] | ||
34 | .endm | ||
35 | |||
36 | .macro busyuart, rd, rx | ||
37 | ldr \rd, [ \rx, # S3C2410_UFCON ] | ||
38 | tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? | ||
39 | beq 1001f @ | ||
40 | @ FIFO enabled... | ||
41 | 1003: | ||
42 | @ check for arm920 vs arm926. currently assume all arm926 | 35 | @ check for arm920 vs arm926. currently assume all arm926 |
43 | @ devices have an 64 byte FIFO identical to the s3c2440 | 36 | @ devices have an 64 byte FIFO identical to the s3c2440 |
44 | mrc p15, 0, \rd, c0, c0 | 37 | mrc p15, 0, \rd, c0, c0 |
@@ -57,25 +50,9 @@ | |||
57 | ldr \rd, [ \rx, # S3C2410_UFSTAT ] | 50 | ldr \rd, [ \rx, # S3C2410_UFSTAT ] |
58 | moveq \rd, \rd, lsr #SHIFT_2440TXF | 51 | moveq \rd, \rd, lsr #SHIFT_2440TXF |
59 | tst \rd, #S3C2410_UFSTAT_TXFULL | 52 | tst \rd, #S3C2410_UFSTAT_TXFULL |
60 | bne 1003b | 53 | .endm |
61 | b 1002f | ||
62 | |||
63 | 1001: | ||
64 | @ busy waiting for non fifo | ||
65 | ldr \rd, [ \rx, # S3C2410_UTRSTAT ] | ||
66 | tst \rd, #S3C2410_UTRSTAT_TXFE | ||
67 | beq 1001b | ||
68 | 54 | ||
69 | 1002: @ exit busyuart | 55 | .macro fifo_level rd, rx |
70 | .endm | ||
71 | |||
72 | .macro waituart,rd,rx | ||
73 | |||
74 | ldr \rd, [ \rx, # S3C2410_UFCON ] | ||
75 | tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? | ||
76 | beq 1001f @ | ||
77 | @ FIFO enabled... | ||
78 | 1003: | ||
79 | mrc p15, 0, \rd, c1, c0 | 56 | mrc p15, 0, \rd, c1, c0 |
80 | tst \rd, #1 | 57 | tst \rd, #1 |
81 | addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) | 58 | addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) |
@@ -88,15 +65,4 @@ | |||
88 | ldr \rd, [ \rx, # S3C2410_UFSTAT ] | 65 | ldr \rd, [ \rx, # S3C2410_UFSTAT ] |
89 | andne \rd, \rd, #S3C2410_UFSTAT_TXMASK | 66 | andne \rd, \rd, #S3C2410_UFSTAT_TXMASK |
90 | andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK | 67 | andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK |
91 | teq \rd, #0 | 68 | .endm |
92 | bne 1003b | ||
93 | b 1002f | ||
94 | |||
95 | 1001: | ||
96 | @ idle waiting for non fifo | ||
97 | ldr \rd, [ \rx, # S3C2410_UTRSTAT ] | ||
98 | tst \rd, #S3C2410_UTRSTAT_TXFE | ||
99 | beq 1001b | ||
100 | |||
101 | 1002: @ exit busyuart | ||
102 | .endm | ||
diff --git a/include/asm-arm/plat-s3c/debug-macro.S b/include/asm-arm/plat-s3c/debug-macro.S new file mode 100644 index 000000000000..a43bbfa90a0b --- /dev/null +++ b/include/asm-arm/plat-s3c/debug-macro.S | |||
@@ -0,0 +1,57 @@ | |||
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 | ||