debug-macro.S 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* arch/arm/mach-msm7200/include/mach/debug-macro.S
  2. *
  3. * Copyright (C) 2007 Google, Inc.
  4. * Author: Brian Swetland <swetland@google.com>
  5. *
  6. * This software is licensed under the terms of the GNU General Public
  7. * License version 2, as published by the Free Software Foundation, and
  8. * may be copied, distributed, and modified under those terms.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. */
  16. #include <mach/hardware.h>
  17. #include <mach/msm_iomap.h>
  18. #ifdef CONFIG_MSM_DEBUG_UART
  19. .macro addruart, rx, tmp
  20. @ see if the MMU is enabled and select appropriate base address
  21. mrc p15, 0, \rx, c1, c0
  22. tst \rx, #1
  23. ldreq \rx, =MSM_DEBUG_UART_PHYS
  24. ldrne \rx, =MSM_DEBUG_UART_BASE
  25. .endm
  26. .macro senduart,rd,rx
  27. teq \rx, #0
  28. strne \rd, [\rx, #0x0C]
  29. .endm
  30. .macro waituart,rd,rx
  31. @ wait for TX_READY
  32. 1001: ldr \rd, [\rx, #0x08]
  33. tst \rd, #0x04
  34. beq 1001b
  35. .endm
  36. #else
  37. .macro addruart, rx, tmp
  38. .endm
  39. .macro senduart,rd,rx
  40. .endm
  41. .macro waituart,rd,rx
  42. .endm
  43. #endif
  44. .macro busyuart,rd,rx
  45. .endm