imx.S 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #ifdef CONFIG_DEBUG_IMX1_UART
  14. #define UART_PADDR 0x00206000
  15. #elif defined (CONFIG_DEBUG_IMX25_UART)
  16. #define UART_PADDR 0x43f90000
  17. #elif defined (CONFIG_DEBUG_IMX21_IMX27_UART)
  18. #define UART_PADDR 0x1000a000
  19. #elif defined (CONFIG_DEBUG_IMX31_IMX35_UART)
  20. #define UART_PADDR 0x43f90000
  21. #elif defined (CONFIG_DEBUG_IMX51_UART)
  22. #define UART_PADDR 0x73fbc000
  23. #elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
  24. #define UART_PADDR 0x53fbc000
  25. #elif defined (CONFIG_DEBUG_IMX6Q_UART2)
  26. #define UART_PADDR 0x021e8000
  27. #elif defined (CONFIG_DEBUG_IMX6Q_UART4)
  28. #define UART_PADDR 0x021f0000
  29. #endif
  30. /*
  31. * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to
  32. * stay sync with that. It's hard to maintain, and should be fixed
  33. * globally for multi-platform build to use a fixed virtual address
  34. * for low-level debug uart port across platforms.
  35. */
  36. #define IMX_IO_P2V(x) ( \
  37. (((x) & 0x80000000) >> 7) | \
  38. (0xf4000000 + \
  39. (((x) & 0x50000000) >> 6) + \
  40. (((x) & 0x0b000000) >> 4) + \
  41. (((x) & 0x000fffff))))
  42. #define UART_VADDR IMX_IO_P2V(UART_PADDR)
  43. .macro addruart, rp, rv, tmp
  44. ldr \rp, =UART_PADDR @ physical
  45. ldr \rv, =UART_VADDR @ virtual
  46. .endm
  47. .macro senduart,rd,rx
  48. str \rd, [\rx, #0x40] @ TXDATA
  49. .endm
  50. .macro waituart,rd,rx
  51. .endm
  52. .macro busyuart,rd,rx
  53. 1002: ldr \rd, [\rx, #0x98] @ SR2
  54. tst \rd, #1 << 3 @ TXDC
  55. beq 1002b @ wait until transmit done
  56. .endm