imx.S 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* arch/arm/mach-imx/include/mach/debug-macro.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. #include <asm/assembler.h>
  10. #include "imx-uart.h"
  11. /*
  12. * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to
  13. * stay sync with that. It's hard to maintain, and should be fixed
  14. * globally for multi-platform build to use a fixed virtual address
  15. * for low-level debug uart port across platforms.
  16. */
  17. #define IMX_IO_P2V(x) ( \
  18. (((x) & 0x80000000) >> 7) | \
  19. (0xf4000000 + \
  20. (((x) & 0x50000000) >> 6) + \
  21. (((x) & 0x0b000000) >> 4) + \
  22. (((x) & 0x000fffff))))
  23. #define UART_VADDR IMX_IO_P2V(UART_PADDR)
  24. .macro addruart, rp, rv, tmp
  25. ldr \rp, =UART_PADDR @ physical
  26. ldr \rv, =UART_VADDR @ virtual
  27. .endm
  28. .macro senduart,rd,rx
  29. ARM_BE8(rev \rd, \rd)
  30. str \rd, [\rx, #0x40] @ TXDATA
  31. .endm
  32. .macro waituartcts,rd,rx
  33. .endm
  34. .macro waituarttxrdy,rd,rx
  35. .endm
  36. .macro busyuart,rd,rx
  37. 1002: ldr \rd, [\rx, #0x98] @ SR2
  38. ARM_BE8(rev \rd, \rd)
  39. tst \rd, #1 << 3 @ TXDC
  40. beq 1002b @ wait until transmit done
  41. .endm