Change in osmocom-bb[master]: firmware: gtm900b: fix GPIO configuration

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Sep 30 23:39:26 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/20327 )


Change subject: firmware: gtm900b: fix GPIO configuration
......................................................................

firmware: gtm900b: fix GPIO configuration

This change fixes one bug and one uncertainty:

Bug: Huawei defined Calypso GPIO 3 to be DTR input on this modem,
following TI's precedent from C-Sample and D-Sample platforms.
(Huawei's documentation calls the corresponding FPC interface pin
UART_DTR without even mentioning that it is actually wired to
Calypso GPIO 3 in the hardware.)

The previous code (erroneously copied from gta0x target which is
different in this regard) configured this GPIO to be an output,
creating a driver conflict.

Uncertainty: GPIOs 4, 6, 10, 11 and 12 power up as inputs, and
Huawei's official fw leaves them as such.  But in the absence of
someone reverse-engineering a sacrificial GTM900 module by slicing
its PCB and imaging its copper layers and vias, we don't know if
these Calypso pins are simply unconnected like they are on Openmoko
devices (in which case they are floating inputs and should be
switched to driving dummy outputs), or if they are tied off in the
hardware in one way or another, in which case leaving them as inputs
is correct.

On the reasoning that floating inputs are a lesser evil than driver
conflicts or shorted outputs, leave these GPIOs as inputs until
we gain better knowledge of this aspect of the hardware.

Related: OS#4769
Change-Id: Ia41f8bc19fb1775b0587fe1ceaa8acd066710aa5
---
M src/target/firmware/board/gtm900b/init.c
1 file changed, 4 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/27/20327/1

diff --git a/src/target/firmware/board/gtm900b/init.c b/src/target/firmware/board/gtm900b/init.c
index 38ede10..f04d314 100644
--- a/src/target/firmware/board/gtm900b/init.c
+++ b/src/target/firmware/board/gtm900b/init.c
@@ -67,14 +67,12 @@
 	writew(reg, ASIC_CONF_REG);
 
 	/*
-	 * Most Calypso peripheral interface signals are unconnected
-	 * on this modem.  We configure them to be GPIOs in IO_CONF_REG,
-	 * then configure them to be outputs in IO_CNTL_REG, then set
-	 * the outputs to 0 in ARMIO_LATCH_OUT.
+	 * Configure Calypso GPIO and multifunction pins the same way
+	 * how Huawei's official firmware configures them.
 	 */
 	writew(0x03F5, IO_CONF_REG);
-	writew(0xC000, IO_CNTL_REG);
-	writew(0x0000, ARMIO_LATCH_OUT);
+	writew(0xDC58, IO_CNTL_REG);
+	writew(0x0007, ARMIO_LATCH_OUT);
 
 	/* Set LPG output permanently on (power LED) */
 	writew(1, LPG_PM_REG);

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/20327
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ia41f8bc19fb1775b0587fe1ceaa8acd066710aa5
Gerrit-Change-Number: 20327
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200930/f528cfc5/attachment.htm>


More information about the gerrit-log mailing list