debug-macro.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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, rp, rv
  60. ldr \rp, =UART_PADDR @ physical
  61. ldr \rv, =UART_VADDR @ virtual
  62. .endm
  63. .macro senduart,rd,rx
  64. str \rd, [\rx, #0x40] @ TXDATA
  65. .endm
  66. .macro waituart,rd,rx
  67. .endm
  68. .macro busyuart,rd,rx
  69. 1002: ldr \rd, [\rx, #0x98] @ SR2
  70. tst \rd, #1 << 3 @ TXDC
  71. beq 1002b @ wait until transmit done
  72. .endm