本文记录添加imx6 otg host支持的过程。

参考链接

http://www.cnblogs.com/helloworldtoyou/p/6108560.html

https://community.nxp.com/thread/328351

https://community.nxp.com/thread/305646

https://community.nxp.com/thread/387529

设备配置

  • 配置引脚复用

这里遇到的问题主要是USB OTG POWER的引脚不能输出高电平,所以进行了一些修改。

arch/arm/mach-mx6/board-mx6dl_sabresd.h

#define MX6DL_ENET_PAD_CTRL_PD (PAD_CTL_PKE | PAD_CTL_PUE  |        \
PAD_CTL_PUS_100K_DOWN | PAD_CTL_SPEED_MED | \
PAD_CTL_DSE_40ohm | PAD_CTL_HYS) MX6DL_PAD_KEY_COL4__USBOH3_USBOTG_OC,
// GPIO
IOMUX_PAD(0x0650, 0x0268, 5, 0x0000, 0, MX6DL_ENET_PAD_CTRL_PD), //USB OTG POWER
MX6DL_PAD_ENET_RX_ER__ANATOP_USBOTG_ID,
  • 设备初始化

arch/arm/mach-mx6/board-mx6q_sabresd.c

#define SABRESD_USB_OTG_PWR IMX_GPIO_NR(4, 15)
#define SABRESD_USB_H1_PWR IMX_GPIO_NR(7, 0) static void imx6q_sabresd_usbotg_vbus(bool on)
{
if (on)
gpio_set_value(SABRESD_USB_OTG_PWR, 1);
else
gpio_set_value(SABRESD_USB_OTG_PWR, 0);
} static void imx6q_sabresd_host1_vbus(bool on)
{
if (on)
gpio_set_value(SABRESD_USB_H1_PWR, 1);
else
gpio_set_value(SABRESD_USB_H1_PWR, 0);
} static void __init imx6q_sabresd_init_usb(void)
{
int ret = 0; imx_otg_base = MX6_IO_ADDRESS(MX6Q_USB_OTG_BASE_ADDR);
/* disable external charger detect,
* or it will affect signal quality at dp .
*/
ret = gpio_request(SABRESD_USB_OTG_PWR, "usb-pwr");
if (ret) {
pr_err("failed to get GPIO SABRESD_USB_OTG_PWR: %d\n",
ret);
return;
}
gpio_direction_output(SABRESD_USB_OTG_PWR, 0);
// USB host1 VBUS 在我这边得硬件上直连电源,所以就不需要控制
/* keep USB host1 VBUS always on */
/*
ret = gpio_request(SABRESD_USB_H1_PWR, "usb-h1-pwr");
if (ret) {
pr_err("failed to get GPIO SABRESD_USB_H1_PWR: %d\n",
ret);
return;
}
gpio_direction_output(SABRESD_USB_H1_PWR, 0);
*/ if (board_is_mx6_reva())
mxc_iomux_set_gpr_register(1, 13, 1, 1);
else
mxc_iomux_set_gpr_register(1, 13, 1, 0); mx6_set_otghost_vbus_func(imx6q_sabresd_usbotg_vbus);
//mx6_set_host1_vbus_func(imx6q_sabresd_host1_vbus);
}

kernel config配置

这里只记录部分,配置完成,usb host就可以使用,不过slave还需要调试。

CONFIG_USB_EHCI_ARC_OTG=y
CONFIG_USB_EHCI_ARC_HSIC=y CONFIG_USB_OTG=y
CONFIG_MXC_OTG=y CONFIG_USB_SUSPEND=n

Tony Liu

2016-11-28, Shenzhen

imx6 otg host support的更多相关文章

  1. imx6 关闭 otg host

    参考文档: http://www.cnblogs.com/zengjfgit/p/4711336.html make menuconfig 去掉Support for DR host port on ...

  2. imx6 usb otg config 配置

    imx6 usb的host和slave配置,配置之后,安装gadget模块,就能够在host和slave之间切换. 参考文档: i.MX 6Dual/6Quad Linux Reference Man ...

  3. I.MX6 OTG set as slave device hacking

    /****************************************************************************** * IMX6 OTG set as sl ...

  4. Tomcat翻译--The Host Container

    原文:http://tomcat.apache.org/tomcat-7.0-doc/config/host.html Introduction(介绍) The Host element repres ...

  5. 小白自制Linux开发板 七. USB驱动配置

    本文章基于https://whycan.com/t_3087.htmlhttps://whycan.com/t_6021.html整理 F1c100s芯片支持USB的OTG模式,也就是可以通过更改Us ...

  6. [未完] Linux 4.4 USB —— spiflash模拟usb大容量存储设备 调试记录 Gadget Mass Stroage

    linux 4.4 USB Gadget Mass Stroage 硬件平台: licheepi nano衍生 调试记录 驱动信息 │ This driver is a replacement for ...

  7. squid源码安装下的conf文件默认值和提示

    #    WELCOME TO SQUID 3.0.STABLE26#    ----------------------------##    This is the default Squid c ...

  8. Ubuntu 14.04 AM335x TI-RTOS 编译

    /************************************************************************************* * Ubuntu 14.0 ...

  9. ti processor sdk linux am335x evm /bin/setup-package-install.sh hacking

    #!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-package-install.sh hacking # 说明: # 本文主要对T ...

随机推荐

  1. [Java] StringBuffer类

    http://www.cnblogs.com/springcsc/archive/2009/12/03/1616330.html 注: StringBuffer类和String一样,也用来代表字符串, ...

  2. ubuntu下Vim配色方案Solarized的配置

    系统:ubuntu 12.04 LTS vim版本:7.4 ---------------------------------------------------------------------- ...

  3. iOS5中UIViewController的新方法

    iOS5中UIViewController的新方法 前言 在苹果的 WWDC2011 大会视频的<Session 101 - What's New in Cocoa> 和<Sessi ...

  4. OpenCV show two cameras 同时显示两个摄像头

    用OpenCV同时显示两个摄像头的内容的代码如下: #include <iostream> #include <stdio.h> #include <tchar.h> ...

  5. Configuration of OpenCV2.1.0 with VS2010

    Add in the system Path: C:\Program Files (x86)\OpenCV-2.1.0\build\bin\Debug Project->Project Prop ...

  6. the thread has exited with code -1073741819

    内存分配异常.无效或冲突.指针存在但指向无效内存区域.

  7. 关于在jquery动态修改css,html中,mouseenter,mouseleave,click等方法失效的处理

  8. Oracle 语句常见错误

    Merge into的注意点之ORA-30926:无法在源表中获得一组稳定的行? merge into 的内部处理是将table_source 的每一条记录和table_target的每一条记录对比匹 ...

  9. linux下搭建SVN服务器完全手册【摘抄】

    系统环境        RHEL5.4最小化安装(关iptables,关selinux) + ssh + yum 一,安装必须的软件包.        yum install subversion ( ...

  10. 11号了,还有三天上线-改bug

    +(NSDictionary *)replacedKeyFromPropertyName { return  @{ @"doctorId": @"id" }; ...