mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 14:42:24 +00:00
[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: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
22398f57b6
commit
268099e3cc
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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
include/asm-arm/hardware/debug-8250.S
Normal file
29
include/asm-arm/hardware/debug-8250.S
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user