Lokesh Vutla | a3501a4 | 2018-11-02 19:51:05 +0530 | [diff] [blame] | 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 | |
| 9 | #include <common.h> |
| 10 | #include <spl.h> |
| 11 | #include "common.h" |
| 12 | #include <dm.h> |
| 13 | #include <remoteproc.h> |
| 14 | |
| 15 | #ifdef CONFIG_SYS_K3_SPL_ATF |
| 16 | void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) |
| 17 | { |
| 18 | int ret; |
| 19 | |
| 20 | /* |
| 21 | * It is assumed that remoteproc device 1 is the corresponding |
Andreas Dannenberg | 4a1fa52 | 2019-02-04 12:58:47 -0600 | [diff] [blame] | 22 | * Cortex-A core which runs ATF. Make sure DT reflects the same. |
Lokesh Vutla | a3501a4 | 2018-11-02 19:51:05 +0530 | [diff] [blame] | 23 | */ |
| 24 | ret = rproc_dev_init(1); |
Andreas Dannenberg | 4a1fa52 | 2019-02-04 12:58:47 -0600 | [diff] [blame] | 25 | if (ret) |
| 26 | panic("%s: ATF failed to initialize on rproc (%d)\n", __func__, |
| 27 | ret); |
Lokesh Vutla | a3501a4 | 2018-11-02 19:51:05 +0530 | [diff] [blame] | 28 | |
| 29 | ret = rproc_load(1, spl_image->entry_point, 0x200); |
Andreas Dannenberg | 4a1fa52 | 2019-02-04 12:58:47 -0600 | [diff] [blame] | 30 | if (ret) |
| 31 | panic("%s: ATF failed to load on rproc (%d)\n", __func__, ret); |
Lokesh Vutla | a3501a4 | 2018-11-02 19:51:05 +0530 | [diff] [blame] | 32 | |
Andreas Dannenberg | 4a1fa52 | 2019-02-04 12:58:47 -0600 | [diff] [blame] | 33 | /* Add an extra newline to differentiate the ATF logs from SPL */ |
Lokesh Vutla | a3501a4 | 2018-11-02 19:51:05 +0530 | [diff] [blame] | 34 | printf("Starting ATF on ARM64 core...\n\n"); |
| 35 | |
| 36 | ret = rproc_start(1); |
Andreas Dannenberg | 4a1fa52 | 2019-02-04 12:58:47 -0600 | [diff] [blame] | 37 | if (ret) |
| 38 | panic("%s: ATF failed to start on rproc (%d)\n", __func__, ret); |
Lokesh Vutla | a3501a4 | 2018-11-02 19:51:05 +0530 | [diff] [blame] | 39 | |
Andreas Dannenberg | 4a1fa52 | 2019-02-04 12:58:47 -0600 | [diff] [blame] | 40 | debug("ATF started. Waiting indefinitely...\n"); |
Lokesh Vutla | a3501a4 | 2018-11-02 19:51:05 +0530 | [diff] [blame] | 41 | while (1) |
| 42 | asm volatile("wfe"); |
| 43 | } |
| 44 | #endif |