Lines Matching +full:sun50i +full:- +full:h6 +full:- +full:usb3 +full:- +full:phy

3 /*-
48 #include <dev/phy/phy_usb.h>
73 #define __LOWEST_SET_BIT(__mask) ((((__mask) - 1) & (__mask)) ^ (__mask))
77 { "allwinner,sun50i-h6-usb3-phy", 1 },
83 { -1, 0 }
92 /* Phy class and methods. */
93 static int awusb3phy_phy_enable(struct phynode *phy, bool enable);
94 static int awusb3phy_get_mode(struct phynode *phy, int *mode);
95 static int awusb3phy_set_mode(struct phynode *phy, int mode);
123 val = RD4(sc->res, USB3PHY_PHY_EXTERNAL_CONTROL); in awusb3phy_phy_enable()
129 WR4(sc->res, USB3PHY_PHY_EXTERNAL_CONTROL, val); in awusb3phy_phy_enable()
131 val = RD4(sc->res, USB3PHY_PIPE_CLOCK_CONTROL); in awusb3phy_phy_enable()
135 WR4(sc->res, USB3PHY_PIPE_CLOCK_CONTROL, val); in awusb3phy_phy_enable()
137 val = RD4(sc->res, USB3PHY_APP); in awusb3phy_phy_enable()
141 WR4(sc->res, USB3PHY_APP, val); in awusb3phy_phy_enable()
143 WR4(sc->res, USB3PHY_PHY_TUNE_LOW, PTL_MAGIC); in awusb3phy_phy_enable()
145 val = RD4(sc->res, USB3PHY_PHY_TUNE_HIGH); in awusb3phy_phy_enable()
156 WR4(sc->res, USB3PHY_PHY_TUNE_HIGH, val); in awusb3phy_phy_enable()
158 if (sc->reg) in awusb3phy_phy_enable()
159 error = regulator_enable(sc->reg); in awusb3phy_phy_enable()
161 if (sc->reg) in awusb3phy_phy_enable()
162 error = regulator_disable(sc->reg); in awusb3phy_phy_enable()
167 "couldn't %s regulator for phy\n", in awusb3phy_phy_enable()
184 *mode = sc->mode; in awusb3phy_get_mode()
201 sc->mode = mode; in awusb3phy_set_mode()
212 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in awusb3phy_probe()
233 if (bus_alloc_resources(dev, aw_usb3phy_spec, &sc->res) != 0) { in awusb3phy_attach()
248 /* De-assert resets */ in awusb3phy_attach()
252 device_printf(dev, "couldn't de-assert reset %d\n", in awusb3phy_attach()
259 regulator_get_by_ofw_property(dev, node, "phy-supply", &sc->reg); in awusb3phy_attach()
261 /* Create the phy */ in awusb3phy_attach()
266 device_printf(dev, "failed to create USB PHY\n"); in awusb3phy_attach()
270 device_printf(dev, "failed to create USB PHY\n"); in awusb3phy_attach()