debug-macro.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* arch/arm/mach-clps711x/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. #include <mach/hardware.h>
  14. #include <asm/hardware/clps7111.h>
  15. .macro addruart, rx, tmp
  16. mrc p15, 0, \rx, c1, c0
  17. tst \rx, #1 @ MMU enabled?
  18. moveq \rx, #CLPS7111_PHYS_BASE
  19. movne \rx, #CLPS7111_VIRT_BASE
  20. #ifndef CONFIG_DEBUG_CLPS711X_UART2
  21. add \rx, \rx, #0x0000 @ UART1
  22. #else
  23. add \rx, \rx, #0x1000 @ UART2
  24. #endif
  25. .endm
  26. .macro senduart,rd,rx
  27. str \rd, [\rx, #0x0480] @ UARTDR
  28. .endm
  29. .macro waituart,rd,rx
  30. 1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx
  31. tst \rd, #1 << 11 @ UBUSYx
  32. bne 1001b
  33. .endm
  34. .macro busyuart,rd,rx
  35. tst \rx, #0x1000 @ UART2 does not have CTS here
  36. bne 1002f
  37. 1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx
  38. tst \rd, #1 << 8 @ CTS
  39. bne 1001b
  40. 1002:
  41. .endm