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 {
时间: 2024-10-14 12:46:50

am335x usb host patch设计的相关文章

usb host鼠标不能使用原因

linux kernel 2.6.35的板子插入USB鼠标,出现如下错误LOG: [  191.177508] Plug in USB Port2 [  191.363516] usb 1-1: new full speed USB device number 10 using Mstar-ehci-2 [  191.578860] First get dev desc failed [  192.413517] usb 1-1: device not accepting address 10,

usb host和usb device

S3C2440的数据手册将USB功能分为两章--usb host和usb device.具体什么意思呢? usb host: 微处理器作为usb主设备,可以挂接U盘之类的从属设备. usb device: 微处理器作为usb从属设备,其常用作接受PC机发送的命令. 参考网页:USB Host和USB Device的区别 usb host和usb device,布布扣,bubuko.com

I.MX6Q(TQIMX6Q/TQE9)学习笔记——新版BSP之USB HOST移植

USB HOST驱动一般都是由芯片厂商维护的,因此,我们仍然只需要配置下DTS即可完成USB HOST驱动的移植. DTS配置 参考sabresd相关的DTS,在我们的DTS中添加如下内容: / { ... regulators { compatible = "simple-bus"; reg_usb_otg_vbus: usb_otg_vbus { compatible = "regulator-fixed"; regulator-name = "usb

Android USB Host与HID通讯

前端时间捣鼓一个HID的硬件, 需要和android通信, 网上搜索了一圈,收获不小. 比较好的文章是:      Android USB Host与HID通讯 Android Service创建USB HOST通信 其中代码之处有些地方需要注意的, 特此注明一下: /** * USB HOST 连接 HID * @author IVAN * */ public class MainActivity extends Activity { private static final String T

翻译Android USB HOST API

翻译Android USB HOST API 源码地址:http://developer.android.com/guide/topics/connectivity/usb/host.html 译者注:翻译的好不好不是太重要,重点是在翻译的过程中会把每句话都看认真看一遍,或者说是抱着翻译的思想来完成一个读懂的目的. USB Host通信 当你的可供电Android设备处理USB host模式时,它担任着为USB总线供电,枚举连接的USB从设备等等一个主设备应用的工作.Android 3.1及以后

Android实战技巧之四十九:Usb通信之USB Host

零 USB背景知识 USB是一种数据通信方式,也是一种数据总线,而且是最复杂的总线之一. 硬件上,它是用插头连接.一边是公头(plug),一边是母头(receptacle).例如,PC上的插座就是母头,USB设备使用公头与PC连接. 目前USB硬件接口分三种,普通PC上使用的叫Type:原来诺基亚功能机时代的接口为Mini USB:目前Android手机使用的Micro USB. Host USB是由Host端控制整个总线的数据传输的.单个USB总线上,只能有一个Host. OTG On The

【转】Android实战技巧之四十九:Usb通信之USB Host

零 USB背景知识 USB是一种数据通信方式,也是一种数据总线,而且是最复杂的总线之一. 硬件上,它是用插头连接.一边是公头(plug),一边是母头(receptacle).例如,PC上的插座就是母头,USB设备使用公头与PC连接. 目前USB硬件接口分三种,普通PC上使用的叫Type:原来诺基亚功能机时代的接口为Mini USB:目前Android手机使用的Micro USB. Host USB是由Host端控制整个总线的数据传输的.单个USB总线上,只能有一个Host. OTG On The

Using a USB host controller security extension for controlling changes in and auditing USB topology

Protecting computer systems from attacks that attempt to change USB topology and for ensuring that the system's information regarding USB topology is accurate is disclosed. A software model is defined that, together with secure USB hardware, provides

Security arrangements for extended USB protocol stack of a USB host system

Security?arrangements for a universal serial bus (USB) protocol stack of a?USB host system are provided. The?security?arrangements prevent an unauthorized or suspicious?USB?device from communicating with the host system, detect suspicious activity or