diff --git a/drivers/cpu/riscv_cpu.c b/drivers/cpu/riscv_cpu.c index f77c1264996..28ad0aa30fd 100644 --- a/drivers/cpu/riscv_cpu.c +++ b/drivers/cpu/riscv_cpu.c @@ -46,6 +46,10 @@ static int riscv_cpu_get_count(struct udevice *dev) ofnode_for_each_subnode(node, dev_ofnode(dev->parent)) { const char *device_type; + /* skip if hart is marked as not available in the device tree */ + if (!ofnode_is_available(node)) + continue; + device_type = ofnode_read_string(node, "device_type"); if (!device_type) continue;