imx_uart_console.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <asm_macros.S>
  8. #include <console_macros.S>
  9. #include <assert_macros.S>
  10. #include "imx_uart.h"
  11. .globl console_imx_uart_register
  12. .globl console_imx_uart_putc
  13. .globl console_imx_uart_getc
  14. .globl console_imx_uart_flush
  15. func console_imx_uart_register
  16. push {r4, lr}
  17. mov r4, r3
  18. cmp r4, #0
  19. beq register_fail
  20. str r0, [r4, #CONSOLE_T_BASE]
  21. bl console_imx_uart_core_init
  22. cmp r0, #0
  23. bne register_fail
  24. mov r0, r4
  25. pop {r4, lr}
  26. finish_console_register imx_uart putc=1, getc=ENABLE_CONSOLE_GETC, flush=1
  27. register_fail:
  28. pop {r4, pc}
  29. endfunc console_imx_uart_register
  30. func console_imx_uart_putc
  31. ldr r1, [r1, #CONSOLE_T_BASE]
  32. b console_imx_uart_core_putc
  33. endfunc console_imx_uart_putc
  34. func console_imx_uart_getc
  35. ldr r0, [r0, #CONSOLE_T_BASE]
  36. b console_imx_uart_core_getc
  37. endfunc console_imx_uart_getc
  38. func console_imx_uart_flush
  39. ldr r0, [r0, #CONSOLE_T_BASE]
  40. b console_imx_uart_core_flush
  41. endfunc console_imx_uart_flush