aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/cpu/qemu
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-12-21 13:36:08 -0500
committerTom Rini <trini@konsulko.com>2018-12-21 13:36:08 -0500
commit328e3f8a706931e1a8f76adfdc015ad76cbeb83c (patch)
treeb88b5eb9c3135640bc44262229cc70f4a0e6acdc /arch/riscv/cpu/qemu
parent1f2e948d6d53f77a2ddb2dde3531b0d5bc2815ad (diff)
parent368ff57805b03bebf99e97e703ce07aec721bc71 (diff)
Merge git://git.denx.de/u-boot-riscv
- Add DM drivers to support RISC-V CPU and timer, plus some bug fixes. - Support SiFive UART - Rename ax25-ae350 defconfig
Diffstat (limited to 'arch/riscv/cpu/qemu')
-rw-r--r--arch/riscv/cpu/qemu/Kconfig12
-rw-r--r--arch/riscv/cpu/qemu/cpu.c14
2 files changed, 26 insertions, 0 deletions
diff --git a/arch/riscv/cpu/qemu/Kconfig b/arch/riscv/cpu/qemu/Kconfig
new file mode 100644
index 0000000000..f48751e6de
--- /dev/null
+++ b/arch/riscv/cpu/qemu/Kconfig
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+
+config QEMU_RISCV
+ bool
+ select ARCH_EARLY_INIT_R
+ imply CPU
+ imply CPU_RISCV
+ imply RISCV_TIMER
+ imply SIFIVE_CLINT if RISCV_MMODE
+ imply CMD_CPU
diff --git a/arch/riscv/cpu/qemu/cpu.c b/arch/riscv/cpu/qemu/cpu.c
index 25d97d0b41..ad2950ce40 100644
--- a/arch/riscv/cpu/qemu/cpu.c
+++ b/arch/riscv/cpu/qemu/cpu.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <dm.h>
/*
* cleanup_before_linux() is called just before we call linux
@@ -19,3 +20,16 @@ int cleanup_before_linux(void)
return 0;
}
+
+/* To enumerate devices on the /soc/ node, create a "simple-bus" driver */
+static const struct udevice_id riscv_virtio_soc_ids[] = {
+ { .compatible = "riscv-virtio-soc" },
+ { }
+};
+
+U_BOOT_DRIVER(riscv_virtio_soc) = {
+ .name = "riscv_virtio_soc",
+ .id = UCLASS_SIMPLE_BUS,
+ .of_match = riscv_virtio_soc_ids,
+ .flags = DM_FLAG_PRE_RELOC,
+};