am335x的usb大容量存储驱动程序



我想加载一个usb驱动器存储模块,这样当我加载usb大容量存储模块时,usb驱动器会在/media或/dev/sda1 中检测到

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

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

注意=am335x_fujitel_defconfig是我根据我的bord和该类型之后编辑的defconfig文件使菜单配置

原因是我想制作USB存储驱动程序的模块,这样我就可以先安装模块将我的USB驱动器连接到设备上所以我关注这个链接https://processors.wiki.ti.com/index.php/Usbgeneralpage#Mass_Storage_Gadget作为参考并且改变一些驱动器配置。

我发现当我取消选中时

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

我的usb驱动器在我的设备上不工作,所以我为Inventra高速双角色控制器制作模块"m",并生成musb-hdrc.ko文件

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

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.coff上面的命令运行成功,没有看到任何错误在重新启动之后;lsmod";确定模块是否加载的命令

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文件

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"时,还有另外两个支持会自动转到<gt;像

<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,然后再次交叉编译内核和模块

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

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

然后键入lsmod命令

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驱动器连接到检测在/媒体位置的设备

但我在这里很惊讶Musb_*模块是如何自动加载的?我也不明白,当我从/lib目录中删除am335x时,所有musb*模块都会自动删除

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

相关内容

最新更新