imx.S 2.2 KB

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