debug-macro.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Debugging macro include header
  3. *
  4. * Embedded Alley Solutions, Inc <source@embeddedalley.com>
  5. *
  6. * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
  7. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
  8. */
  9. /*
  10. * The code contained herein is licensed under the GNU General Public
  11. * License. You may obtain a copy of the GNU General Public License
  12. * Version 2 or later at the following locations:
  13. *
  14. * http://www.opensource.org/licenses/gpl-license.html
  15. * http://www.gnu.org/copyleft/gpl.html
  16. */
  17. .macro addruart,rx
  18. mrc p15, 0, \rx, c1, c0
  19. tst \rx, #1 @ MMU enabled?
  20. moveq \rx, #0x80000000 @ physical base address
  21. addeq \rx, \rx, #0x00070000
  22. movne \rx, #0xf0000000 @ virtual base
  23. addne \rx, \rx, #0x00070000
  24. .endm
  25. .macro senduart,rd,rx
  26. strb \rd, [\rx, #0] @ data register at 0
  27. .endm
  28. .macro waituart,rd,rx
  29. 1001: ldr \rd, [\rx, #0x18] @ UARTFLG
  30. tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full
  31. bne 1001b
  32. .endm
  33. .macro busyuart,rd,rx
  34. 1001: ldr \rd, [\rx, #0x18] @ UARTFLG
  35. tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
  36. bne 1001b
  37. .endm