Configure Layerscape® 1043A USB Contorller as USB Device

cancel
Showing results for 
Search instead for 
Did you mean: 

Configure Layerscape® 1043A USB Contorller as USB Device

651 Views
bladerunner1010
Contributor IV

Hi 

I want to configure the USB controller with Linux device tree as Device and not as Host.

Is there an example for that?

Thanks

Labels (1)
Tags (2)
0 Kudos
8 Replies

443 Views
bladerunner1010
Contributor IV

My device tree looks like this:

 

usb0: usb3@2f00000 {
compatible = "fsl,ls1043a-dwc3", "snps,dwc3";
reg = <0x0 0x2f00000 0x0 0x10000>;
interrupts = <0 60 0x4>;
dr_mode = "peripheral";
snps,quirk-frame-length-adjustment = <0x20>;
snps,dis_rxdet_inp3_quirk;
usb3-lpm-capable;
snps,dis-u1u2-when-u3-quirk;
snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
snps,host-vbus-glitches;
configure-gfladj;
dma-coherent;
status = "disabled";
};

What the  'status = "disabled" ' means?

Is it being override by another dtsi?

Should I enable the USB in menuconfig? buildroot or kernel?

 

 

0 Kudos

627 Views
bladerunner1010
Contributor IV

Great thanks

 

I also need to control when the connected MPU (LS1043) will be discover-able as a USB device by the Windows OS.

Thus even though I'm connected with the USB connector to the PC machine it will not show up on the device manager until I choose to do so from the MPU side (Configured as a device obviously).

Any idea how to do that?

0 Kudos

616 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please do the above procedure step by step.

0 Kudos

395 Views
bladerunner1010
Contributor IV

Adding this line:

maximum-speed = “super-speed”

in device tree and building with 'flex-builder -c linux" does not compile.

Why is this happening? @yipingwang 

0 Kudos

646 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the section "Device mode (Gadget driver)" in  page 460 in LSDK 20.12 user manual.

Please configure Linux Kernel as the following.

USB Gadget support --->
<M> USB Gadget functions configurable through
configfs
        [*] Mass storage
<M> USB Gadget precomposed configurations
<M> Mass Storage Gadget

Device Tree update, change property dr_mode’s data from “host” to “peripheral”, add property maximum-speed = “super-speed”;
as below:
usb0: usb3@2f00000 {
compatible = "snps,dwc3";
reg = <0x0 0x2f00000 0x0 0x10000>;
interrupts = <0 60 0x4>;
dr_mode = "peripheral";
snps,quirk-frame-length-adjustment = <0x20>;
snps,dis_rxdet_inp3_quirk;
maximum-speed = “super-speed”;
};

On the target board, insert Kernel modules.

root@ls1043a:/run/media/mmcblk0p1/ # dd if=/dev/zero of=./test bs=1M count=500
root@ls1043a:/run/media/mmcblk0p1/ # insmod libcomposite.ko
root@ls1043a:/run/media/mmcblk0p1/ # insmod usb_f_mass_storage.ko
root@ls1043a:/run/media/mmcblk0p1/ # insmod g_mass_storage.ko file=/run/media/mmcblk0p1/test

Connect USB cable with PC and RDB board, you can see Windows Device Manager as Linux File-Stor Gadget USB Drive.

352 Views
bladerunner1010
Contributor IV

Adding the line  - maximum-speed = “super-speed” to dts generates dtc compile error.

I'm using buildroot - lsdk 21.08 @yipingwang @Yuri 

Thanks!

391 Views
bladerunner1010
Contributor IV

I also get error:

 

insmod: can't insert 'libcomposite.ko': No such file or directory 

 

on target

@yipingwang 

 

0 Kudos

444 Views
bladerunner1010
Contributor IV

Where is the device tree source file [dtsi] located?

The above modification is for Linux device tree or U-BOOT device tree.

And also the generated dtb?

I'm using buildroot tiny

0 Kudos