vf.S 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright 2013 Freescale Semiconductor, Inc.
  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. */
  9. #define VF_UART0_BASE_ADDR 0x40027000
  10. #define VF_UART1_BASE_ADDR 0x40028000
  11. #define VF_UART2_BASE_ADDR 0x40029000
  12. #define VF_UART3_BASE_ADDR 0x4002a000
  13. #define VF_UART_BASE_ADDR(n) VF_UART##n##_BASE_ADDR
  14. #define VF_UART_BASE(n) VF_UART_BASE_ADDR(n)
  15. #define VF_UART_PHYSICAL_BASE VF_UART_BASE(CONFIG_DEBUG_VF_UART_PORT)
  16. #define VF_UART_VIRTUAL_BASE 0xfe000000
  17. .macro addruart, rp, rv, tmp
  18. ldr \rp, =VF_UART_PHYSICAL_BASE @ physical
  19. and \rv, \rp, #0xffffff @ offset within 16MB section
  20. add \rv, \rv, #VF_UART_VIRTUAL_BASE
  21. .endm
  22. .macro senduart, rd, rx
  23. strb \rd, [\rx, #0x7] @ Data Register
  24. .endm
  25. .macro busyuart, rd, rx
  26. 1001: ldrb \rd, [\rx, #0x4] @ Status Register 1
  27. tst \rd, #1 << 6 @ TC
  28. beq 1001b @ wait until transmit done
  29. .endm
  30. .macro waituart,rd,rx
  31. .endm