usb Mass Storage driver for am335x

让人想犯罪 __ 提交于 2020-07-22 06:07:31

问题


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

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 is my edited defconfig file according to my bord and after that type make menuconfig

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.

I found that when i uncheck

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

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

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 

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 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".

回答1:


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)  

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

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   

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]

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

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



来源:https://stackoverflow.com/questions/62795072/usb-mass-storage-driver-for-am335x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!