FreeBSD/sys/arm/ti/usb/omap_ehci.c
/**
 *	omap_ehci_soft_phy_reset - resets the phy using the reset command
 *	@isc: omap ehci device context
 *	@port: port to send the reset over
 *	
 *
 *	LOCKING:
 *	none
 *
 *	RETURNS:
 *	nothing
 */
resets the phy using the reset command
@isc: omap ehci device context
@port: port to send the reset over

none

nothing
resets the phy using the reset command @isc : omap ehci device context @port : port to send the reset over none nothing
static void 
omap_ehci_soft_phy_reset(struct omap_ehci_softc *isc, unsigned int port)
{
	unsigned long timeout = (hz < 10) ? 1 : ((100 * hz) / 1000);
	uint32_t reg;
	reg = ULPI_FUNC_CTRL_RESET
		| (ULPI_SET(ULPI_FUNC_CTRL) << OMAP_USBHOST_INSNREG05_ULPI_REGADD_SHIFT)
		| (2 << OMAP_USBHOST_INSNREG05_ULPI_OPSEL_SHIFT)
		| ((port + 1) << OMAP_USBHOST_INSNREG05_ULPI_PORTSEL_SHIFT)
		| (1 << OMAP_USBHOST_INSNREG05_ULPI_CONTROL_SHIFT);
	omap_ehci_write_4(isc, OMAP_USBHOST_INSNREG05_ULPI, reg);
	while ((omap_ehci_read_4(isc, OMAP_USBHOST_INSNREG05_ULPI)
	       & (1 << OMAP_USBHOST_INSNREG05_ULPI_CONTROL_SHIFT))) {
		pause("USBPHY_RESET", 1);
		if (timeout-- == 0) {
			device_printf(isc->sc_dev, "PHY reset operation timed out\n");
			break;
		}
	}
}
static void omap_ehci_soft_phy_reset ( struct omap_ehci_softc * isc , unsigned int port ) { unsigned long timeout = ( hz < 10 ) ? 1 : ( ( 100 * hz ) / 1000 ) ; uint32_t reg ; reg = ULPI_FUNC_CTRL_RESET | ( ULPI_SET ( ULPI_FUNC_CTRL ) << OMAP_USBHOST_INSNREG05_ULPI_REGADD_SHIFT ) | ( 2 << OMAP_USBHOST_INSNREG05_ULPI_OPSEL_SHIFT ) | ( ( port + 1 ) << OMAP_USBHOST_INSNREG05_ULPI_PORTSEL_SHIFT ) | ( 1 << OMAP_USBHOST_INSNREG05_ULPI_CONTROL_SHIFT ) ; omap_ehci_write_4 ( isc , OMAP_USBHOST_INSNREG05_ULPI , reg ) ; while ( ( omap_ehci_read_4 ( isc , OMAP_USBHOST_INSNREG05_ULPI ) & ( 1 << OMAP_USBHOST_INSNREG05_ULPI_CONTROL_SHIFT ) ) ) { pause ( " " , 1 ) ; if ( timeout -- == 0 ) { device_printf ( isc -> sc_dev , " \n " ) ; break ; } } }
omap_ehci_soft_phy_reset - resets the phy using the reset command
      @isc: omap ehci device context
      @port: port to send the reset over
omap_ehci_soft_phy_reset - resets the phy using the reset command @isc : omap ehci device context @port : port to send the reset over
/* FUNCTION_CTRL_SET register */ /* Write */ /* PORTn */ /* start ULPI access*/ /* Wait for ULPI access completion */ /* Sleep for a tick */