debug-macro.S 1000 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * arch/arm/plat-spear/include/plat/debug-macro.S
  3. *
  4. * Debugging macro include header for spear platform
  5. *
  6. * Copyright (C) 2009 ST Microelectronics
  7. * Viresh Kumar<viresh.kumar@st.com>
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #include <linux/amba/serial.h>
  14. #include <mach/spear.h>
  15. .macro addruart, rx
  16. mrc p15, 0, \rx, c1, c0
  17. tst \rx, #1 @ MMU enabled?
  18. moveq \rx, =SPEAR_DBG_UART_BASE @ Physical base
  19. movne \rx, =VA_SPEAR_DBG_UART_BASE @ Virtual base
  20. .endm
  21. .macro senduart, rd, rx
  22. strb \rd, [\rx, #UART01x_DR] @ ASC_TX_BUFFER
  23. .endm
  24. .macro waituart, rd, rx
  25. 1001: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
  26. tst \rd, #UART01x_FR_TXFF @ TX_FULL
  27. bne 1001b
  28. .endm
  29. .macro busyuart, rd, rx
  30. 1002: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
  31. tst \rd, #UART011_FR_TXFE @ TX_EMPTY
  32. beq 1002b
  33. .endm