Lines Matching +full:dt +full:- +full:node

1 // SPDX-License-Identifier: GPL-2.0-only
12 * Returns the hart ID of the given device tree node, or -ENODEV if the node
13 * isn't an enabled and valid RISC-V hart node.
15 int riscv_of_processor_hartid(struct device_node *node) in riscv_of_processor_hartid() argument
20 if (!of_device_is_compatible(node, "riscv")) { in riscv_of_processor_hartid()
22 return -ENODEV; in riscv_of_processor_hartid()
25 if (of_property_read_u32(node, "reg", &hart)) { in riscv_of_processor_hartid()
27 return -ENODEV; in riscv_of_processor_hartid()
30 if (!of_device_is_available(node)) { in riscv_of_processor_hartid()
32 return -ENODEV; in riscv_of_processor_hartid()
35 if (of_property_read_string(node, "riscv,isa", &isa)) { in riscv_of_processor_hartid()
37 return -ENODEV; in riscv_of_processor_hartid()
41 return -ENODEV; in riscv_of_processor_hartid()
48 * Find hart ID of the CPU DT node under which given DT node falls.
50 * To achieve this, we walk up the DT tree until we find an active
51 * RISC-V core (HART) node and extract the cpuid from it.
53 int riscv_of_parent_hartid(struct device_node *node) in riscv_of_parent_hartid() argument
55 for (; node; node = node->parent) { in riscv_of_parent_hartid()
56 if (of_device_is_compatible(node, "riscv")) in riscv_of_parent_hartid()
57 return riscv_of_processor_hartid(node); in riscv_of_parent_hartid()
60 return -1; in riscv_of_parent_hartid()
89 *pos = cpumask_next(*pos - 1, cpu_online_mask); in c_start()
107 unsigned long cpu_id = (unsigned long)v - 1; in c_show()
108 struct device_node *node = of_get_cpu_node(cpu_id, NULL); in c_show() local
113 if (!of_property_read_string(node, "riscv,isa", &isa)) in c_show()
115 if (!of_property_read_string(node, "mmu-type", &mmu)) in c_show()
117 if (!of_property_read_string(node, "compatible", &compat) in c_show()
121 of_node_put(node); in c_show()