debug-macro.S 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_SOC_IMX1
  15. #define UART_PADDR MX1_UART1_BASE_ADDR
  16. #endif
  17. #ifdef CONFIG_SOC_IMX25
  18. #ifdef UART_PADDR
  19. #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
  20. #endif
  21. #define UART_PADDR MX25_UART1_BASE_ADDR
  22. #endif
  23. #if defined(CONFIG_SOC_IMX21) || defined (CONFIG_SOC_IMX27)
  24. #ifdef UART_PADDR
  25. #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
  26. #endif
  27. #define UART_PADDR MX2x_UART1_BASE_ADDR
  28. #endif
  29. #if defined(CONFIG_SOC_IMX31) || defined(CONFIG_SOC_IMX35)
  30. #ifdef UART_PADDR
  31. #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
  32. #endif
  33. #define UART_PADDR MX3x_UART1_BASE_ADDR
  34. #endif
  35. #ifdef CONFIG_SOC_IMX51
  36. #ifdef UART_PADDR
  37. #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
  38. #endif
  39. #define UART_PADDR MX51_UART1_BASE_ADDR
  40. #endif
  41. /* iMX50/53 have same addresses, but not iMX51 */
  42. #if defined(CONFIG_SOC_IMX50) || defined(CONFIG_SOC_IMX53)
  43. #ifdef UART_PADDR
  44. #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
  45. #endif
  46. #define UART_PADDR MX53_UART1_BASE_ADDR
  47. #endif
  48. #define UART_VADDR IMX_IO_ADDRESS(UART_PADDR)
  49. .macro addruart, rp, rv
  50. ldr \rp, =UART_PADDR @ physical
  51. ldr \rv, =UART_VADDR @ virtual
  52. .endm
  53. .macro senduart,rd,rx
  54. str \rd, [\rx, #0x40] @ TXDATA
  55. .endm
  56. .macro waituart,rd,rx
  57. .endm
  58. .macro busyuart,rd,rx
  59. 1002: ldr \rd, [\rx, #0x98] @ SR2
  60. tst \rd, #1 << 3 @ TXDC
  61. beq 1002b @ wait until transmit done
  62. .endm