1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
12 #include <virtio_types.h>
18 * Make sure virtio bus is enumerated so that peripherals
19 * on the virtio bus can be discovered by their drivers
26 int board_late_init(void)
32 chosen_node = ofnode_path("/chosen");
33 if (!ofnode_valid(chosen_node)) {
34 debug("No chosen node found, can't get kernel start address\n");
38 #ifdef CONFIG_ARCH_RV64I
39 ret = ofnode_read_u64(chosen_node, "riscv,kernel-start",
40 (u64 *)&kernel_start);
42 ret = ofnode_read_u32(chosen_node, "riscv,kernel-start",
43 (u32 *)&kernel_start);
46 debug("Can't find kernel start address in device tree\n");
50 env_set_hex("kernel_start", kernel_start);
56 u32 spl_boot_device(void)
58 /* RISC-V QEMU only supports RAM as SPL boot device */
59 return BOOT_DEVICE_RAM;
63 #ifdef CONFIG_SPL_LOAD_FIT
64 int board_fit_config_name_match(const char *name)
66 /* boot using first FIT config */