]> code.ossystems Code Review - bsp/u-boot.git/commit
imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro
authorOtavio Salvador <otavio@ossystems.com.br>
Thu, 3 Oct 2013 11:20:58 +0000 (08:20 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Fri, 1 Nov 2013 21:05:43 +0000 (19:05 -0200)
commitd5bd7b9f1916ee98621769bed0256d1aaf9684e7
treebc4973ad5ae3cdddac7eebd7145930255bf35ac7
parentcc5fb615e6ec8dfefc1f85740777693f32bb7042
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@advansee.com>, Fabio
Estevam <fabio.estevam@freescale.com> and Eric Bénard
<eric@eukrea.com> for helping to properly trace this down.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
arch/arm/include/asm/imx-common/iomux-v3.h