Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/controller/dwc3.c
Context not available. | |||||
snps_dwc3_common_attach(device_t dev, bool is_fdt) | snps_dwc3_common_attach(device_t dev, bool is_fdt) | ||||
{ | { | ||||
struct snps_dwc3_softc *sc; | struct snps_dwc3_softc *sc; | ||||
#ifdef FDT | |||||
phandle_t node; | |||||
phy_t usb2_phy, usb3_phy; | |||||
#endif | |||||
int error, rid; | int error, rid; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
Context not available. | |||||
#endif | #endif | ||||
#ifdef FDT | #ifdef FDT | ||||
if (!is_fdt) | if (is_fdt) { | ||||
goto skip_phys; | phy_t usb2_phy, usb3_phy; | ||||
phandle_t node; | |||||
uint32_t reg; | |||||
/* Get the phys */ | node = ofw_bus_get_node(dev); | ||||
node = ofw_bus_get_node(dev); | usb2_phy = usb3_phy = NULL; | ||||
error = phy_get_by_ofw_name(dev, node, "usb2-phy", &usb2_phy); | |||||
usb2_phy = usb3_phy = NULL; | if (error == 0 && usb2_phy != NULL) | ||||
error = phy_get_by_ofw_name(dev, node, "usb2-phy", &usb2_phy); | phy_enable(usb2_phy); | ||||
if (error == 0 && usb2_phy != NULL) | error = phy_get_by_ofw_name(dev, node, "usb3-phy", &usb3_phy); | ||||
phy_enable(usb2_phy); | if (error == 0 && usb3_phy != NULL) | ||||
error = phy_get_by_ofw_name(dev, node, "usb3-phy", &usb3_phy); | phy_enable(usb3_phy); | ||||
if (error == 0 && usb3_phy != NULL) | else { | ||||
phy_enable(usb3_phy); | reg = DWC3_READ(sc, DWC3_GUCTL1); | ||||
if (bootverbose) | |||||
snps_dwc3_configure_phy(sc, node); | device_printf(dev, "Forcing USB2 clock only\n"); | ||||
skip_phys: | reg |= DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK; | ||||
DWC3_WRITE(sc, DWC3_GUCTL1, reg); | |||||
} | |||||
snps_dwc3_configure_phy(sc, node); | |||||
} | |||||
#endif | #endif | ||||
snps_dwc3_reset(sc); | snps_dwc3_reset(sc); | ||||
Context not available. |