From: Bin Meng Date: Tue, 13 Nov 2018 00:21:57 -0800 Subject: [U-Boot] [PATCH 09/19] riscv: qemu: Probe cpus during boot 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-10-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 This calls cpu_probe_all() to probe all available cpus. Signed-off-by: Bin Meng --- arch/riscv/cpu/qemu/Kconfig | 1 + arch/riscv/cpu/qemu/cpu.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/arch/riscv/cpu/qemu/Kconfig b/arch/riscv/cpu/qemu/Kconfig index ec5d934..e91cff5 100644 --- a/arch/riscv/cpu/qemu/Kconfig +++ b/arch/riscv/cpu/qemu/Kconfig @@ -4,6 +4,7 @@ config QEMU_RISCV bool + select ARCH_EARLY_INIT_R imply CPU imply CPU_RISCV imply RISCV_TIMER diff --git a/arch/riscv/cpu/qemu/cpu.c b/arch/riscv/cpu/qemu/cpu.c index 221f3a8..e98f624 100644 --- a/arch/riscv/cpu/qemu/cpu.c +++ b/arch/riscv/cpu/qemu/cpu.c @@ -4,7 +4,9 @@ */ #include +#include #include +#include /* * cleanup_before_linux() is called just before we call linux @@ -21,6 +23,18 @@ int cleanup_before_linux(void) return 0; } +int arch_early_init_r(void) +{ + int ret; + + /* probe cpus so that risc-v timer can be bound */ + ret = cpu_probe_all(); + if (ret) + return log_msg_ret("risc-v cpus probe fails\n", ret); + + 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" }, -- 2.7.4