Lines Matching +full:cell +full:- +full:index
1 // SPDX-License-Identifier: GPL-2.0
7 * of_get_cpu_hwid - Get the hardware ID from a CPU device node
9 * @cpun: CPU number(logical index) for which device node is required
16 const __be32 *cell; in of_get_cpu_hwid() local
20 cell = of_get_property(cpun, "reg", &len); in of_get_cpu_hwid()
21 if (!cell || !ac || ((sizeof(*cell) * ac * (thread + 1)) > len)) in of_get_cpu_hwid()
24 cell += ac * thread; in of_get_cpu_hwid()
25 return of_read_number(cell, ac); in of_get_cpu_hwid()
29 * arch_match_cpu_phys_id - Match the given logical CPU and physical id
31 * @cpu: logical cpu index of a core/thread
34 * CPU logical to physical index mapping is architecture specific.
36 * id to logical cpu index. phys_id provided here is usually values read
39 * Returns true if the physical identifier and the logical cpu index
55 const __be32 *cell; in __of_find_n_match_cpu_property() local
60 cell = of_get_property(cpun, prop_name, &prop_len); in __of_find_n_match_cpu_property()
61 if (!cell && !ac && arch_match_cpu_phys_id(cpu, 0)) in __of_find_n_match_cpu_property()
63 if (!cell || !ac) in __of_find_n_match_cpu_property()
65 prop_len /= sizeof(*cell) * ac; in __of_find_n_match_cpu_property()
67 hwid = of_read_number(cell, ac); in __of_find_n_match_cpu_property()
73 cell += ac; in __of_find_n_match_cpu_property()
79 * arch_find_n_match_cpu_physical_id - See if the given device node is
81 * else false. If 'thread' is non-NULL, the local thread number within the
87 /* Check for non-standard "ibm,ppc-interrupt-server#s" property in arch_find_n_match_cpu_physical_id()
93 "ibm,ppc-interrupt-server#s", in arch_find_n_match_cpu_physical_id()
101 * of_get_cpu_node - Get device node associated with the given logical CPU
103 * @cpu: CPU number(logical index) for which device node is required
108 * given logical CPU index. It should be used to initialize the of_node in
112 * CPU logical to physical index mapping is architecture specific and is built
146 return of_node_get(cpu_dev->of_node); in of_cpu_device_node_get()
155 * Return: The logical CPU number of the given CPU device_node or -ENODEV if the
172 return -ENODEV; in of_cpu_node_to_id()
177 * of_get_cpu_state_node - Get CPU's idle state node at the given index
180 * @index: The index in the list of the idle states
183 * a flattened description through the "cpu-idle-states" binding or via the
184 * hierarchical layout, using the "power-domains" and the "domain-idle-states"
186 * the requested index.
188 * Return: An idle state node if found at @index. The refcount is incremented
192 int index) in of_get_cpu_state_node() argument
197 err = of_parse_phandle_with_args(cpu_node, "power-domains", in of_get_cpu_state_node()
198 "#power-domain-cells", 0, &args); in of_get_cpu_state_node()
201 of_parse_phandle(args.np, "domain-idle-states", index); in of_get_cpu_state_node()
208 return of_parse_phandle(cpu_node, "cpu-idle-states", index); in of_get_cpu_state_node()