Lines Matching +full:no +full:- +full:regulator +full:- +full:enable +full:- +full:control

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 #include <dev/regulator/regulator.h>
49 #include <contrib/device-tree/include/dt-bindings/phy/phy.h>
69 {"rockchip,rk3568-pcie3-phy", 1},
87 rk3568_pciephy_bifurcate(device_t dev, int control, uint32_t lane) in rk3568_pciephy_bifurcate() argument
93 SYSCON_WRITE_4(sc->phy_grf, control, GRF_PCIE30PHY_WR_EN); in rk3568_pciephy_bifurcate()
96 SYSCON_WRITE_4(sc->phy_grf, control, in rk3568_pciephy_bifurcate()
100 SYSCON_WRITE_4(sc->phy_grf, control, in rk3568_pciephy_bifurcate()
109 (control == GRF_PCIE30PHY_CON5) ? 1 : 2); in rk3568_pciephy_bifurcate()
114 rk3568_pciephy_enable(struct phynode *phynode, bool enable) in rk3568_pciephy_enable() argument
120 if (enable) { in rk3568_pciephy_enable()
122 hwreset_deassert(sc->phy_reset); in rk3568_pciephy_enable()
125 for (count = 100; count; count--) { in rk3568_pciephy_enable()
126 if (SYSCON_READ_4(sc->phy_grf, GRF_PCIE30PHY_STATUS0) & in rk3568_pciephy_enable()
155 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in rk3568_pciephy_probe()
170 sc->dev = dev; in rk3568_pciephy_attach()
171 sc->node = ofw_bus_get_node(dev); in rk3568_pciephy_attach()
174 if (!(sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in rk3568_pciephy_attach()
181 if (OF_hasprop(sc->node, "rockchip,phy-grf") && in rk3568_pciephy_attach()
182 syscon_get_by_ofw_property(dev, sc->node, "rockchip,phy-grf", in rk3568_pciephy_attach()
183 &sc->phy_grf)) in rk3568_pciephy_attach()
186 /* Get & enable clocks */ in rk3568_pciephy_attach()
187 if (clk_get_by_ofw_name(dev, 0, "refclk_m", &sc->refclk_m)) { in rk3568_pciephy_attach()
191 if (clk_enable(sc->refclk_m)) in rk3568_pciephy_attach()
192 device_printf(dev, "enable refclk_m failed\n"); in rk3568_pciephy_attach()
193 if (clk_get_by_ofw_name(dev, 0, "refclk_n", &sc->refclk_n)) { in rk3568_pciephy_attach()
197 if (clk_enable(sc->refclk_n)) in rk3568_pciephy_attach()
198 device_printf(dev, "enable refclk_n failed\n"); in rk3568_pciephy_attach()
199 if (clk_get_by_ofw_name(dev, 0, "pclk", &sc->pclk)) { in rk3568_pciephy_attach()
203 if (clk_enable(sc->pclk)) in rk3568_pciephy_attach()
204 device_printf(dev, "enable pclk failed\n"); in rk3568_pciephy_attach()
207 if (hwreset_get_by_ofw_idx(dev, sc->node, 0, &sc->phy_reset)) { in rk3568_pciephy_attach()
210 hwreset_assert(sc->phy_reset); in rk3568_pciephy_attach()
214 /* Set bifurcation according to "data-lanes" entry */ in rk3568_pciephy_attach()
215 if (OF_hasprop(sc->node, "data-lanes")) { in rk3568_pciephy_attach()
216 OF_getencprop(sc->node, "data-lanes", data_lanes, in rk3568_pciephy_attach()
223 SYSCON_WRITE_4(sc->phy_grf, GRF_PCIE30PHY_CON9, GRF_PCIE30PHY_DA_OCM); in rk3568_pciephy_attach()
230 SYSCON_WRITE_4(sc->phy_grf, GRF_PCIE30PHY_CON1, in rk3568_pciephy_attach()
233 SYSCON_WRITE_4(sc->phy_grf, GRF_PCIE30PHY_CON1, in rk3568_pciephy_attach()
238 phy_init.ofw_node = sc->node; in rk3568_pciephy_attach()
248 sc->phynode = phynode; in rk3568_pciephy_attach()