aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-s3c2410/debug-macro.S
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2007-07-22 11:08:48 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-07-22 11:44:27 -0400
commit498e03b619638826a7364faed61eb0a3d2a0f0c8 (patch)
treeb1bc5c8fb06328f85e02006100c1c7bbc46e5def /include/asm-arm/arch-s3c2410/debug-macro.S
parentd58153d86589b6bba2dd19f4c178252f8cf2ed4f (diff)
[ARM] 4510/1: S3C: split debug-macro support into plat-s3c
Move the common parts of the debug macros into include/asm-arm/plat-s3c ready to be used for the common S3C support. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/arch-s3c2410/debug-macro.S')
-rw-r--r--include/asm-arm/arch-s3c2410/debug-macro.S52
1 files changed, 9 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...
411003:
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
631001:
64 @ busy waiting for non fifo
65 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
66 tst \rd, #S3C2410_UTRSTAT_TXFE
67 beq 1001b
68 54
691002: @ 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...
781003:
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
951001:
96 @ idle waiting for non fifo
97 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
98 tst \rd, #S3C2410_UTRSTAT_TXFE
99 beq 1001b
100
1011002: @ exit busyuart
102 .endm