提交 268099e3 编写于 作者: R Russell King 提交者: Russell King

[ARM] Collect 8250-based debug implementations together

Several ARM machine implementations used an 8250 compatible port for
debugging purposes, and indepdently implemented the low level debug
macros every time.  Provide a common implementation and convert these
implementations to use this version.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 22398f57
...@@ -17,15 +17,5 @@ ...@@ -17,15 +17,5 @@
orr \rx, \rx, #0x00000be0 orr \rx, \rx, #0x00000be0
.endm .endm
.macro senduart,rd,rx #define UART_SHIFT 2
strb \rd, [\rx] #include <asm/hardware/debug-8250.S>
.endm
.macro busyuart,rd,rx
.endm
.macro waituart,rd,rx
1001: ldrb \rd, [\rx, #0x14]
tst \rd, #0x20
beq 1001b
.endm
...@@ -16,19 +16,6 @@ ...@@ -16,19 +16,6 @@
orr \rx, \rx, #0x00000be0 orr \rx, \rx, #0x00000be0
.endm .endm
.macro senduart,rd,rx #define UART_SHIFT 2
strb \rd, [\rx] #define FLOW_CONTROL
.endm #include <asm/hardware/debug-8250.h>
.macro busyuart,rd,rx
1002: ldrb \rd, [\rx, #0x14]
and \rd, \rd, #0x60
teq \rd, #0x60
bne 1002b
.endm
.macro waituart,rd,rx
1001: ldrb \rd, [\rx, #0x18]
tst \rd, #0x10
beq 1001b
.endm
...@@ -23,22 +23,10 @@ ...@@ -23,22 +23,10 @@
orr \rx, \rx, #0x000003f8 orr \rx, \rx, #0x000003f8
.endm .endm
.macro senduart,rd,rx #define UART_SHIFT 0
strb \rd, [\rx] #define FLOW_CONTROL
.endm #include <asm/hardware/debug-8250.S>
.macro busyuart,rd,rx
1002: ldrb \rd, [\rx, #0x5]
and \rd, \rd, #0x60
teq \rd, #0x60
bne 1002b
.endm
.macro waituart,rd,rx
1001: ldrb \rd, [\rx, #0x6]
tst \rd, #0x10
beq 1001b
.endm
#else #else
/* For EBSA285 debugging */ /* For EBSA285 debugging */
.equ dc21285_high, ARMCSR_BASE & 0xff000000 .equ dc21285_high, ARMCSR_BASE & 0xff000000
......
...@@ -28,21 +28,8 @@ ...@@ -28,21 +28,8 @@
#endif #endif
.endm .endm
.macro senduart,rd,rx
strb \rd, [\rx]
.endm
.macro busyuart,rd,rx
1002: ldrb \rd, [\rx, #0x5]
and \rd, \rd, #0x60
teq \rd, #0x60
bne 1002b
.endm
.macro waituart,rd,rx
#if !defined(CONFIG_ARCH_IQ80321) || !defined(CONFIG_ARCH_IQ31244) || !defined(CONFIG_ARCH_IQ80331) #if !defined(CONFIG_ARCH_IQ80321) || !defined(CONFIG_ARCH_IQ31244) || !defined(CONFIG_ARCH_IQ80331)
1001: ldrb \rd, [\rx, #0x6] #define FLOW_CONTROL
tst \rd, #0x10
beq 1001b
#endif #endif
.endm #define UART_SHIFT 0
#include <asm/hardware/debug-8250.S>
...@@ -20,16 +20,5 @@ ...@@ -20,16 +20,5 @@
@ byte writes used - Big Endian. @ byte writes used - Big Endian.
.endm .endm
.macro senduart,rd,rx #define UART_SHIFT 2
strb \rd, [\rx] #include <asm/hardware/debug-8250.S>
.endm
.macro waituart,rd,rx
1002: ldrb \rd, [\rx, #0x14]
and \rd, \rd, #0x60 @ check THRE and TEMT bits
teq \rd, #0x60
bne 1002b
.endm
.macro busyuart,rd,rx
.endm
...@@ -21,18 +21,5 @@ ...@@ -21,18 +21,5 @@
orr \rx, \rx, #0x00100000 orr \rx, \rx, #0x00100000
.endm .endm
.macro senduart,rd,rx #define UART_SHIFT 2
str \rd, [\rx, #0] #include <asm/hardware/debug-8250.S>
.endm
.macro busyuart,rd,rx
1002: ldr \rd, [\rx, #0x14]
tst \rd, #(1 << 6)
beq 1002b
.endm
.macro waituart,rd,rx
1001: ldr \rd, [\rx, #0x14]
tst \rd, #(1 << 5)
beq 1001b
.endm
...@@ -20,19 +20,6 @@ ...@@ -20,19 +20,6 @@
orr \rx, \rx, #0x00000fe0 orr \rx, \rx, #0x00000fe0
.endm .endm
.macro senduart,rd,rx #define UART_SHIFT 2
strb \rd, [\rx] #define FLOW_CONTROL
.endm #include <asm/hardware/debug-8250.S>
.macro busyuart,rd,rx
1001: ldrb \rd, [\rx, #0x14]
and \rd, \rd, #0x60
teq \rd, #0x60
bne 1001b
.endm
.macro waituart,rd,rx
1001: ldrb \rd, [\rx, #0x18]
tst \rd, #0x10
beq 1001b
.endm
/*
* linux/include/asm-arm/hardware/debug-8250.h
*
* Copyright (C) 1994-1999 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/serial_reg.h>
.macro senduart,rd,rx
strb \rd, [\rx, #UART_TX << UART_SHIFT]
.endm
.macro busyuart,rd,rx
1002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT]
and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
bne 1002b
.endm
.macro waituart,rd,rx
#ifdef FLOW_CONTROL
1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT]
tst \rd, #UART_MSR_CTS
beq 1001b
#endif
.endm
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册