debug-macro.S 921 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2011 Picochip Ltd., Jamie Iles
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit
  9. * accesses to the 8250.
  10. */
  11. #include <linux/serial_reg.h>
  12. #include <mach/hardware.h>
  13. #include <mach/map.h>
  14. #define UART_SHIFT 2
  15. .macro addruart, rp, rv, tmp
  16. ldr \rv, =PHYS_TO_IO(PICOXCELL_UART1_BASE)
  17. ldr \rp, =PICOXCELL_UART1_BASE
  18. .endm
  19. .macro senduart,rd,rx
  20. str \rd, [\rx, #UART_TX << UART_SHIFT]
  21. .endm
  22. .macro busyuart,rd,rx
  23. 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
  24. and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
  25. teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
  26. bne 1002b
  27. .endm
  28. /* The UART's don't have any flow control IO's wired up. */
  29. .macro waituart,rd,rx
  30. .endm