From: Bin Meng Date: Tue, 11 Dec 2018 23:11:13 -0800 Subject: [U-Boot] [PATCH v4 12/25] riscv: Probe cpus during boot In-Reply-To: <1544598686-14130-1-git-send-email-bmeng.cn@gmail.com> References: <1544598686-14130-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1544598686-14130-13-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 Reviewed-by: Lukas Auer --- Changes in v4: None Changes in v3: - probe cpus in the pre-relocation stage too Changes in v2: - move to arch/riscv/cpu/cpu.c arch/riscv/cpu/cpu.c | 26 ++++++++++++++++++++++++++ arch/riscv/cpu/qemu/Kconfig | 1 + 2 files changed, 27 insertions(+) diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c index d9f820c..8286a0c 100644 --- a/arch/riscv/cpu/cpu.c +++ b/arch/riscv/cpu/cpu.c @@ -4,6 +4,8 @@ */ #include +#include +#include #include /* @@ -53,3 +55,27 @@ int print_cpuinfo(void) return 0; } + +static int riscv_cpu_probe(void) +{ +#ifdef CONFIG_CPU + 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 failed\n", ret); +#endif + + return 0; +} + +int arch_cpu_init_dm(void) +{ + return riscv_cpu_probe(); +} + +int arch_early_init_r(void) +{ + return riscv_cpu_probe(); +} diff --git a/arch/riscv/cpu/qemu/Kconfig b/arch/riscv/cpu/qemu/Kconfig index 2e953e1..f48751e 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 -- 2.7.4