1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
14 #include <virtio_types.h>
20 * Make sure virtio bus is enumerated so that peripherals
21 * on the virtio bus can be discovered by their drivers
28 int board_late_init(void)
34 chosen_node = ofnode_path("/chosen");
35 if (!ofnode_valid(chosen_node)) {
36 debug("No chosen node found, can't get kernel start address\n");
40 #ifdef CONFIG_ARCH_RV64I
41 ret = ofnode_read_u64(chosen_node, "riscv,kernel-start",
42 (u64 *)&kernel_start);
44 ret = ofnode_read_u32(chosen_node, "riscv,kernel-start",
45 (u32 *)&kernel_start);
48 debug("Can't find kernel start address in device tree\n");
52 env_set_hex("kernel_start", kernel_start);
58 u32 spl_boot_device(void)
60 /* RISC-V QEMU only supports RAM as SPL boot device */
61 return BOOT_DEVICE_RAM;
65 #ifdef CONFIG_SPL_LOAD_FIT
66 int board_fit_config_name_match(const char *name)
68 /* boot using first FIT config */