How can I read the GPIOs of the Apalis Evaluation Board on Apalis TK1 from U-Boot?

I would like to read the GPIOs of the Apalis eval board in the U-Boot prompt over the gpio commands. I tried to figure out the mapping like follows:

  • identified 8 GPIOs directly mapped from Apalis TK1 to MXM3 connector in block diagram of Apalis TK1 datasheet, p. 11 https://docs.toradex.com/103129-apalis-tk1-datasheet.pdf
  • mapping of GPIOs to “Pin number on the MXM3 module edge connector (X1)” means connector X2 on the apalis eval board (GPIO1 → MXM3_1, GPIO2 → MXM3_3, GPIO3 → MXM3_5, GPIO4 → MXM3_7, GPIO5 → MXM3_11, GPIO6 → MXM3_13, GPIO7 → MXM3_15, GPIO8 → MXM3_17) found in apalis tk1 datasheet, p.13 and in apalis eval board datasheet p. 52 docs.toradex.com/101028-apalis-evaluation-board-datasheet.pdf
  • mapping from pin numbers X2 to bank values X3 (MXM3_1 → A1, MXM3_3 → A9, MXM3_5 → A8, MXM3_7 → A7, MXM3_11 → A6, MXM3_13 → A5, MXM3_15 → A4, MXM3_17 → A3) read from eval board or to be found in apalis eval board datasheet p. 52
  • in u-boot checked the gpios config of bank A with gpio status -a A (only A1: input: 1 [ ] is input) and gpio input 1gpio: pin 1 (gpio 1) value is 1
  • MXM3_1 means A10 pulled low and gpio input 1 again… → gpio: pin 1 (gpio 1) value is 1

I have no connector at X3 (A10<->B10) and no obvious HW connection failure for pulling down. What else cut be wrong?

Nothing is wrong but you do need to understand a little bit about how alternate functions, GPIOs and the pin muxing in general works. On the Tegras one can usually have one of eight possible alternate functions assigned to a pin. Plus there are further pin muxing settings like enabling input driver or tri-stating output driver plus drive strength and such. And at the very edge of the SoC a pin can also be configured as a GPIO. So you see that whether or not a pin acts as a GPIO needs to be configured somewhere. Usually this is automatically done when reserving a GPIO and setting its direction e.g. either as an input (default) or output (additionally requires a default value). What you are seeing with the gpio status command is just the ones that are already configured as GPIO. One may simply configure further pins as GPIOs by e.g. doing a gpio input A0, gpio clear A0 or gpio set A0. Alternatively as discussed before one may achieve the same in code from the board init function.

Thanks for that explanation. Knowing that I understand what I discovered when playing around with the gpio command in u-boot…