Issue with usb device mode with mass storage gadget driver on PowerPc P1010

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with usb device mode with mass storage gadget driver on PowerPc P1010

773 Views
zounan
Contributor I

Hello there Greetings.

I want to use gadget driver to make the board like a u disk in order to transform data with PC.But when insmod the module g_mass_storage,we got an issue that "no such device".This time I don't know how to solve this problem.

Kernel: linux3.12.37

Board:PowerPc P1010 

QQ图片20180718175455.png

I am stuck with this error. Appreciate any pointers ...

nan zou

Tags (1)
0 Kudos
1 Reply

255 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello 楠 邹,

Please refer to the following Kernel configuration.

Device Drivers --->
     USB support --->
        <*> Support for Host-side USB
        <*> EHCI HCD (USB 2.0) support
        -*- Root Hub Transaction Translators
        [ ] Use Xilinx usb host EHCI controller core
        [*] Support for Freescale PPC on-chip EHCI USB
controller

Device Drivers --->
            USB support --->
                 USB Gadget Support --->
                         < M > Support for USB Gadgets
                         USB Peripheral Controller (Freescale Highspeed
USB DR Peripheral Controller) --->
                         < M > Freescale Highspeed USB DR Peripheral Controller

Device Drivers --->
       USB support --->
            USB Gadget Support --->
            < M > Support for USB Gadgets
                   USB Gadget Drivers    

                      < M > Mass Storage Gadget

dts configuration:

usb@22000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl-usb2-<controller-type>-v<controller version>",
"fsl-usb2-<controller-type>";
reg = <0x22000 0x1000>; /* specifies register base addr, soc dependent */
interrupt-parent = <&mpic>;
interrupts = <28 0x2>; /* specifies usb interrupt line, soc dependent */
phy_type = "ulpi"; /* phy can be ulpi(external)/utmi(internal) */
dr_mode = "peripheral" /* this entry specifies usb mode */
};

u-boot:

For USB1 controller, to configure for gadget mode:
=> setenv hwconfig 'usb1:dr_mode=peripheral,phy_type=<ulpi/utmi>

In Linux:

1. Create a (e.g. 16MB) file backed storage as under on the target:
bash# dd bs=1M count=16 if=/dev/zero of=/root/bkup
16+0 records in
16+0 records out

2. Load device controller driver and test mass-storage gadget

a. Load FSL USB Gadget driver module
bash# insmod udc-core.ko
bash# insmod fsl_usb2_udc.ko
b. Load Mass storage module
bash# insmod configfs.ko
bash# insmod libcomposite.ko
bash# insmod usb_f_mass_storage.ko
bash# insmod g_mass_storage.ko file=/root/bkup
Number of LUNs=8
Mass Storage Function, version: 2009/09/11
LUN: removable file: (no medium)
Number of LUNs=1
LUN: file: /root/bkup
Number of LUNs=1
g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
g_mass_storage gadget: userspace failed to provide iSerialNumber
g_mass_storage gadget: g_mass_storage ready

3. Connect a USB cable between USB port of target board and the USB port on Windows machine(host). The following
message pops up on the target. At the same time XP recognizes the USB storage device and Windows configures and
installs its driver.
bash# g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos