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. #ifdef CONFIG_ARCH_MX1
  14. #include <mach/mx1.h>
  15. #define UART_PADDR UART1_BASE_ADDR
  16. #define UART_VADDR IO_ADDRESS(UART1_BASE_ADDR)
  17. #endif
  18. #ifdef CONFIG_ARCH_MX25
  19. #ifdef UART_PADDR
  20. #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
  21. #endif
  22. #include <mach/mx25.h>
  23. #define UART_PADDR UART1_BASE_ADDR
  24. #define UART_VADDR MX25_AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
  25. #endif
  26. #ifdef CONFIG_ARCH_MX2
  27. #ifdef UART_PADDR
  28. #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
  29. #endif
  30. #include <mach/mx2x.h>
  31. #define UART_PADDR UART1_BASE_ADDR
  32. #define UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR)
  33. #endif
  34. #ifdef CONFIG_ARCH_MX3
  35. #ifdef UART_PADDR
  36. #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
  37. #endif
  38. #include <mach/mx3x.h>
  39. #define UART_PADDR UART1_BASE_ADDR
  40. #define UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
  41. #endif
  42. #ifdef CONFIG_ARCH_MXC91231
  43. #ifdef UART_PADDR
  44. #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
  45. #endif
  46. #include <mach/mxc91231.h>
  47. #define UART_PADDR MXC91231_UART2_BASE_ADDR
  48. #define UART_VADDR MXC91231_AIPS1_IO_ADDRESS(MXC91231_UART2_BASE_ADDR)
  49. #endif
  50. .macro addruart,rx
  51. mrc p15, 0, \rx, c1, c0
  52. tst \rx, #1 @ MMU enabled?
  53. ldreq \rx, =UART_PADDR @ physical
  54. ldrne \rx, =UART_VADDR @ virtual
  55. .endm
  56. .macro senduart,rd,rx
  57. str \rd, [\rx, #0x40] @ TXDATA
  58. .endm
  59. .macro waituart,rd,rx
  60. .endm
  61. .macro busyuart,rd,rx
  62. 1002: ldr \rd, [\rx, #0x98] @ SR2
  63. tst \rd, #1 << 3 @ TXDC
  64. beq 1002b @ wait until transmit done
  65. .endm