Skip to content

Commit

Permalink
[ARM] Collect 8250-based debug implementations together
Browse files Browse the repository at this point in the history
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: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Mar 21, 2006
1 parent 22398f5 commit 268099e
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 103 deletions.
14 changes: 2 additions & 12 deletions include/asm-arm/arch-cl7500/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,5 @@
orr \rx, \rx, #0x00000be0
.endm

.macro senduart,rd,rx
strb \rd, [\rx]
.endm

.macro busyuart,rd,rx
.endm

.macro waituart,rd,rx
1001: ldrb \rd, [\rx, #0x14]
tst \rd, #0x20
beq 1001b
.endm
#define UART_SHIFT 2
#include <asm/hardware/debug-8250.S>
19 changes: 3 additions & 16 deletions include/asm-arm/arch-ebsa110/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@
orr \rx, \rx, #0x00000be0
.endm

.macro senduart,rd,rx
strb \rd, [\rx]
.endm

.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
#define UART_SHIFT 2
#define FLOW_CONTROL
#include <asm/hardware/debug-8250.h>
18 changes: 3 additions & 15 deletions include/asm-arm/arch-ebsa285/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,10 @@
orr \rx, \rx, #0x000003f8
.endm

.macro senduart,rd,rx
strb \rd, [\rx]
.endm
#define UART_SHIFT 0
#define FLOW_CONTROL
#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
/* For EBSA285 debugging */
.equ dc21285_high, ARMCSR_BASE & 0xff000000
Expand Down
19 changes: 3 additions & 16 deletions include/asm-arm/arch-iop3xx/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,8 @@
#endif
.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)
1001: ldrb \rd, [\rx, #0x6]
tst \rd, #0x10
beq 1001b
#define FLOW_CONTROL
#endif
.endm
#define UART_SHIFT 0
#include <asm/hardware/debug-8250.S>
15 changes: 2 additions & 13 deletions include/asm-arm/arch-ixp4xx/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,5 @@
@ byte writes used - Big Endian.
.endm

.macro senduart,rd,rx
strb \rd, [\rx]
.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
#define UART_SHIFT 2
#include <asm/hardware/debug-8250.S>
17 changes: 2 additions & 15 deletions include/asm-arm/arch-pxa/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,5 @@
orr \rx, \rx, #0x00100000
.endm

.macro senduart,rd,rx
str \rd, [\rx, #0]
.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
#define UART_SHIFT 2
#include <asm/hardware/debug-8250.S>
19 changes: 3 additions & 16 deletions include/asm-arm/arch-rpc/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@
orr \rx, \rx, #0x00000fe0
.endm

.macro senduart,rd,rx
strb \rd, [\rx]
.endm

.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
#define UART_SHIFT 2
#define FLOW_CONTROL
#include <asm/hardware/debug-8250.S>
29 changes: 29 additions & 0 deletions include/asm-arm/hardware/debug-8250.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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

0 comments on commit 268099e

Please sign in to comment.