clps711x.S 935 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
  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 as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. */
  9. #ifndef CONFIG_DEBUG_CLPS711X_UART2
  10. #define CLPS711X_UART_PADDR (0x80000000 + 0x0000)
  11. #define CLPS711X_UART_VADDR (0xfeff4000 + 0x0000)
  12. #else
  13. #define CLPS711X_UART_PADDR (0x80000000 + 0x1000)
  14. #define CLPS711X_UART_VADDR (0xfeff4000 + 0x1000)
  15. #endif
  16. #define SYSFLG (0x0140)
  17. #define SYSFLG_UBUSY (1 << 11)
  18. #define UARTDR (0x0480)
  19. .macro addruart, rp, rv, tmp
  20. ldr \rv, =CLPS711X_UART_VADDR
  21. ldr \rp, =CLPS711X_UART_PADDR
  22. .endm
  23. .macro waituart,rd,rx
  24. .endm
  25. .macro senduart,rd,rx
  26. str \rd, [\rx, #UARTDR]
  27. .endm
  28. .macro busyuart,rd,rx
  29. 1001: ldr \rd, [\rx, #SYSFLG]
  30. tst \rd, #SYSFLG_UBUSY
  31. bne 1001b
  32. .endm