How to configure DM365 for USB host, device and OTG support

From RidgeRun Developer Connection

(Difference between revisions)
Jump to:navigation, search
(Created page with 'This page shows how to configure linux kernel 2.6.32 for the DM365 in order to use USB on different operation modes. == USB HOST FUNCTIONALITY == 1. Gadget Support this featu...')
Line 1: Line 1:
This page shows how to configure linux kernel 2.6.32 for the DM365 in order to use USB on different operation modes.
This page shows how to configure linux kernel 2.6.32 for the DM365 in order to use USB on different operation modes.
-
== USB HOST FUNCTIONALITY ==
+
== USB hsot functionality ==
Line 32: Line 32:
<br>  
<br>  
-
== USB SLAVE FUNCTIONALITY ==
+
== USB slave functionality ==
1. Gadget Support this feature must be '''selected'''  
1. Gadget Support this feature must be '''selected'''  
Line 76: Line 76:
[[Image:Slave configuration.jpg|thumb|center|320x240px|Slave configuration.jpg]]
[[Image:Slave configuration.jpg|thumb|center|320x240px|Slave configuration.jpg]]
-
== USB On-The-Go (OTG) FUNCTIONALITY ==
+
== USB On-The-Go (OTG) functionality ==
To enable OTG functionality the following steps should be followed
To enable OTG functionality the following steps should be followed

Revision as of 20:53, 4 February 2011

This page shows how to configure linux kernel 2.6.32 for the DM365 in order to use USB on different operation modes.

Contents

USB hsot functionality

1. Gadget Support this feature must be unselected

 Symbol: USB_GADGET [=n]                                                        
  │ Prompt: USB Gadget Support                                                    
  │   Defined at drivers/usb/gadget/Kconfig:16                                    
  │   Depends on: USB_SUPPORT                                                     
  │   Location:                                                                    
  │     -> Kernel configuration                                                    
  │       -> Device Drivers                                                        
  │         -> USB support (USB_SUPPORT [=y])  


2. Change the Inventra driver mode to Host mode

  │ Prompt: Driver Mode                                                              
  │   Defined at drivers/usb/musb/Kconfig:68                                         
  │   Depends on: USB_SUPPORT && USB_MUSB_HDRC                                       
  │   Location:                                                                      
  │     -> Kernel configuration                                                      
  │       -> Device Drivers                                                          
  │         -> USB support (USB_SUPPORT [=y])                                        
  │           -> Inventra Highspeed Dual Role Controller (TI, ADI, ...) (USB_MUSB    
  │   Selected by: USB_SUPPORT && USB_MUSB_HDRC && m 
Host configuration.jpg


USB slave functionality

1. Gadget Support this feature must be selected

 Symbol: USB_GADGET [=n]                                                        
  │ Prompt: USB Gadget Support                                                    
  │   Defined at drivers/usb/gadget/Kconfig:16                                    
  │   Depends on: USB_SUPPORT                                                     
  │   Location:                                                                    
  │     -> Kernel configuration                                                    
  │       -> Device Drivers                                                        
  │         -> USB support (USB_SUPPORT [=y])  


2. Change the Inventra driver mode to dual role controller

  │ Prompt: Driver Mode                                                              
  │   Defined at drivers/usb/musb/Kconfig:68                                         
  │   Depends on: USB_SUPPORT && USB_MUSB_HDRC                                       
  │   Location:                                                                      
  │     -> Kernel configuration                                                      
  │       -> Device Drivers                                                          
  │         -> USB support (USB_SUPPORT [=y])                                        
  │           -> Inventra Highspeed Dual Role Controller (TI, ADI, ...) (USB_MUSB    
  │   Selected by: USB_SUPPORT && USB_MUSB_HDRC && m 

3. Recompile and install the kernel


4When you got the linux prompt this command will allow you to mount the device (e.g the mmc mounted on the board


# modprobe g_file_storage file=/dev/mmcblk0p1


This command will allow you to get the data  of mmc in your PC 



Slave configuration.jpg

USB On-The-Go (OTG) functionality

To enable OTG functionality the following steps should be followed

1. Gadget Support this feature must be selected

 Symbol: USB_GADGET [=n]                                                        
  │ Prompt: USB Gadget Support                                                    
  │   Defined at drivers/usb/gadget/Kconfig:16                                    
  │   Depends on: USB_SUPPORT                                                     
  │   Location:                                                                    
  │     -> Kernel configuration                                                    
  │       -> Device Drivers                                                        
  │         -> USB support (USB_SUPPORT [=y])  


2. Change the Inventra driver mode to dual role controller

  │ Prompt: Driver Mode                                                              
  │   Defined at drivers/usb/musb/Kconfig:68                                         
  │   Depends on: USB_SUPPORT && USB_MUSB_HDRC                                       
  │   Location:                                                                      
  │     -> Kernel configuration                                                      
  │       -> Device Drivers                                                          
  │         -> USB support (USB_SUPPORT [=y])                                        
  │           -> Inventra Highspeed Dual Role Controller (TI, ADI, ...) (USB_MUSB    
  │   Selected by: USB_SUPPORT && USB_MUSB_HDRC && m 


3. Choose if the devices will be registered based on a whitelist (list of devices that will pass the enumeration) or if any plugged in device will be enumerated.

 │ Prompt: Rely on OTG Targeted Peripherals List                                                                                 
 │   Defined at drivers/usb/core/Kconfig:115                                                                                     
 │   Depends on: USB_SUPPORT && (USB_OTG || EMBEDDED)                                                                            
 │   Location:                                                                                                                   
 │     -> Kernel configuration                                                                                                   
 │       -> Device Drivers                                                                                                       
 │         -> USB support (USB_SUPPORT [=y])                                                                                     
 │           -> Support for Host-side USB (USB [=y])   


4. Recompile and install the kernel.


5. Remove J26 and J6, extra jumpers can be placed on J4.


6. To mount the SD card on your host PC use

# modprobe g_file_storage file=/dev/mmcblk0p1


7. To start a host session plug in your device (e.g. a flash memory) to the board. If gadget driver is built as module then insert it to complete USB initialization:

# modprobe g_file_storage

and type

# echo "F" > /proc/driver/musb_hdrc

to start the host session, the device will be registered and you will be able to use it. For example, for a flash memory mount it using

# mkdir usb
# mount /dev/sdXX usb/

where XX should be replaced according to the specific case.

NOTE: The procfs entry /proc/driver/musb_hdrc is used to control the driver behavior and to control its status. Use

# echo "?" > /proc/driver/musb_hdrc

for further details.


8. To switch from one mode host mode to gadget mode, the g_file_storage module must be reloaded:

# rmmod g_file_storage
# modprobe g_file_storage file=/dev/mmcblk0p1

then plug the board to the host PC.


9. To switch from gadget mode to host mode refer to point 5.

Related links

Navigation
Toolbox