Skip to contentSkip to conversation

imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro

PATCH New Otavio Salvador 2 participants 3 messages Oct 11, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>, Fabio Estevam <[email protected]> and Eric B?nard <[email protected]> for helping to properly trace this down.

---
Changes in v2:
- Fix too long line
- Move it just before MUX_PAD_CTRL(x)

 arch/arm/include/asm/imx-common/iomux-v3.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/include/asm/imx-common/iomux-v3.h +2 -0
index dc2b3ef..dec11a1 100644
@@ -63,6 +63,8 @@ typedef u64 iomux_v3_cfg_t;
 #define MUX_SEL_INPUT_SHIFT	59
 #define MUX_SEL_INPUT_MASK	((iomux_v3_cfg_t)0xf << MUX_SEL_INPUT_SHIFT)
 
+#define MUX_MODE_SION		((iomux_v3_cfg_t)IOMUX_CONFIG_SION << \
+	MUX_MODE_SHIFT)
 #define MUX_PAD_CTRL(x)		((iomux_v3_cfg_t)(x) << MUX_PAD_CTRL_SHIFT)
 
 #define IOMUX_PAD(pad_ctrl_ofs, mux_ctrl_ofs, mux_mode, sel_input_ofs,	\
Signature · 1 line
1.8.4.rc3
#1 lore raw

PATCH 1/1 imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro

Dear Otavio Salvador,

Quoted 11 lines

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:

I think I already saw this patch. Is this a V2? Or a repost?

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro

Quoted 8 lines · Marek Vasut

Dear Otavio Salvador,

Quoted 6 lines

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);

Quoted 7 lines
Quoted 5 lines

`----

The IOMUX_CONFIG_SION allows for reading PAD value from PSR register.

The following quote from the datasheet:

I think I already saw this patch. Is this a V2? Or a repost?

This is the v2; my fault of bad tagging it.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750