pl01x.S 1004 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* arch/arm/include/debug/pl01x.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 <linux/amba/serial.h>
  14. #ifdef CONFIG_DEBUG_ZTE_ZX
  15. #undef UART01x_DR
  16. #undef UART01x_FR
  17. #define UART01x_DR 0x04
  18. #define UART01x_FR 0x14
  19. #endif
  20. #ifdef CONFIG_DEBUG_UART_PHYS
  21. .macro addruart, rp, rv, tmp
  22. ldr \rp, =CONFIG_DEBUG_UART_PHYS
  23. ldr \rv, =CONFIG_DEBUG_UART_VIRT
  24. .endm
  25. #endif
  26. .macro senduart,rd,rx
  27. strb \rd, [\rx, #UART01x_DR]
  28. .endm
  29. .macro waituart,rd,rx
  30. 1001: ldr \rd, [\rx, #UART01x_FR]
  31. ARM_BE8( rev \rd, \rd )
  32. tst \rd, #UART01x_FR_TXFF
  33. bne 1001b
  34. .endm
  35. .macro busyuart,rd,rx
  36. 1001: ldr \rd, [\rx, #UART01x_FR]
  37. ARM_BE8( rev \rd, \rd )
  38. tst \rd, #UART01x_FR_BUSY
  39. bne 1001b
  40. .endm