| 954 | } |
| 955 | |
| 956 | struct rt_ofw_node *rt_ofw_get_cpu_state_node(struct rt_ofw_node *cpu_np, int index) |
| 957 | { |
| 958 | struct rt_ofw_cell_args args; |
| 959 | struct rt_ofw_node *np = RT_NULL, *state_np; |
| 960 | rt_err_t err = rt_ofw_parse_phandle_cells(cpu_np, "power-domains", "#power-domain-cells", 0, &args); |
| 961 | |
| 962 | if (!err) |
| 963 | { |
| 964 | state_np = rt_ofw_parse_phandle(args.data, "domain-idle-states", index); |
| 965 | |
| 966 | rt_ofw_node_put(args.data); |
| 967 | |
| 968 | if (state_np) |
| 969 | { |
| 970 | np = state_np; |
| 971 | } |
| 972 | } |
| 973 | |
| 974 | if (!np) |
| 975 | { |
| 976 | int count = 0; |
| 977 | rt_uint32_t phandle; |
| 978 | const fdt32_t *cell; |
| 979 | struct rt_ofw_prop *prop; |
| 980 | |
| 981 | rt_ofw_foreach_prop_u32(cpu_np, "cpu-idle-states", prop, cell, phandle) |
| 982 | { |
| 983 | if (count == index) |
| 984 | { |
| 985 | np = rt_ofw_find_node_by_phandle((rt_phandle)phandle); |
| 986 | |
| 987 | break; |
| 988 | } |
| 989 | |
| 990 | ++count; |
| 991 | } |
| 992 | } |
| 993 | |
| 994 | return np; |
| 995 | } |
| 996 | |
| 997 | rt_uint64_t rt_ofw_get_cpu_id(struct rt_ofw_node *cpu_np) |
| 998 | { |
nothing calls this directly
no test coverage detected