am335x usb host patch设计

USB直接作为host时省掉一个5V的DCDC,直接连接到5V的输入上面。对于Linux SDK,需要一个patch去确保这个设计能够正常工作,patch内容请参考:

 

static struct omap_musb_board_data musb_board_data = {
    .interface_type = MUSB_INTERFACE_UTMI, /* EVM: MUSB_INTERFACE_ULPI */
    /*
     * mode[0:3] = USB0PORT's mode
     * mode[4:7] = USB1PORT's mode
     * AM335X beta EVM has USB0 in OTG mode and USB1 in host mode.
     */
/* Note: USB0 is for hub host, and USB1 should be connected with B or mini-B connector */
    .mode           = (MUSB_PERIPHERAL << 4) | MUSB_HOST,  /* EVM: (MUSB_HOST << 4) | MUSB_OTG */
    .power      = 100, /* EVM: 500 */
#endif
    .instances  = 1,
};

diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index 13bfef3..e41b224 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -288,8 +288,17 @@ void ti81xx_musb_phy_power(u8 id, u8 on , bool wkup)
                                                TI816X_USBPHY0_NORMAL_MODE;
                        usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;
                } else if (cpu_is_am33xx()) {
-                       usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN);
-                       usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN);
+                       usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN | USBPHY_OTGVDET_EN);
+
+                       /* HACK: If USB0 port is in host-only mode, clear its
+                        * USBPHY_OTGVDET_EN bit to ignore first VBUS sensing.
+                        * Change 0 to 1 if USB1 port is in host-only mode.
+                        */
+                       if (id == 0)
+                               usbphycfg |= USBPHY_OTGSESSEND_EN;
+                       else
+                               usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN);
+
                        usbwkupctrl = AM33XX_USB_WKUP_CTRL_DISABLE;
                }
        } else {

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值