debug-macro.S 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * arch/arm/mach-ks8695/include/mach/debug-macro.S
  3. *
  4. * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
  5. * Copyright (C) 2006 Simtec Electronics
  6. *
  7. * KS8695 - Debug macros
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <mach/hardware.h>
  14. #include <mach/regs-uart.h>
  15. .macro addruart, rx
  16. mrc p15, 0, \rx, c1, c0
  17. tst \rx, #1 @ MMU enabled?
  18. ldreq \rx, =KS8695_UART_PA @ physical base address
  19. ldrne \rx, =KS8695_UART_VA @ virtual base address
  20. .endm
  21. .macro senduart, rd, rx
  22. str \rd, [\rx, #KS8695_URTH] @ Write to Transmit Holding Register
  23. .endm
  24. .macro busyuart, rd, rx
  25. 1001: ldr \rd, [\rx, #KS8695_URLS] @ Read Line Status Register
  26. tst \rd, #URLS_URTE @ Holding & Shift registers empty?
  27. beq 1001b
  28. .endm
  29. .macro waituart, rd, rx
  30. 1001: ldr \rd, [\rx, #KS8695_URLS] @ Read Line Status Register
  31. tst \rd, #URLS_URTHRE @ Holding Register empty?
  32. beq 1001b
  33. .endm