<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmocom-bb/+/20327">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">firmware: gtm900b: fix GPIO configuration<br><br>This change fixes one bug and one uncertainty:<br><br>Bug: Huawei defined Calypso GPIO 3 to be DTR input on this modem,<br>following TI's precedent from C-Sample and D-Sample platforms.<br>(Huawei's documentation calls the corresponding FPC interface pin<br>UART_DTR without even mentioning that it is actually wired to<br>Calypso GPIO 3 in the hardware.)<br><br>The previous code (erroneously copied from gta0x target which is<br>different in this regard) configured this GPIO to be an output,<br>creating a driver conflict.<br><br>Uncertainty: GPIOs 4, 6, 10, 11 and 12 power up as inputs, and<br>Huawei's official fw leaves them as such.  But in the absence of<br>someone reverse-engineering a sacrificial GTM900 module by slicing<br>its PCB and imaging its copper layers and vias, we don't know if<br>these Calypso pins are simply unconnected like they are on Openmoko<br>devices (in which case they are floating inputs and should be<br>switched to driving dummy outputs), or if they are tied off in the<br>hardware in one way or another, in which case leaving them as inputs<br>is correct.<br><br>On the reasoning that floating inputs are a lesser evil than driver<br>conflicts or shorted outputs, leave these GPIOs as inputs until<br>we gain better knowledge of this aspect of the hardware.<br><br>Related: OS#4769<br>Change-Id: Ia41f8bc19fb1775b0587fe1ceaa8acd066710aa5<br>---<br>M src/target/firmware/board/gtm900b/init.c<br>1 file changed, 4 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/27/20327/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/target/firmware/board/gtm900b/init.c b/src/target/firmware/board/gtm900b/init.c</span><br><span>index 38ede10..f04d314 100644</span><br><span>--- a/src/target/firmware/board/gtm900b/init.c</span><br><span>+++ b/src/target/firmware/board/gtm900b/init.c</span><br><span>@@ -67,14 +67,12 @@</span><br><span>  writew(reg, ASIC_CONF_REG);</span><br><span> </span><br><span>      /*</span><br><span style="color: hsl(0, 100%, 40%);">-       * Most Calypso peripheral interface signals are unconnected</span><br><span style="color: hsl(0, 100%, 40%);">-     * on this modem.  We configure them to be GPIOs in IO_CONF_REG,</span><br><span style="color: hsl(0, 100%, 40%);">-         * then configure them to be outputs in IO_CNTL_REG, then set</span><br><span style="color: hsl(0, 100%, 40%);">-    * the outputs to 0 in ARMIO_LATCH_OUT.</span><br><span style="color: hsl(120, 100%, 40%);">+        * Configure Calypso GPIO and multifunction pins the same way</span><br><span style="color: hsl(120, 100%, 40%);">+  * how Huawei's official firmware configures them.</span><br><span>        */</span><br><span>  writew(0x03F5, IO_CONF_REG);</span><br><span style="color: hsl(0, 100%, 40%);">-    writew(0xC000, IO_CNTL_REG);</span><br><span style="color: hsl(0, 100%, 40%);">-    writew(0x0000, ARMIO_LATCH_OUT);</span><br><span style="color: hsl(120, 100%, 40%);">+      writew(0xDC58, IO_CNTL_REG);</span><br><span style="color: hsl(120, 100%, 40%);">+  writew(0x0007, ARMIO_LATCH_OUT);</span><br><span> </span><br><span>         /* Set LPG output permanently on (power LED) */</span><br><span>      writew(1, LPG_PM_REG);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmocom-bb/+/20327">change 20327</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmocom-bb/+/20327"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmocom-bb </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ia41f8bc19fb1775b0587fe1ceaa8acd066710aa5 </div>
<div style="display:none"> Gerrit-Change-Number: 20327 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>