ARM: S3C24XX: trim down debug uart handling
Using the lowlevel debug uart is a corner case - even more so in a multiplatform environment. So it seems reasonable to simply let the developer set the appropriate uart type for the debugged SoC. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
此提交包含在:
@@ -13,11 +13,9 @@
|
||||
*/
|
||||
|
||||
#include <mach/map.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <linux/serial_s3c.h>
|
||||
|
||||
#define S3C2410_UART1_OFF (0x4000)
|
||||
#define SHIFT_2440TXF (14-9)
|
||||
|
||||
.macro addruart, rp, rv, tmp
|
||||
ldr \rp, = S3C24XX_PA_UART
|
||||
@@ -28,56 +26,11 @@
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro fifo_full_s3c24xx rd, rx
|
||||
@ check for arm920 vs arm926. currently assume all arm926
|
||||
@ devices have an 64 byte FIFO identical to the s3c2440
|
||||
mrc p15, 0, \rd, c0, c0
|
||||
and \rd, \rd, #0xff0
|
||||
teq \rd, #0x260
|
||||
beq 1004f
|
||||
mrc p15, 0, \rd, c1, c0
|
||||
tst \rd, #1
|
||||
addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
|
||||
addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
|
||||
bic \rd, \rd, #0xff000
|
||||
ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)]
|
||||
and \rd, \rd, #0x00ff0000
|
||||
teq \rd, #0x00440000 @ is it 2440?
|
||||
1004:
|
||||
ldr \rd, [\rx, # S3C2410_UFSTAT]
|
||||
moveq \rd, \rd, lsr #SHIFT_2440TXF
|
||||
tst \rd, #S3C2410_UFSTAT_TXFULL
|
||||
.endm
|
||||
|
||||
.macro fifo_full_s3c2410 rd, rx
|
||||
ldr \rd, [\rx, # S3C2410_UFSTAT]
|
||||
tst \rd, #S3C2410_UFSTAT_TXFULL
|
||||
.endm
|
||||
|
||||
/* fifo level reading */
|
||||
|
||||
.macro fifo_level_s3c24xx rd, rx
|
||||
@ check for arm920 vs arm926. currently assume all arm926
|
||||
@ devices have an 64 byte FIFO identical to the s3c2440
|
||||
mrc p15, 0, \rd, c0, c0
|
||||
and \rd, \rd, #0xff0
|
||||
teq \rd, #0x260
|
||||
beq 10000f
|
||||
mrc p15, 0, \rd, c1, c0
|
||||
tst \rd, #1
|
||||
addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
|
||||
addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
|
||||
bic \rd, \rd, #0xff000
|
||||
ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)]
|
||||
and \rd, \rd, #0x00ff0000
|
||||
teq \rd, #0x00440000 @ is it 2440?
|
||||
|
||||
10000:
|
||||
ldr \rd, [\rx, # S3C2410_UFSTAT]
|
||||
andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
|
||||
andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
|
||||
.endm
|
||||
|
||||
.macro fifo_level_s3c2410 rd, rx
|
||||
ldr \rd, [\rx, # S3C2410_UFSTAT]
|
||||
and \rd, \rd, #S3C2410_UFSTAT_TXMASK
|
||||
@@ -88,12 +41,9 @@
|
||||
* used variants of these
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_CPU_LLSERIAL_S3C2410_ONLY)
|
||||
#if defined(CONFIG_DEBUG_S3C2410_UART)
|
||||
#define fifo_full fifo_full_s3c2410
|
||||
#define fifo_level fifo_level_s3c2410
|
||||
#elif !defined(CONFIG_CPU_LLSERIAL_S3C2440_ONLY)
|
||||
#define fifo_full fifo_full_s3c24xx
|
||||
#define fifo_level fifo_level_s3c24xx
|
||||
#endif
|
||||
|
||||
/* include the reset of the code which will do the work */
|
||||
|
新增問題並參考
封鎖使用者