mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-18 14:48:17 +01:00
riscv: Probe cpus during boot
This calls cpu_probe_all() to probe all available cpus. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
92b64fef05
commit
39cad5bc0b
@ -4,6 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <cpu.h>
|
||||||
|
#include <log.h>
|
||||||
#include <asm/csr.h>
|
#include <asm/csr.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -53,3 +55,27 @@ int print_cpuinfo(void)
|
|||||||
|
|
||||||
return 0;
|
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();
|
||||||
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
config QEMU_RISCV
|
config QEMU_RISCV
|
||||||
bool
|
bool
|
||||||
|
select ARCH_EARLY_INIT_R
|
||||||
imply CPU
|
imply CPU
|
||||||
imply CPU_RISCV
|
imply CPU_RISCV
|
||||||
imply RISCV_TIMER
|
imply RISCV_TIMER
|
||||||
|
Loading…
x
Reference in New Issue
Block a user