[U-Boot] [PATCH] mx6: gpio: read data register if direction is out
Fabio Estevam
festevam at gmail.com
Tue Jun 24 15:13:23 CEST 2014
On Tue, Jun 24, 2014 at 10:07 AM, Stefano Babic <sbabic at denx.de> wrote:
> What you are describing looks an issue in your pinmux configuration
> because you do not set the SION bit, as requested to read back the value
> of the GPIO from the Pad Register.
Yes, correct.
Klaus, please check this commit:
commit 7773fd196918826ebaab769e63a4775607f5256c
Author: Otavio Salvador <otavio at ossystems.com.br>
Date: Mon Dec 16 20:44:00 2013 -0200
imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro
The macro allows easy setting in per-pin, as for example:
,----
| imx_iomux_v3_setup_pad(MX6_PAD_NANDF_D1__GPIO_2_1 | MUX_MODE_SION);
`----
The IOMUX_CONFIG_SION allows for reading PAD value from PSR register.
The following quote from the datasheet:
,----
| ...
| 28.4.2.2 GPIO Write Mode
| The programming sequence for driving output signals should be as follows:
| 1. Configure IOMUX to select GPIO mode (Via IOMUXC), also enable
SION if need
| to read loopback pad value through PSR
| 2. Configure GPIO direction register to output (GPIO_GDIR[GDIR]
set to 1b).
| 3. Write value to data register (GPIO_DR).
| ...
`----
This fixes the gpio_get_value to properly work when a GPIO is set for
output and has no conflicts.
Thanks for Benoît Thébaudeau <benoit.thebaudeau at advansee.com>, Fabio
Estevam <fabio.estevam at freescale.com> and Eric Bénard
<eric at eukrea.com> for helping to properly trace this down.
Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
Acked-by: Stefano Babic <sbabic at denx.de>
More information about the U-Boot
mailing list