码迷,mamicode.com
首页 > 其他好文 > 详细

am335x usb host patch设计

时间:2015-03-19 00:47:30      阅读:640      评论:0      收藏:0      [点我收藏+]

标签:

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 {

 

am335x usb host patch设计

标签:

原文地址:http://www.cnblogs.com/zym0805/p/4349132.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!