Lines Matching +full:dts +full:- +full:node
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
63 /* Documentation/devicetree/bindings/clock/ti-clkctrl.txt */
73 { "ti,clkctrl-l4-wkup", TI_CLKCTRL_L4_WKUP },
74 { "ti,clkctrl-l4-secure", TI_CLKCTRL_L4_SECURE },
75 { "ti,clkctrl-l4-per", TI_CLKCTRL_L4_PER },
76 { "ti,clkctrl-l4-cfg", TI_CLKCTRL_L4_CFG },
102 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in ti_clkctrl_probe()
114 phandle_t node; in ti_clkctrl_attach() local
124 sc->dev = dev; in ti_clkctrl_attach()
125 node = ofw_bus_get_node(dev); in ti_clkctrl_attach()
128 err = OF_searchencprop(node, "#clock-cells", in ti_clkctrl_attach()
130 if (err == -1) { in ti_clkctrl_attach()
131 device_printf(sc->dev, "Failed to get #clock-cells\n"); in ti_clkctrl_attach()
136 device_printf(sc->dev, "clock cells(%d) != 2\n", in ti_clkctrl_attach()
142 numbytes_reg = OF_getproplen(node, "reg"); in ti_clkctrl_attach()
144 device_printf(sc->dev, "reg property empty - check your devicetree\n"); in ti_clkctrl_attach()
150 OF_getencprop(node, "reg", reg, numbytes_reg); in ti_clkctrl_attach()
153 sc->clkdom = clkdom_create(sc->dev); in ti_clkctrl_attach()
154 if (sc->clkdom == NULL) { in ti_clkctrl_attach()
156 DPRINTF(sc->dev, "Failed to create clkdom\n"); in ti_clkctrl_attach()
159 clkdom_set_ofw_mapper(sc->clkdom, clkctrl_ofw_map); in ti_clkctrl_attach()
163 clk_parse_ofw_clk_name(sc->dev, node, &org_name); in ti_clkctrl_attach()
177 /* Checkout TRM 8.1.12.1.29 - 8.1.12.31 and 8.1.12.2.3 in ti_clkctrl_attach()
178 * and the DTS. in ti_clkctrl_attach()
181 if (strcmp(org_name, "l4ls-clkctrl@38") == 0) in ti_clkctrl_attach()
183 else if (strcmp(org_name, "l4-wkup-clkctrl@0") == 0) in ti_clkctrl_attach()
204 reg_address = reg[index] + reg_offset-reg[0]; in ti_clkctrl_attach()
216 reg_address = reg[index] + reg_offset - reg[0]; in ti_clkctrl_attach()
229 err = clkdom_finit(sc->clkdom); in ti_clkctrl_attach()
231 DPRINTF(sc->dev, "Clk domain finit fails %x.\n", err); in ti_clkctrl_attach()
291 * Check out XX_CLKCTRL-INDEX(offset)-macro dance in in create_clkctrl()
292 * sys/gnu/dts/dts/include/dt-bindings/clock/am3.h in create_clkctrl()
293 * sys/gnu/dts/dts/include/dt-bindings/clock/am4.h in create_clkctrl()
294 * sys/gnu/dts/dts/include/dt-bindings/clock/dra7.h in create_clkctrl()
295 * reg[0] are in practice the same as the offset described in the dts. in create_clkctrl()
298 def.clkdef.id = reg[index] + reg_offset - reg[0] + special_gdbclk_reg; in create_clkctrl()
309 DPRINTF(sc->dev, "ti_clkctrl_attach: reg[%d]: %s %x\n", in create_clkctrl()
319 err = ti_clknode_clkctrl_register(sc->clkdom, &def); in create_clkctrl()
321 DPRINTF(sc->dev, in create_clkctrl()