[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>

authored by Ben Dooks and committed by Russell King 498e03b6 d58153d8

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