debug-macro.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <mach/hardware.h>
  14. #ifdef CONFIG_DEBUG_IMX1_UART
  15. #define UART_PADDR MX1_UART1_BASE_ADDR
  16. #elif defined (CONFIG_DEBUG_IMX25_UART)
  17. #define UART_PADDR MX25_UART1_BASE_ADDR
  18. #elif defined (CONFIG_DEBUG_IMX21_IMX27_UART)
  19. #define UART_PADDR MX2x_UART1_BASE_ADDR
  20. #elif defined (CONFIG_DEBUG_IMX31_IMX35_UART)
  21. #define UART_PADDR MX3x_UART1_BASE_ADDR
  22. #elif defined (CONFIG_DEBUG_IMX51_UART)
  23. #define UART_PADDR MX51_UART1_BASE_ADDR
  24. #elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
  25. #define UART_PADDR MX53_UART1_BASE_ADDR
  26. #elif defined (CONFIG_DEBUG_IMX6Q_UART)
  27. #define UART_PADDR MX6Q_UART4_BASE_ADDR
  28. #endif
  29. #define UART_VADDR IMX_IO_ADDRESS(UART_PADDR)
  30. .macro addruart, rp, rv, tmp
  31. ldr \rp, =UART_PADDR @ physical
  32. ldr \rv, =UART_VADDR @ virtual
  33. .endm
  34. .macro senduart,rd,rx
  35. str \rd, [\rx, #0x40] @ TXDATA
  36. .endm
  37. .macro waituart,rd,rx
  38. .endm
  39. .macro busyuart,rd,rx
  40. 1002: ldr \rd, [\rx, #0x98] @ SR2
  41. tst \rd, #1 << 3 @ TXDC
  42. beq 1002b @ wait until transmit done
  43. .endm