common.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * K3: Common Architecture initialization
  4. *
  5. * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
  6. * Lokesh Vutla <lokeshvutla@ti.com>
  7. */
  8. #include <common.h>
  9. #include <spl.h>
  10. #include "common.h"
  11. #include <dm.h>
  12. #include <remoteproc.h>
  13. #ifdef CONFIG_SYS_K3_SPL_ATF
  14. void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
  15. {
  16. int ret;
  17. /*
  18. * It is assumed that remoteproc device 1 is the corresponding
  19. * cortex A core which runs ATF. Make sure DT reflects the same.
  20. */
  21. ret = rproc_dev_init(1);
  22. if (ret) {
  23. printf("%s: ATF failed to Initialize on rproc: ret= %d\n",
  24. __func__, ret);
  25. hang();
  26. }
  27. ret = rproc_load(1, spl_image->entry_point, 0x200);
  28. if (ret) {
  29. printf("%s: ATF failed to load on rproc: ret= %d\n",
  30. __func__, ret);
  31. hang();
  32. }
  33. /* Add an extra newline to differentiate the ATF logs from SPL*/
  34. printf("Starting ATF on ARM64 core...\n\n");
  35. ret = rproc_start(1);
  36. if (ret) {
  37. printf("%s: ATF failed to start on rproc: ret= %d\n",
  38. __func__, ret);
  39. hang();
  40. }
  41. debug("ATF started. Wait indefiniely\n");
  42. while (1)
  43. asm volatile("wfe");
  44. }
  45. #endif