From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Tue, 13 Nov 2018 00:21:51 -0800 Subject: [U-Boot] [PATCH 03/19] riscv: qemu: Create a simple-bus driver for the soc node In-Reply-To: <1542097327-6629-1-git-send-email-bmeng.cn@gmail.com> References: <1542097327-6629-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1542097327-6629-4-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de To enumerate devices on the /soc/ node, create a "simple-bus" driver to match "riscv-virtio-soc". Signed-off-by: Bin Meng --- arch/riscv/cpu/qemu/cpu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/riscv/cpu/qemu/cpu.c b/arch/riscv/cpu/qemu/cpu.c index 6c7a327..221f3a8 100644 --- a/arch/riscv/cpu/qemu/cpu.c +++ b/arch/riscv/cpu/qemu/cpu.c @@ -4,6 +4,7 @@ */ #include +#include /* * cleanup_before_linux() is called just before we call linux @@ -19,3 +20,15 @@ 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, +}; -- 2.7.4