plat_helpers.S 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2017-2018, 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 <sunxi_def.h>
  9. #include <sunxi_mmap.h>
  10. .globl plat_crash_console_init
  11. .globl plat_crash_console_putc
  12. .globl plat_crash_console_flush
  13. .globl plat_my_core_pos
  14. .globl platform_mem_init
  15. .globl plat_report_exception
  16. func plat_crash_console_init
  17. mov_imm x0, SUNXI_UART0_BASE
  18. mov_imm x1, SUNXI_UART0_CLK_IN_HZ
  19. mov_imm x2, SUNXI_UART0_BAUDRATE
  20. b console_16550_core_init
  21. endfunc plat_crash_console_init
  22. func plat_crash_console_putc
  23. mov_imm x1, SUNXI_UART0_BASE
  24. b console_16550_core_putc
  25. endfunc plat_crash_console_putc
  26. func plat_crash_console_flush
  27. ret
  28. endfunc plat_crash_console_flush
  29. func plat_my_core_pos
  30. mrs x0, mpidr_el1
  31. and x1, x0, #MPIDR_CLUSTER_MASK
  32. and x0, x0, #MPIDR_CPU_MASK
  33. add x0, x0, x1, LSR #6
  34. ret
  35. endfunc plat_my_core_pos
  36. func platform_mem_init
  37. ret
  38. endfunc platform_mem_init
  39. func plat_report_exception
  40. ret
  41. endfunc plat_report_exception