/* Enable the usb0 phy. This initialization procedure is explained in the DA8xx USB user guide document.  */
static u8 phy_on(void)
/* Enable the usb0 phy. This initialization procedure is explained in the DA8xx USB user guide document.  */
static u8 phy_on(void)
{
	u32 timeout;
	u32 cfgchip2;
	cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
	cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN |
		      CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
	cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON |
		    CFGCHIP2_REFFREQ_24MHZ;
	writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
	timeout = musb_cfg.timeout;
	while (timeout--)
		if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
			return 1;
	return 0;
}