<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Set USB1 to device mode for LS1046A in Layerscape</title>
    <link>https://community.nxp.com/t5/Layerscape/Set-USB1-to-device-mode-for-LS1046A/m-p/1658141#M12561</link>
    <description>&lt;P&gt;Hi NXP,&lt;/P&gt;&lt;P&gt;We have two problem about ls1046a usb :&lt;/P&gt;&lt;P&gt;1. We change "dr_mode" to "peripheral" in&amp;nbsp;fsl-ls1046a.dtsi, and connect our PCB and PC by USB line (Type-A to Type-A), but there are no reponse at PC side. We check&amp;nbsp;GSTS register, the&amp;nbsp;CURMOD is ready to set to device mode. Our usb1 dts node is as below. Is there anything else we need to modify ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[GSTS Register]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; root@ls1046arom8720-s1:~# memtool md -l 0x300c118+1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 0300c118: 3e800000&lt;/P&gt;&lt;P&gt;[USB1 DTS]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; usb1: usb@3000000 {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; compatible = "fsl,ls1046a-dwc3", "snps,dwc3";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; reg = &amp;lt;0x0 0x3000000 0x0 0x10000&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; interrupts = &amp;lt;GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; dr_mode = "peripheral";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,quirk-frame-length-adjustment = &amp;lt;0x20&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,dis_rxdet_inp3_quirk;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,incr-burst-type-adjustment = &amp;lt;1&amp;gt;, &amp;lt;4&amp;gt;, &amp;lt;8&amp;gt;, &amp;lt;16&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; usb3-lpm-capable;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,dis-u1u2-when-u3-quirk;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,host-vbus-glitches;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; dma-coherent;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. On LS1046ARDB, usb1 default is otg mode. We connect it to PC but there are no response too. How to make LS1046A to be device endpoint ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2023 06:49:01 GMT</pubDate>
    <dc:creator>charleshuang</dc:creator>
    <dc:date>2023-05-26T06:49:01Z</dc:date>
    <item>
      <title>Set USB1 to device mode for LS1046A</title>
      <link>https://community.nxp.com/t5/Layerscape/Set-USB1-to-device-mode-for-LS1046A/m-p/1658141#M12561</link>
      <description>&lt;P&gt;Hi NXP,&lt;/P&gt;&lt;P&gt;We have two problem about ls1046a usb :&lt;/P&gt;&lt;P&gt;1. We change "dr_mode" to "peripheral" in&amp;nbsp;fsl-ls1046a.dtsi, and connect our PCB and PC by USB line (Type-A to Type-A), but there are no reponse at PC side. We check&amp;nbsp;GSTS register, the&amp;nbsp;CURMOD is ready to set to device mode. Our usb1 dts node is as below. Is there anything else we need to modify ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[GSTS Register]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; root@ls1046arom8720-s1:~# memtool md -l 0x300c118+1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 0300c118: 3e800000&lt;/P&gt;&lt;P&gt;[USB1 DTS]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; usb1: usb@3000000 {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; compatible = "fsl,ls1046a-dwc3", "snps,dwc3";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; reg = &amp;lt;0x0 0x3000000 0x0 0x10000&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; interrupts = &amp;lt;GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; dr_mode = "peripheral";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,quirk-frame-length-adjustment = &amp;lt;0x20&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,dis_rxdet_inp3_quirk;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,incr-burst-type-adjustment = &amp;lt;1&amp;gt;, &amp;lt;4&amp;gt;, &amp;lt;8&amp;gt;, &amp;lt;16&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; usb3-lpm-capable;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,dis-u1u2-when-u3-quirk;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; snps,host-vbus-glitches;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; dma-coherent;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. On LS1046ARDB, usb1 default is otg mode. We connect it to PC but there are no response too. How to make LS1046A to be device endpoint ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 06:49:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/Set-USB1-to-device-mode-for-LS1046A/m-p/1658141#M12561</guid>
      <dc:creator>charleshuang</dc:creator>
      <dc:date>2023-05-26T06:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set USB1 to device mode for LS1046A</title>
      <link>https://community.nxp.com/t5/Layerscape/Set-USB1-to-device-mode-for-LS1046A/m-p/1660506#M12577</link>
      <description>&lt;P&gt;Do you want to configure LS1046ARDB as&amp;nbsp;Mass Storage gadget?&lt;/P&gt;
&lt;P&gt;Please configure Linux Kernel as the following.&lt;/P&gt;
&lt;P&gt;USB Gadget support ---&amp;gt;&lt;BR /&gt;&amp;lt;M&amp;gt; USB Gadget functions configurable through&lt;BR /&gt;configfs&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [*] Mass storage&amp;nbsp;&lt;BR /&gt;&amp;lt;M&amp;gt; USB Gadget precomposed configurations&lt;BR /&gt;&amp;lt;M&amp;gt; Mass Storage Gadget&lt;/P&gt;
&lt;P&gt;Device Tree update, change property dr_mode’s data from “host” to “peripheral”, add property maximum-speed = “super-speed”;&lt;BR /&gt;as below:&lt;BR /&gt;usb0: usb3@2f00000 {&lt;BR /&gt;compatible = "snps,dwc3";&lt;BR /&gt;reg = &amp;lt;0x0 0x2f00000 0x0 0x10000&amp;gt;;&lt;BR /&gt;interrupts = &amp;lt;0 60 0x4&amp;gt;;&lt;BR /&gt;dr_mode = "peripheral";&lt;BR /&gt;snps,quirk-frame-length-adjustment = &amp;lt;0x20&amp;gt;;&lt;BR /&gt;snps,dis_rxdet_inp3_quirk;&lt;BR /&gt;maximum-speed = “super-speed”;&lt;BR /&gt;};&lt;/P&gt;
&lt;P&gt;Build kernel, then copy below ko files to an SD card.&lt;BR /&gt;— ./drivers/usb/gadget/libcomposite.ko&lt;BR /&gt;— ./drivers/usb/gadget/function/usb_f_mass_storage.ko&lt;BR /&gt;— ./drivers/usb/gadget/legacy/g_mass_storage.ko&lt;/P&gt;
&lt;P&gt;root@ls1043a:/ # df&lt;BR /&gt;Filesystem 1K-blocks Used Available Use% Mounted on&lt;BR /&gt;/dev/root 85352 65515 15430 81% /&lt;BR /&gt;devtmpfs 1940036 4 1940032 1% /dev&lt;BR /&gt;tmpfs 1961116 132 1960984 1% /run&lt;BR /&gt;tmpfs 1961116 172 1960944 1% /var/volatile&lt;BR /&gt;/dev/mmcblk0p1 3931136 32964 3898172 1% /run/media/mmcblk0p1&lt;BR /&gt;root@ls1043a:~#cd /run/media/mmcblk0p1/ # this is where you put your ko files&lt;BR /&gt;root@ls1043a:/run/media/mmcblk0p1/ # dd if=/dev/zero of=./test bs=1M count=500&lt;BR /&gt;root@ls1043a:/run/media/mmcblk0p1/ # insmod libcomposite.ko&lt;BR /&gt;root@ls1043a:/run/media/mmcblk0p1/ # insmod usb_f_mass_storage.ko&lt;BR /&gt;root@ls1043a:/run/media/mmcblk0p1/ # insmod g_mass_storage.ko file=/run/media/mmcblk0p1/test&lt;BR /&gt;[ 780.758286] Mass Storage Function, version: 2009/09/11&lt;BR /&gt;[ 780.763465] LUN: removable file: (no medium)&lt;BR /&gt;[ 780.767791] LUN: file: /run/media/mmcblk0p1/test&lt;BR /&gt;[ 780.772406] Number of LUNs=1&lt;BR /&gt;[ 780.775355] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11&lt;BR /&gt;[ 780.782322] g_mass_storage gadget: userspace failed to provide iSerialNumber&lt;BR /&gt;[ 780.789371] g_mass_storage gadget: g_mass_storage ready&lt;/P&gt;
&lt;P&gt;• Connect USB cable with PC and RDB board&lt;BR /&gt;— You can see Windows Device Manager as Linux File-Stor Gadget USB Drive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 07:05:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/Set-USB1-to-device-mode-for-LS1046A/m-p/1660506#M12577</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2023-05-31T07:05:28Z</dc:date>
    </item>
  </channel>
</rss>

