Lines Matching +full:syscon +full:- +full:clk

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
39 #include <dev/clk/clk.h>
43 #include <dev/syscon/syscon.h>
47 #include <dev/syscon/syscon.h>
67 #define WR4(_sc, _r, _v) bus_write_4((_sc)->mem_res, (_r), (_v))
68 #define RD4(_sc, _r) bus_read_4((_sc)->mem_res, (_r))
72 {"rockchip,rk3288-usb-phy", 1},
84 clk_t clk; member
87 struct syscon *syscon; member
98 rv = SYSCON_MODIFY_4(sc->syscon, in rk_phynode_phy_enable()
99 sc->base + UOC_CON0, in rk_phynode_phy_enable()
113 *mode = sc->mode; in rk_phynode_get_mode()
123 sc->mode = mode; in rk_phynode_set_mode()
147 clk_t clk; in rk_usbphy_init_phy() local
150 struct syscon *syscon; in rk_usbphy_init_phy() local
152 clk = NULL; in rk_usbphy_init_phy()
158 device_printf(sc->dev, "cannot get 'reg' property.\n"); in rk_usbphy_init_phy()
163 rv = clk_get_by_ofw_name(sc->dev, node, "phyclk", &clk); in rk_usbphy_init_phy()
165 device_printf(sc->dev, "cannot get 'phyclk' clock.\n"); in rk_usbphy_init_phy()
168 rv = hwreset_get_by_ofw_name(sc->dev, node, "phy-reset", &hwreset); in rk_usbphy_init_phy()
170 device_printf(sc->dev, "Cannot get 'phy-reset' reset\n"); in rk_usbphy_init_phy()
173 rv = regulator_get_by_ofw_property(sc->dev, node, "vbus-supply", in rk_usbphy_init_phy()
176 device_printf(sc->dev, "Cannot get 'vbus' regulator.\n"); in rk_usbphy_init_phy()
180 rv = SYSCON_GET_HANDLE(sc->dev, &syscon); in rk_usbphy_init_phy()
182 device_printf(sc->dev, "Cannot get parent syscon\n"); in rk_usbphy_init_phy()
190 device_printf(sc->dev, "Cannot assert reset\n"); in rk_usbphy_init_phy()
194 if (clk != NULL) { in rk_usbphy_init_phy()
195 rv = clk_enable(clk); in rk_usbphy_init_phy()
197 device_printf(sc->dev, in rk_usbphy_init_phy()
206 device_printf(sc->dev, "Cannot deassert reset\n"); in rk_usbphy_init_phy()
215 phynode = phynode_create(sc->dev, &rk_phynode_class, &phy_init); in rk_usbphy_init_phy()
217 device_printf(sc->dev, "Cannot create phy.\n"); in rk_usbphy_init_phy()
222 phy_sc->base = base; in rk_usbphy_init_phy()
223 phy_sc->clk = clk; in rk_usbphy_init_phy()
224 phy_sc->hwreset = hwreset; in rk_usbphy_init_phy()
225 phy_sc->supply_vbus = supply_vbus; in rk_usbphy_init_phy()
226 phy_sc->syscon = syscon; in rk_usbphy_init_phy()
228 device_printf(sc->dev, "Cannot register phy.\n"); in rk_usbphy_init_phy()
238 if (clk != NULL) in rk_usbphy_init_phy()
239 clk_release(clk); in rk_usbphy_init_phy()
253 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in rk_usbphy_probe()
268 sc->dev = dev; in rk_usbphy_attach()
269 node = ofw_bus_get_node(sc->dev); in rk_usbphy_attach()