mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 22:36:05 +00:00
riscv: cpu: Skip unavailable hart in the get_count() op
We should not count in hart that is marked as not available in the device tree in riscv_cpu_get_count(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
This commit is contained in:
parent
d22c8be964
commit
4dfea4b5cd
1 changed files with 4 additions and 0 deletions
|
@ -46,6 +46,10 @@ static int riscv_cpu_get_count(struct udevice *dev)
|
||||||
ofnode_for_each_subnode(node, dev_ofnode(dev->parent)) {
|
ofnode_for_each_subnode(node, dev_ofnode(dev->parent)) {
|
||||||
const char *device_type;
|
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");
|
device_type = ofnode_read_string(node, "device_type");
|
||||||
if (!device_type)
|
if (!device_type)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue