imx.S 1.3 KB

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