Exemple #1
0
void usb_phy_switch_to_usb(void)
{
	usb_enable_clock(true);
    udelay(50);
	/* clear force_uart_en */
	USBPHY_WRITE8(0x6B, 0x00);
    usb_enable_clock(false);
	usb_phy_poweron();
	/* disable the USB clock turned on in usb_phy_poweron() */
    usb_enable_clock(false);
}
Exemple #2
0
void usb_phy_switch_to_usb(void)
{
	/* GPIO Selection */
	DRV_WriteReg32(UART1_BASE + 0x90, 0x0);	//set

    usb_enable_clock(true);
    udelay(50);
	/* clear force_uart_en */
	USBPHY_WRITE8(0x6B, 0x00);
    usb_enable_clock(false);
	usb_phy_poweron();
	/* disable the USB clock turned on in usb_phy_poweron() */
    usb_enable_clock(false);
}
void musb_otg_reset_usb(void){
    //reset all of the USB IP, including PHY and MAC
    unsigned int usb_reset;
    usb_reset = __raw_readl(PERICFG_BASE);
    usb_reset |= 1<<29;
    __raw_writel(usb_reset,PERICFG_BASE);
    mdelay(10);
    usb_reset &= ~(1<<29);
    __raw_writel(usb_reset,PERICFG_BASE);
    //power on the USB
    usb_phy_poweron();
    //enable interrupt
    musb_writel(mtk_musb->mregs,USB_L1INTM,0x105);
    musb_writew(mtk_musb->mregs,MUSB_INTRTXE,1);
    musb_writeb(mtk_musb->mregs,MUSB_INTRUSBE,0xf7);
}
void usb_phy_switch_to_usb(void)
{
	/* GPIO Selection */
	DRV_WriteReg32(ap_uart0_base + 0xB0, 0x0);

	usb_enable_clock(true);
	udelay(50);
	/* clear force_uart_en */
	USBPHY_WRITE8(0x6B, 0x00);
	usb_enable_clock(false);
	usb_phy_poweron();
	/* disable the USB clock turned on in usb_phy_poweron() */
	usb_enable_clock(false);

	DBG(0, "Unmask PMIC charger detection in USB mode.\n");
	pmic_chrdet_int_en(1);
}
Exemple #5
0
void usb_phy_switch_to_usb(void)
{
	/* GPIO Selection */
	//DRV_WriteReg32(GPIO_BASE + 0x508, 0x10);		//set
    mtk_uart_usb_rx_sel(1, 0);
    usb_enable_clock(true);
    udelay(50);
	/* clear force_uart_en */
	USBPHY_WRITE8(0x6B, 0x00);
    usb_enable_clock(false);
	usb_phy_poweron();
	/* disable the USB clock turned on in usb_phy_poweron() */
    usb_enable_clock(false);

    usb_port_mode_temp = 0;
    printk("usb port value in usb function:%d\n", usb_port_mode_temp);
}
void usb_phy_switch_to_usb(void)
{
	/* Disable UART */
	DRV_WriteReg32(GPIO_BASE_1 + 0x11C, 0x02);	//clear
	/* set uart rx path for K2 use */
	//mtk_uart_usb_rx_sel(1, 0);
	usb_enable_clock(true);
	udelay(50);
	/* clear force_uart_en */
	USBPHY_WRITE8(0x6B, 0x00);
	usb_enable_clock(false);
	usb_phy_poweron();
	/* disable the USB clock turned on in usb_phy_poweron() */
	usb_enable_clock(false);

	usb_port_mode_temp = 0;

	printk("usb port value in usb function:%d\n", usb_port_mode_temp);
}
Exemple #7
0
void usb_phy_switch_to_usb(void)
{
	usb_enable_clock(true);
	if (!usb_phy_check_in_uart_mode())
		return;
		
	cur_usb_mode = USB_MODE;
		
	/* GPIO Selection */
	DRV_WriteReg32(GPIO_BASE + 0x508, 0x20);	//clear
	mdelay(200);
	
	/*cler force_uart_xxx*/  
	USBPHY_WRITE8(0x6B, 0x00);
	
	/* EN_PU_DM = 0*/
	USBPHY_CLR8(0x1d, 0x18);
	usb_enable_clock(false);
	
	udelay(1000);
	usb_phy_poweron();
}