Project

General

Profile

Bug #4610 ยป gtm900-gpio3-fix.patch

falconia, 06/10/2020 08:43 PM

View differences:

src/target/firmware/board/gtm900b/init.c
67 67
	writew(reg, ASIC_CONF_REG);
68 68

  
69 69
	/*
70
	 * Most Calypso peripheral interface signals are unconnected
71
	 * on this modem.  We configure them to be GPIOs in IO_CONF_REG,
72
	 * then configure them to be outputs in IO_CNTL_REG, then set
73
	 * the outputs to 0 in ARMIO_LATCH_OUT.
70
	 * The exact wiring of ALL Calypso GPIO and multifunction pins
71
	 * inside the GTM900-B module is currently unknown, and will
72
	 * remain so until and unless someone goes through the effort
73
	 * of slicing a sacrificial module, imaging all inner and outer
74
	 * copper layers of its PCB, and tracing out the signal connections
75
	 * of interest.  Therefore, it is not clear exactly what we
76
	 * should do with all those GPIO and multifunction pins that are
77
	 * unused from the functional standpoint.  The following code
78
	 * was copied by steve-m from the gta0x port; on the gta0x target
79
	 * we *know* (thanks to published PCB design files) that these pins
80
	 * are physically unconnected and thus should be configured as
81
	 * dummy outputs in order to avoid floating inputs, but such knowledge
82
	 * is currently lacking for the GTM900-B target.
83
	 *
84
	 * We do know, however, that GPIO3 should be configured as an input
85
	 * and not an output: Huawei designated this GPIO to serve as the DTR
86
	 * input to the modem (it is defined as such in Huawei's official
87
	 * module interface pinout docs), there is a pull-down resistor to GND
88
	 * inside the module on this GPIO3 pin, so it won't float if left
89
	 * unconnected, and configuring it as a Calypso output would be
90
	 * dangerous: if an external CP2105 or FT2232x or RS-232 receiver
91
	 * chip drives its DTR output into this line, and Calypso also drives
92
	 * it as an output, the two outputs will fight, potentially damaging
93
	 * one of the chips.
74 94
	 */
75 95
	writew(0x03F5, IO_CONF_REG);
76
	writew(0xC000, IO_CNTL_REG);
96
	writew(0xC008, IO_CNTL_REG);
77 97
	writew(0x0000, ARMIO_LATCH_OUT);
78 98

  
79 99
	/* Set LPG output permanently on (power LED) */
    (1-1/1)
    Add picture from clipboard (Maximum size: 48.8 MB)