]> Git Repo - J-u-boot.git/blame - board/emulation/qemu-riscv/qemu-riscv.c
fdt: Swap the signature for board_fdt_blob_setup()
[J-u-boot.git] / board / emulation / qemu-riscv / qemu-riscv.c
CommitLineData
510e379c
BM
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2018, Bin Meng <[email protected]>
4 */
5
3c5196dc 6#include <dm.h>
ef19131b 7#include <dm/ofnode.h>
c7694dd4 8#include <env.h>
510e379c 9#include <fdtdec.h>
4d72caa5 10#include <image.h>
f7ae49fc 11#include <log.h>
e456a819 12#include <spl.h>
5255932f 13#include <init.h>
02be57ca 14#include <usb.h>
3c5196dc
BM
15#include <virtio_types.h>
16#include <virtio.h>
510e379c 17
2e8d2f88
IA
18DECLARE_GLOBAL_DATA_PTR;
19
ef19131b
AP
20#if IS_ENABLED(CONFIG_MTD_NOR_FLASH)
21int is_flash_available(void)
22{
23 if (!ofnode_equal(ofnode_by_compatible(ofnode_null(), "cfi-flash"),
24 ofnode_null()))
25 return 1;
26
27 return 0;
28}
29#endif
30
510e379c
BM
31int board_init(void)
32{
33 return 0;
34}
66ffe578
LA
35
36int board_late_init(void)
37{
02be57ca
BM
38 /* start usb so that usb keyboard can be used as input device */
39 if (CONFIG_IS_ENABLED(USB_KEYBOARD))
40 usb_init();
41
c532ddde
ŁS
42 /*
43 * Make sure virtio bus is enumerated so that peripherals
44 * on the virtio bus can be discovered by their drivers
45 */
46 virtio_init();
47
66ffe578
LA
48 return 0;
49}
897206c5 50
e456a819
LA
51#ifdef CONFIG_SPL
52u32 spl_boot_device(void)
53{
54 /* RISC-V QEMU only supports RAM as SPL boot device */
55 return BOOT_DEVICE_RAM;
56}
57#endif
58
59#ifdef CONFIG_SPL_LOAD_FIT
60int board_fit_config_name_match(const char *name)
61{
62 /* boot using first FIT config */
63 return 0;
64}
65#endif
2e8d2f88 66
fc37a73e 67int board_fdt_blob_setup(void **fdtp)
2e8d2f88
IA
68{
69 /* Stored the DTB address there during our init */
fc37a73e
SG
70 *fdtp = (void *)(ulong)gd->arch.firmware_fdt_addr;
71
72 return 0;
2e8d2f88 73}
This page took 0.289497 seconds and 4 git commands to generate.