debug-macro.S 1003 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* arch/arm/mach-meson/include/mach/debug-macro.S
  2. *
  3. * Copyright (C) 2011 Amlogic, Inc.
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #include <mach/hardware.h>
  16. #include <mach/am_regs.h>
  17. .macro addruart, rp, rv
  18. ldr \rp, =MESON_PERIPHS1_PHYS_BASE
  19. ldr \rv, =MESON_PERIPHS1_VIRT_BASE
  20. .endm
  21. .macro senduart, rd, rx
  22. teq \rx, #0
  23. strne \rd, [\rx]
  24. .endm
  25. .macro waituart, rd, rx
  26. @ wait for TX_READY
  27. 1001: ldr \rd, [\rx, #0x0C]
  28. tst \rd, #1 << 21 @ WFIFO FULL
  29. bne 1001b
  30. .endm
  31. .macro busyuart, rd, rx
  32. 2001: ldr \rd, [\rx, #0x0C]
  33. tst \rd, #1 << 23 @ CTS
  34. bne 2001b
  35. .endm