| 1 | /* SPDX-License-Identifier: GPL-2.0-only */
|
| 2 | /* arch/arm/include/debug/sa1100.S
|
| 3 | *
|
| 4 | * Debugging macro include header
|
| 5 | *
|
| 6 | * Copyright (C) 1994-1999 Russell King
|
| 7 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
|
| 8 | */
|
| 9 |
|
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 |
|
| 17 | .macro addruart, rp, rv, tmp
|
| 18 | mrc p15, 0, \rp, c1, c0
|
| 19 | tst \rp, |
| 20 | moveq \rp, |
| 21 | movne \rp, |
| 22 |
|
| 23 | @ We probe for the active serial port here, coherently with
|
| 24 | @ the comment in arch/arm/mach-sa1100/include/mach/uncompress.h.
|
| 25 | @ We assume r1 can be clobbered.
|
| 26 |
|
| 27 | @ see if Ser3 is active
|
| 28 | add \rp, \rp, |
| 29 | ldr \rv, [\rp, |
| 30 | tst \rv, |
| 31 |
|
| 32 | @ if Ser3 is inactive, then try Ser1
|
| 33 | addeq \rp, \rp, |
| 34 | ldreq \rv, [\rp, |
| 35 | tsteq \rv, |
| 36 |
|
| 37 | @ if Ser1 is inactive, then try Ser2
|
| 38 | addeq \rp, \rp, |
| 39 | ldreq \rv, [\rp, |
| 40 | tsteq \rv, |
| 41 |
|
| 42 | @ clear top bits, and generate both phys and virt addresses
|
| 43 | lsl \rp, \rp, |
| 44 | lsr \rp, \rp, |
| 45 | orr \rv, \rp, |
| 46 | orr \rp, \rp, |
| 47 |
|
| 48 | .endm
|
| 49 |
|
| 50 | .macro senduart,rd,rx
|
| 51 | str \rd, [\rx, |
| 52 | .endm
|
| 53 |
|
| 54 | .macro waituartcts,rd,rx
|
| 55 | .endm
|
| 56 |
|
| 57 | .macro waituarttxrdy,rd,rx
|
| 58 | 1001: ldr \rd, [\rx, |
| 59 | tst \rd, |
| 60 | beq 1001b
|
| 61 | .endm
|
| 62 |
|
| 63 | .macro busyuart,rd,rx
|
| 64 | 1001: ldr \rd, [\rx, |
| 65 | tst \rd, |
| 66 | bne 1001b
|
| 67 | .endm
|