imx.S 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* arch/arm/mach-imx/include/mach/debug-macro.S
  2. *
  3. * Debugging macro include header
  4. *
  5. * Copyright (C) 1994-1999 Russell King
  6. * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #include "imx-uart.h"
  14. /*
  15. * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to
  16. * stay sync with that. It's hard to maintain, and should be fixed
  17. * globally for multi-platform build to use a fixed virtual address
  18. * for low-level debug uart port across platforms.
  19. */
  20. #define IMX_IO_P2V(x) ( \
  21. (((x) & 0x80000000) >> 7) | \
  22. (0xf4000000 + \
  23. (((x) & 0x50000000) >> 6) + \
  24. (((x) & 0x0b000000) >> 4) + \
  25. (((x) & 0x000fffff))))
  26. #define UART_VADDR IMX_IO_P2V(UART_PADDR)
  27. .macro addruart, rp, rv, tmp
  28. ldr \rp, =UART_PADDR @ physical
  29. ldr \rv, =UART_VADDR @ virtual
  30. .endm
  31. .macro senduart,rd,rx
  32. str \rd, [\rx, #0x40] @ TXDATA
  33. .endm
  34. .macro waituart,rd,rx
  35. .endm
  36. .macro busyuart,rd,rx
  37. 1002: ldr \rd, [\rx, #0x98] @ SR2
  38. tst \rd, #1 << 3 @ TXDC
  39. beq 1002b @ wait until transmit done
  40. .endm