Sergii Dmytruk | 3a96074 | 2021-08-21 16:24:02 +0300 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <cpu/power/spr.h> |
| 4 | #include <program_loading.h> |
| 5 | |
| 6 | /* |
| 7 | * Payload's entry point is an offset to the real entry point, not to OPD |
| 8 | * (Official Procedure Descriptor) for entry point. |
| 9 | * |
| 10 | * Also pass FDT address to payload stored in SPR_HSPRG0 by bootblock. |
| 11 | */ |
| 12 | void platform_prog_run(struct prog *prog) |
| 13 | { |
| 14 | asm volatile( |
| 15 | "mfspr %%r27, %0\n" /* pass pointer to FDT */ |
| 16 | "mtctr %2\n" |
| 17 | "mr 3, %1\n" |
| 18 | "bctr\n" |
| 19 | :: "i"(SPR_HSPRG0), "r"(prog_entry_arg(prog)), "r"(prog_entry(prog)) |
| 20 | : "memory"); |
| 21 | } |