适用于am335x的USB大容量存储驱动程序 [英] usb Mass Storage driver for am335x

查看:524
本文介绍了适用于am335x的USB大容量存储驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想存放一个USB驱动器存储模块,以便在加载USB大容量存储模块时使USB驱动器在/media或/dev/sda1中检测到

i want to loard a usb drive storage module so i make when i load usb mass storage module the usb drive detect in /media or /dev/sda1

我有一个使用am335x处理器的定制bord,并且该板有一个USB端口(用于USB驱动器连接器)和一个micro USB端口.并且也有内核源代码,版本是4.4.16现在我按照命令编译内核源代码

I have one customized bord using an am335x processor and this board has one USB port(for USB drive connector) and one micro USB port. and also have kernel source code and version is 4.4.16 now i follow the command to compile kernel source code

make distclean CROSS_COMPILE=arm-linux-gnueabihf-
make am335x_fujitel_defconfig CROSS_COMPILE=arm-linux-gnueabihf-

note = am335x_fujitel_defconfig是根据我的bord及其后类型编辑的defconfig文件 制作menuconfig

note= am335x_fujitel_defconfig is my edited defconfig file according to my bord and after that type make menuconfig

原因是我想制作USB存储驱动器的模块,以便我可以先安装模块以将USB驱动器连接到设备 因此,我点击此链接 https://processors.wiki.ti.com/index .php/Usbgeneralpage#Mass_Storage_Gadget 作为参考 并更改一些驱动程序配置.

The reason is I want to make module of USB storage driver so i can install module first to connect my usb drive to the device so i follow this link https://processors.wiki.ti.com/index.php/Usbgeneralpage#Mass_Storage_Gadget as reference and changes some driver configurations.

我发现当我取消选中时

< > Inventra Highspeed Dual Role Controller (TI, ADI, AW, ...)                                                                   
     MUSB Mode Selection (Dual Role mode)  ---> 

我的USB驱动器无法在我的设备上运行,因此我为Inventra高速双角色控制器创建模块'm'并生成musb-hdrc.ko文件

my usb drive not work on my device so I make module 'm' for Inventra Highspeed Dual Role Controller and generate musb-hdrc.ko file

我将新的zImage和/lib/module/4/4/16加载到板上,并在/lib ...目录中找到.ko文件

I load new zImage and /lib/module/4/4/16 to my board and found .ko file in /lib... directory

root@arm:~# ls /lib/modules/4.4.16/kernel/drivers/usb/musb/musb_hdrc.ko 

现在运行"modprobe musb-hdrc"命令并写入"musb_hdrc" vi/etc/modules-load.d/modules.conf 上面的命令成功运行,没有看到任何错误 在重启之后,板运行"lsmod".命令以确保模块是否已加载

Now run "modprobe musb-hdrc" command and write "musb_hdrc" vi /etc/modules-load.d/modules.conf above command run successfully and not see any error after that reboot, the board run "lsmod" command to the sure module is load or not

root@arm:~# lsmod 
Module                  Size  Used by    Not tainted
bridge                 87777  0 
stp                     2111  1 bridge
llc                     5184  2 bridge,stp
usb_f_rndis            21887  2 
usb_f_ecm               9211  2 
u_ether                11816  2 usb_f_rndis,usb_f_ecm
libcomposite           42715 16 usb_f_rndis,usb_f_ecm
omap_sham              22202  0 
omap_aes_driver        19511  0 
omap_rng                4212  0 
rng_core                7198  1 omap_rng
musb_hdrc              78777  0 

musb_hdrc加载成功.但是,当我将USB驱动器连接到USB端口时,我的USB驱动器未安装在/media中,也无法在/dev上显示为什么?我错过了什么吗?我也检查Kconfig文件

musb_hdrc load is successful.BUT when I connect my USB drive to USB port my USB drive not mount in /media also not show me at /dev why ?? am I missing something ?? also i check Kconfig file

 config USB_MUSB_HDRC
  tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, AW, ...)'
  depends on (USB || USB_GADGET)
  help
  Say Y here if your system has a dual role high speed USB
  controller based on the Mentor Graphics silicon IP.  Then
  configure options to match your silicon and the board
  it's being used with, including the USB peripheral role,
  or the USB host role, or both.

  Texas Instruments families using this IP include DaVinci
  (35x, 644x ...), OMAP 243x, OMAP 3, and TUSB 6010.

  Analog Devices parts using this IP include Blackfin BF54x,
  BF525 and BF527.

  Allwinner SoCs using this IP include A10, A13, A20, ...

  If you do not know what this is, please say N.

  To compile this driver as a module, choose M here; the
  module will be called "musb-hdrc".

推荐答案

因此,在探索了许多内容之后,我发现当我在Inventra高速双角色控制器(TI,ADI,AW等)中标记"m"时,是另外两个自动变为<的支持; >喜欢

So after exploring many things, I found that when I mark 'm' in Inventra Highspeed Dual Role Controller (TI, ADI, AW, ...) there are two another support which automatically goes to < > like

<M>   Inventra Highspeed Dual Role Controller (TI, ADI, AW, ...)                                                                     
MUSB Mode Selection (Dual Role mode)  --->                                                                                   
*** Platform Glue Layer ***                                                                                                
< >     OMAP2430 and onwards                                                                                                        
< >     AM35x                                                                                                                        
< >     TI DSPS platforms                                                                                                           
    *** MUSB DMA mode ***                                                                                                      
[ ]     Disable DMA (always use PIO)  

在这里,我忘记了当我选择Inventra高速双角色控制器时,TI DSPS平台和禁用DMA"也会自动变为空(<>).因此,我还要检查TI DSPS平台和< *>禁用DMA,然后再次交叉编译内核和模块

Here I forgot to notice that TI DSPS platforms and Disable DMA also goes to empty(< >) automatically when I select Inventra Highspeed Dual Role Controller. so I also check TI DSPS platforms and <*> for Disable DMA and then cross compile kernel and modules again

现在,当我的电路板成功启动后,我会看到3个新模块

Now after when my board boot up successfully I see 3 new modules

root@arm:~# ls /lib/modules/4.4.16/kernel/drivers/usb/musb/musb_
musb_am335x.ko  musb_dsps.ko    musb_hdrc.ko   

然后输入lsmod命令

Then type lsmod command

root@arm:~# lsmod 
Module                  Size  Used by    Not tainted
bridge                 87777  0 
stp                     2111  1 bridge
llc                     5184  2 bridge,stp
usb_f_rndis            21887  2 
usb_f_ecm               9211  2 
u_ether                11816  2 usb_f_rndis,usb_f_ecm
libcomposite           42715 16 usb_f_rndis,usb_f_ecm
musb_dsps               9418  0 
musb_hdrc              72752  1 musb_dsps
omap_aes_driver        19511  0 
omap_sham              22202  0 
omap_rng                4212  0 
rng_core                7198  1 omap_rng
musb_am335x             1547  0 [permanent]

并且我成功地将USB驱动器连接到在/media位置检测到的设备

and I successfully connect my USB drive to device which detect in /media location

但是我很惊讶在这里如何自动加载Musb_ *模块?当我从/lib目录中删除am335x时,我也无法理解,所有musb *模块都将自动删除

But I am surprised here how to Musb_* module load automatically? I can't understand also when i remove am335x from /lib directory, all musb* module remove automatically

那么我该如何解决此自动加载模块的问题?有人帮我

So how do I solve this automatically load module issue? anyone help me

这篇关于适用于am335x的USB大容量存储驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆