debug-macro.S 2.1 KB

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