Vybrid GPIO input in U-Boot


I am able to set/clear GPIO pins in U-Boot using

Colibri VFxx # gpio clear 25
gpio: pin 25 (gpio 25) value is 0
Colibri VFxx # gpio set 25  
gpio: pin 25 (gpio 25) value is 1

But if I read the current value, I always get 0:

Colibri VFxx # gpio input 25
gpio: pin 25 (gpio 25) value is 0

even if the pin is pulled up.
I tried GPIO 111 with the same result.

Can you give me a hint what I have to change to use a GPIO as input?

Thank you very much,


Hi Sandro. How much pull up on the pin? If the pin is configured for pull down in the IOMUX settings, this may produce a voltage divider.

I found the solution:
The pins were not enabled in U-Boot (I assumed, they were because I could set them)
I added the needed pin configurations to arch/arm/include/asm/arch-vf610/iomux-vf610.h (I took the values from the kernel devicetree vf610-pinfunc.h, so I avoided reading the processor manual)
and appended the pin configs in board/toradex/colibri_vf/colibri_vf.c to setup_iomux_gpio().

@sst Yes, you are correct one need to configure the IO mux of respective pin for using it as GPIO properly. We added IO mux config for few free IO’s as an example in this commit.