8250.S 888 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * arch/arm/include/debug/8250.S
  3. *
  4. * Copyright (C) 1994-2013 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/serial_reg.h>
  11. .macro addruart, rp, rv, tmp
  12. ldr \rp, =CONFIG_DEBUG_UART_PHYS
  13. ldr \rv, =CONFIG_DEBUG_UART_VIRT
  14. .endm
  15. #define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT
  16. .macro senduart,rd,rx
  17. strb \rd, [\rx, #UART_TX << UART_SHIFT]
  18. .endm
  19. .macro busyuart,rd,rx
  20. 1002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT]
  21. and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
  22. teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
  23. bne 1002b
  24. .endm
  25. .macro waituart,rd,rx
  26. #ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL
  27. 1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT]
  28. tst \rd, #UART_MSR_CTS
  29. beq 1001b
  30. #endif
  31. .endm