__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.217.18: ~ $
<!DOCTYPE html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>ChipIdea Highspeed Dual Role Controller Driver &#8212; The Linux Kernel  documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=3918102e" />
    <script src="../_static/documentation_options.js?v=5929fcd5"></script>
    <script src="../_static/doctools.js?v=9bcbadda"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="DWC3 driver" href="dwc3.html" />
    <link rel="prev" title="Authorizing (or not) your USB devices to connect to the system" href="authorization.html" />
   
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  <div class="document">
    
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/logo.svg" alt="Logo of The Linux Kernel"/>
            </a></p>
<h1 class="logo"><a href="../index.html">The Linux Kernel</a></h1>



<p class="blurb">6.18.50</p>







<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>


<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>

<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#human-interfaces">Human interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#storage-interfaces">Storage interfaces</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../subsystem-apis.html#other-subsystems">Other subsystems</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../accounting/index.html">Accounting</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cpu-freq/index.html">CPUFreq - CPU frequency and voltage scaling code in the Linux(TM) kernel</a></li>
<li class="toctree-l3"><a class="reference internal" href="../edac/index.html">EDAC Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../fpga/index.html">FPGA</a></li>
<li class="toctree-l3"><a class="reference internal" href="../i2c/index.html">I2C/SMBus Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../iio/index.html">Industrial I/O</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pcmcia/index.html">PCMCIA</a></li>
<li class="toctree-l3"><a class="reference internal" href="../spi/index.html">Serial Peripheral Interface (SPI)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../w1/index.html">1-Wire Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../watchdog/index.html">Watchdog Support</a></li>
<li class="toctree-l3"><a class="reference internal" href="../virt/index.html">Virtualization Support</a></li>
<li class="toctree-l3"><a class="reference internal" href="../hwmon/index.html">Hardware Monitoring</a></li>
<li class="toctree-l3"><a class="reference internal" href="../accel/index.html">Compute Accelerators</a></li>
<li class="toctree-l3"><a class="reference internal" href="../security/index.html">Security Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crypto/index.html">Crypto API</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bpf/index.html">BPF Documentation</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="index.html">USB support</a></li>
<li class="toctree-l3"><a class="reference internal" href="../PCI/index.html">PCI Bus Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../misc-devices/index.html">Assorted Miscellaneous Devices Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../peci/index.html">PECI Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../wmi/index.html">WMI Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../tee/index.html">TEE Subsystem</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../translations/index.html">Translations</a></li>
</ul>

</div>

<script type="text/javascript"> <!--
  var sbar = document.getElementsByClassName("sphinxsidebar")[0];
  let currents = document.getElementsByClassName("current")
  if (currents.length) {
    sbar.scrollTop = currents[currents.length - 1].offsetTop;
  }
  --> </script>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/usb/chipidea.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  



<section id="chipidea-highspeed-dual-role-controller-driver">
<h1>ChipIdea Highspeed Dual Role Controller Driver<a class="headerlink" href="#chipidea-highspeed-dual-role-controller-driver" title="Link to this heading">¶</a></h1>
<section id="how-to-test-otg-fsm-hnp-and-srp">
<h2>1. How to test OTG FSM(HNP and SRP)<a class="headerlink" href="#how-to-test-otg-fsm-hnp-and-srp" title="Link to this heading">¶</a></h2>
<p>To show how to demo OTG HNP and SRP functions via sys input files
with 2 Freescale i.MX6Q sabre SD boards.</p>
</section>
<section id="how-to-enable-otg-fsm">
<h2>1.1 How to enable OTG FSM<a class="headerlink" href="#how-to-enable-otg-fsm" title="Link to this heading">¶</a></h2>
<section id="select-config-usb-otg-fsm-in-menuconfig-rebuild-kernel">
<h3>1.1.1 Select CONFIG_USB_OTG_FSM in menuconfig, rebuild kernel<a class="headerlink" href="#select-config-usb-otg-fsm-in-menuconfig-rebuild-kernel" title="Link to this heading">¶</a></h3>
<p>Image and modules. If you want to check some internal
variables for otg fsm, mount debugfs, there are 2 files
which can show otg fsm variables and some controller registers value:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cat /sys/kernel/debug/ci_hdrc.0/otg
cat /sys/kernel/debug/ci_hdrc.0/registers
</pre></div>
</div>
</section>
<section id="add-below-entries-in-your-dts-file-for-your-controller-node">
<h3>1.1.2 Add below entries in your dts file for your controller node<a class="headerlink" href="#add-below-entries-in-your-dts-file-for-your-controller-node" title="Link to this heading">¶</a></h3>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>otg-rev = &lt;0x0200&gt;;
adp-disable;
</pre></div>
</div>
</section>
</section>
<section id="test-operations">
<h2>1.2 Test operations<a class="headerlink" href="#test-operations" title="Link to this heading">¶</a></h2>
<ol class="arabic">
<li><p>Power up 2 Freescale i.MX6Q sabre SD boards with gadget class driver loaded
(e.g. g_mass_storage).</p></li>
<li><p>Connect 2 boards with usb cable: one end is micro A plug, the other end
is micro B plug.</p>
<p>The A-device (with micro A plug inserted) should enumerate B-device.</p>
</li>
<li><p>Role switch</p>
<p>On B-device:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo 1 &gt; /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req
</pre></div>
</div>
<p>B-device should take host role and enumerate A-device.</p>
</li>
<li><p>A-device switch back to host.</p>
<p>On B-device:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo 0 &gt; /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req
</pre></div>
</div>
<p>or, by introducing HNP polling, B-Host can know when A-peripheral wishes to
be in the host role, so this role switch also can be triggered in
A-peripheral side by answering the polling from B-Host. This can be done on
A-device:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo 1 &gt; /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_req
</pre></div>
</div>
<p>A-device should switch back to host and enumerate B-device.</p>
</li>
<li><p>Remove B-device (unplug micro B plug) and insert again in 10 seconds;
A-device should enumerate B-device again.</p></li>
<li><p>Remove B-device (unplug micro B plug) and insert again after 10 seconds;
A-device should NOT enumerate B-device.</p>
<p>if A-device wants to use bus:</p>
<p>On A-device:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo 0 &gt; /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_drop
echo 1 &gt; /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_req
</pre></div>
</div>
<p>if B-device wants to use bus:</p>
<p>On B-device:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo 1 &gt; /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req
</pre></div>
</div>
</li>
<li><p>A-device power down the bus.</p>
<p>On A-device:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo 1 &gt; /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_drop
</pre></div>
</div>
<p>A-device should disconnect with B-device and power down the bus.</p>
</li>
<li><p>B-device does data pulse for SRP.</p>
<p>On B-device:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo 1 &gt; /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req
</pre></div>
</div>
<p>A-device should resume usb bus and enumerate B-device.</p>
</li>
</ol>
</section>
<section id="reference-document">
<h2>1.3 Reference document<a class="headerlink" href="#reference-document" title="Link to this heading">¶</a></h2>
<p>“On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification
July 27, 2012 Revision 2.0 version 1.1a”</p>
</section>
<section id="how-to-enable-usb-as-system-wakeup-source">
<h2>2. How to enable USB as system wakeup source<a class="headerlink" href="#how-to-enable-usb-as-system-wakeup-source" title="Link to this heading">¶</a></h2>
<p>Below is the example for how to enable USB as system wakeup source
on an imx6 platform.</p>
<p>2.1 Enable core’s wakeup:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo enabled &gt; /sys/bus/platform/devices/ci_hdrc.0/power/wakeup
</pre></div>
</div>
<p>2.2 Enable glue layer’s wakeup:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo enabled &gt; /sys/bus/platform/devices/2184000.usb/power/wakeup
</pre></div>
</div>
<p>2.3 Enable PHY’s wakeup (optional):</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo enabled &gt; /sys/bus/platform/devices/20c9000.usbphy/power/wakeup
</pre></div>
</div>
<p>2.4 Enable roothub’s wakeup:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo enabled &gt; /sys/bus/usb/devices/usb1/power/wakeup
</pre></div>
</div>
<p>2.5 Enable related device’s wakeup:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo enabled &gt; /sys/bus/usb/devices/1-1/power/wakeup
</pre></div>
</div>
<p>If the system has only one usb port, and you want usb wakeup at this port, you
can use the below script to enable usb wakeup:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>for i in $(find /sys -name wakeup | grep usb);do echo enabled &gt; $i;done;
</pre></div>
</div>
</section>
</section>


          </div>
          
        </div>
      </div>
    <div class="clearer"></div>
  </div>
    <div class="footer">
      &#169;The kernel development community.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
      
      |
      <a href="../_sources/usb/chipidea.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
acm.html File 15.8 KB 0644
authorization.html File 15.23 KB 0644
chipidea.html File 15.95 KB 0644
dwc3.html File 12.53 KB 0644
ehci.html File 21.33 KB 0644
functionfs-desc.html File 20.66 KB 0644
functionfs.html File 15.05 KB 0644
gadget-testing.html File 65.63 KB 0644
gadget_configfs.html File 26.49 KB 0644
gadget_hid.html File 27.59 KB 0644
gadget_multi.html File 18.16 KB 0644
gadget_printer.html File 25.93 KB 0644
gadget_serial.html File 23.62 KB 0644
gadget_uvc.html File 33.43 KB 0644
index.html File 12.65 KB 0644
iuu_phoenix.html File 13.1 KB 0644
mass-storage.html File 20.42 KB 0644
misc_usbsevseg.html File 11.72 KB 0644
mtouchusb.html File 13.28 KB 0644
ohci.html File 11.52 KB 0644
raw-gadget.html File 14.77 KB 0644
text_files.html File 38.69 KB 0644
usb-help.html File 10.64 KB 0644
usb-serial.html File 38.6 KB 0644
usbip_protocol.html File 33.46 KB 0644
usbmon.html File 28.56 KB 0644
Filemanager