From: =?utf-8?Q?Beno=C3=AEt_Th=C3=A9baudeau?= Date: Thu, 21 Nov 2013 01:00:35 +0100 (CET) Subject: [U-Boot] [RESEND PATCH] imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro In-Reply-To: <1382398126-7551-1-git-send-email-otavio@ossystems.com.br> References: <1382398126-7551-1-git-send-email-otavio@ossystems.com.br> Message-ID: <1706938521.560051.1384992035320.JavaMail.zimbra@advansee.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Adding Stefano to Cc. On Tuesday, October 22, 2013 1:28:46 AM, Otavio Salvador wrote: > 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 , Fabio > Estevam and Eric B?nard > for helping to properly trace this down. > > Signed-off-by: Otavio Salvador > --- > arch/arm/include/asm/imx-common/iomux-v3.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h > b/arch/arm/include/asm/imx-common/iomux-v3.h > index dc2b3ef..dec11a1 100644 > --- a/arch/arm/include/asm/imx-common/iomux-v3.h > +++ b/arch/arm/include/asm/imx-common/iomux-v3.h > @@ -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, \ > -- > 1.8.4.rc3 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot >