Lines Matching refs:fdt
16 TEE_Result clk_dt_get_by_name(const void *fdt, int nodeoffset, in clk_dt_get_by_name() argument
21 clk_id = fdt_stringlist_search(fdt, nodeoffset, "clock-names", name); in clk_dt_get_by_name()
27 return clk_dt_get_by_index(fdt, nodeoffset, clk_id, clk); in clk_dt_get_by_name()
30 static TEE_Result clk_dt_get_by_idx_prop(const char *prop_name, const void *fdt, in clk_dt_get_by_idx_prop() argument
37 res = dt_driver_device_from_node_idx_prop(prop_name, fdt, nodeoffset, in clk_dt_get_by_idx_prop()
46 TEE_Result clk_dt_get_by_index(const void *fdt, int nodeoffset, in clk_dt_get_by_index() argument
49 return clk_dt_get_by_idx_prop("clocks", fdt, nodeoffset, clk_idx, clk); in clk_dt_get_by_index()
54 static TEE_Result clk_probe_clock_provider_node(const void *fdt, int node);
56 static TEE_Result parse_clock_property(const void *fdt, int node) in parse_clock_property() argument
66 prop = fdt_getprop(fdt, node, "clocks", &len); in parse_clock_property()
74 parent_node = fdt_node_offset_by_phandle(fdt, phandle); in parse_clock_property()
79 res = clk_probe_clock_provider_node(fdt, parent_node); in parse_clock_property()
82 fdt_get_name(fdt, parent_node, NULL), in parse_clock_property()
83 fdt_get_name(fdt, node, NULL), res); in parse_clock_property()
87 clock_cells = fdt_get_dt_driver_cells(fdt, parent_node, in parse_clock_property()
98 static TEE_Result clk_probe_clock_provider_node(const void *fdt, int node) in clk_probe_clock_provider_node() argument
104 status = fdt_get_status(fdt, node); in clk_probe_clock_provider_node()
109 if (!fdt_getprop(fdt, node, "#clock-cells", &len)) in clk_probe_clock_provider_node()
117 res = parse_clock_property(fdt, node); in clk_probe_clock_provider_node()
121 return dt_driver_probe_device_by_node(fdt, node, DT_DRIVER_CLK); in clk_probe_clock_provider_node()
124 static void clk_probe_node(const void *fdt, int parent_node) in clk_probe_node() argument
130 fdt_for_each_subnode(child, fdt, parent_node) { in clk_probe_node()
131 status = fdt_get_status(fdt, child); in clk_probe_node()
135 res = clk_probe_clock_provider_node(fdt, child); in clk_probe_node()
138 clk_probe_node(fdt, child); in clk_probe_node()
142 static void parse_assigned_clock(const void *fdt, int nodeoffset) in parse_assigned_clock() argument
152 rate_prop = fdt_getprop(fdt, nodeoffset, "assigned-clock-rates", in parse_assigned_clock()
157 res = clk_dt_get_by_idx_prop("assigned-clocks", fdt, nodeoffset, in parse_assigned_clock()
163 res = clk_dt_get_by_idx_prop("assigned-clock-parents", fdt, in parse_assigned_clock()
184 static void clk_probe_assigned(const void *fdt, int parent_node) in clk_probe_assigned() argument
190 fdt_for_each_subnode(child, fdt, parent_node) { in clk_probe_assigned()
191 clk_probe_assigned(fdt, child); in clk_probe_assigned()
193 status = fdt_get_status(fdt, child); in clk_probe_assigned()
197 if (fdt_getprop(fdt, child, "assigned-clocks", &len)) in clk_probe_assigned()
198 parse_assigned_clock(fdt, child); in clk_probe_assigned()
204 const void *fdt = get_secure_dt(); in clk_dt_probe() local
207 if (!fdt) in clk_dt_probe()
210 clk_probe_node(fdt, -1); in clk_dt_probe()
212 clk_probe_assigned(fdt, -1); in clk_dt_probe()