Patrick Georgi | 864dc3b | 2020-03-04 13:59:17 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | e8b08ba | 2013-05-24 15:09:36 -0700 | [diff] [blame] | 2 | |
Sam Lewis | 362a156 | 2020-09-14 21:04:35 +1000 | [diff] [blame] | 3 | #include <cbfs.h> |
Gabe Black | c09cf0b | 2014-02-08 06:30:49 -0800 | [diff] [blame] | 4 | #include <arch/cache.h> |
Aaron Durbin | 04654a2 | 2015-03-17 11:43:44 -0500 | [diff] [blame] | 5 | #include <program_loading.h> |
Stefan Reinauer | 52db0b9 | 2012-12-07 17:15:04 -0800 | [diff] [blame] | 6 | |
Sam Lewis | 362a156 | 2020-09-14 21:04:35 +1000 | [diff] [blame] | 7 | void boot_linux(void *kernel_ptr, void *fdt_ptr); |
| 8 | |
Aaron Durbin | b3847e6 | 2015-03-20 15:55:08 -0500 | [diff] [blame] | 9 | void arch_prog_run(struct prog *prog) |
Stefan Reinauer | 52db0b9 | 2012-12-07 17:15:04 -0800 | [diff] [blame] | 10 | { |
Aaron Durbin | 3948e53 | 2015-03-20 13:00:20 -0500 | [diff] [blame] | 11 | void (*doit)(void *); |
Gabe Black | c09cf0b | 2014-02-08 06:30:49 -0800 | [diff] [blame] | 12 | |
Gabe Black | c09cf0b | 2014-02-08 06:30:49 -0800 | [diff] [blame] | 13 | cache_sync_instructions(); |
Aaron Durbin | 3948e53 | 2015-03-20 13:00:20 -0500 | [diff] [blame] | 14 | |
Sam Lewis | 362a156 | 2020-09-14 21:04:35 +1000 | [diff] [blame] | 15 | switch (prog_cbfs_type(prog)) { |
Julius Werner | 0057262 | 2022-05-26 20:29:42 -0700 | [diff] [blame^] | 16 | case CBFS_TYPE_FIT_PAYLOAD: |
Sam Lewis | 362a156 | 2020-09-14 21:04:35 +1000 | [diff] [blame] | 17 | /* |
| 18 | * We only load Linux payloads from the ramstage, so provide a hint to |
| 19 | * the linker that the below functions do not need to be included in |
| 20 | * earlier stages. |
| 21 | */ |
| 22 | if (!ENV_RAMSTAGE) |
| 23 | break; |
| 24 | |
| 25 | dcache_mmu_disable(); |
| 26 | boot_linux(prog_entry(prog), prog_entry_arg(prog)); |
| 27 | break; |
| 28 | default: |
| 29 | doit = prog_entry(prog); |
| 30 | doit(prog_entry_arg(prog)); |
| 31 | } |
Aaron Durbin | b3847e6 | 2015-03-20 15:55:08 -0500 | [diff] [blame] | 32 | } |