GPIO on HS connector

Is any of the pins on the HS connector usable as general GPIO. I’m using spi3 as spi so that one is ruled out and GPIO4 3-6 (ISP_SCL/ISP_SDA) are connected with a pullup to 1V8

It would be nicer to have all connections in on connector and not routing them with a jumper wire from LS connector

Most of them can be used as a GPIO. It depends on the pinmux configuration. You can change the mux configuration in below file:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/hisilicon/hikey960-pinctrl.dtsi#n16

For instance:

			isp0_pmx_func: isp0_pmx_func {
				pinctrl-single,pins = <
					0x058 MUX_M0 /* MUX_M0=GPIO MUX_M1=ISP_CLK0 */
					0x064 MUX_M0 /* MUX_M0=GPIO MUX_M1=ISP_SCL0 */
					0x068 MUX_M0 /* MUX_M0=GPIO MUX_M1=ISP_SDA0 */
				>;
			};

Hope this helps!

Thanks this helped I was able to use uart0 as gpio with a similar change

@@ -97,8 +97,8 @@
 
                        uart0_pmx_func: uart0_pmx_func {
                                pinctrl-single,pins = <
-                                       0x0cc MUX_M2 /* UART0_RXD */
-                                       0x0d0 MUX_M2 /* UART0_TXD */
+                                       0x0cc MUX_M0 /* GPIO053 Linux 461 */
+                                       0x0d0 MUX_M0 /* GPIO054 Linux 462 */
                                >;
                        };

There is even more hints about this in hi3660-hikey960.dts every gpio have comments about HSEC and LSEC where applicable.

1 Like

Yeah, most of the upstreamed 96Boards have the gpio-line-names property for accessing a gpio using its line name from a userspace library like MRAA [1].

[1] https://github.com/intel-iot-devkit/mraa