Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /* arch/arm/mach-imx/include/mach/debug-macro.S
0003  *
0004  * Debugging macro include header
0005  *
0006  *  Copyright (C) 1994-1999 Russell King
0007  *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
0008  */
0009 
0010 #include <asm/assembler.h>
0011 #include "imx-uart.h"
0012 
0013 /*
0014  * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to
0015  * stay sync with that.  It's hard to maintain, and should be fixed
0016  * globally for multi-platform build to use a fixed virtual address
0017  * for low-level debug uart port across platforms.
0018  */
0019 #define IMX_IO_P2V(x)   (                       \
0020             (((x) & 0x80000000) >> 7) |         \
0021             (0xf4000000 +                   \
0022             (((x) & 0x50000000) >> 6) +         \
0023             (((x) & 0x0b000000) >> 4) +         \
0024             (((x) & 0x000fffff))))
0025 
0026 #define UART_VADDR  IMX_IO_P2V(UART_PADDR)
0027 
0028         .macro  addruart, rp, rv, tmp
0029         ldr \rp, =UART_PADDR    @ physical
0030         ldr \rv, =UART_VADDR    @ virtual
0031         .endm
0032 
0033         .macro  senduart,rd,rx
0034         ARM_BE8(rev \rd, \rd)
0035         str \rd, [\rx, #0x40]   @ TXDATA
0036         .endm
0037 
0038         .macro  waituartcts,rd,rx
0039         .endm
0040 
0041         .macro  waituarttxrdy,rd,rx
0042         .endm
0043 
0044         .macro  busyuart,rd,rx
0045 1002:       ldr \rd, [\rx, #0x98]   @ SR2
0046         ARM_BE8(rev \rd, \rd)
0047         tst \rd, #1 << 3        @ TXDC
0048         beq 1002b           @ wait until transmit done
0049         .endm