mb/**/hda_verb.c: Drop empty files
[coreboot.git] / src / arch / riscv / opensbi.c
blobeb557d240ac16333741ef2318812263388f93a4e
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* OpenSBI wants to make its own definitions for some of our compiler.h macros. */
4 #undef __packed
5 #undef __noreturn
7 #include <sbi/fw_dynamic.h>
8 #include <arch/boot.h>
9 /* DO NOT INCLUDE COREBOOT HEADERS HERE */
11 void run_opensbi(const int hart_id,
12 const void *fdt,
13 const void *opensbi,
14 const void *payload,
15 const int payload_mode)
17 struct fw_dynamic_info info = {
18 .magic = FW_DYNAMIC_INFO_MAGIC_VALUE,
19 .version = FW_DYNAMIC_INFO_VERSION_MAX,
20 .next_mode = payload_mode,
21 .next_addr = (uintptr_t)payload,
24 csr_write(mepc, opensbi);
25 asm volatile (
26 "mv a0, %0\n\t"
27 "mv a1, %1\n\t"
28 "mv a2, %2\n\t"
29 "mret" :
30 : "r"(hart_id), "r"(fdt), "r"(&info)
31 : "a0", "a1", "a2");