keystone.S 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Early serial debug output macro for Keystone SOCs
  3. *
  4. * Copyright 2013 Texas Instruments, Inc.
  5. * Santosh Shilimkar <santosh.shilimkar@ti.com>
  6. *
  7. * Based on RMKs low level debug code.
  8. * Copyright (C) 1994-1999 Russell King
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/serial_reg.h>
  15. #define UART_SHIFT 2
  16. #if defined(CONFIG_DEBUG_KEYSTONE_UART0)
  17. #define UART_PHYS 0x02530c00
  18. #define UART_VIRT 0xfeb30c00
  19. #elif defined(CONFIG_DEBUG_KEYSTONE_UART1)
  20. #define UART_PHYS 0x02531000
  21. #define UART_VIRT 0xfeb31000
  22. #endif
  23. .macro addruart, rp, rv, tmp
  24. ldr \rv, =UART_VIRT @ physical base address
  25. ldr \rp, =UART_PHYS @ virtual base address
  26. .endm
  27. .macro senduart,rd,rx
  28. str \rd, [\rx, #UART_TX << UART_SHIFT]
  29. .endm
  30. .macro busyuart,rd,rx
  31. 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
  32. and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
  33. teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
  34. bne 1002b
  35. .endm
  36. .macro waituart,rd,rx
  37. .endm