[U-Boot] [PATCH] mx5 iomux: Fix GPIO with SION

Benoît Thébaudeau
2012-08-17T16:21:33Z

Hi Stefano,

> On 14/08/2012 15:48, Beno?t Th?baudeau wrote:
> > IOMUX_CONFIG_GPIO may be used together with IOMUX_CONFIG_SION, so
> > don't break
> > the iomux function value set to the register in this case.
> >
> > Define the value of IOMUX_CONFIG_GPIO in a way showing that it
> > should have
> > only 1 bit set.
> >
> > Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> > Cc: Stefano Babic <sbabic@denx.de>
> > ---
>
> Hi Beno?t,
>
> to my understanding. The SION bit is used to set a predefined
> function,
> independently from the value of the iomux. So I have the choice to
> set
> the SION bit or I select the function I want, including GPIO,
> clearing
> the SION bit, and setting optionally the daisy chain register if the
> GPIO requires.
>
> So why should we use both SION and GPIO ?

No. See "A.3.2 SW Loopback through SION Bit" and "Figure A-3. IOMUX Cell Block
Diagram" in the i.MX51 RM.

Whether SION is set or not, the selected IOMUX function will drive the pin.

If SION is cleared, the input from the pin will be either disabled or go to the
selected IOMUX function depending on the activation of the input by this
function.

If SION is set, the input from the pin is always enabled and goes to all IOMUX
alternate functions at once (if their input connection to this pin is activated
through the daisy chain).

So SION does not invalidate the function bit-field.

Then, you could wonder what kind of real life use case could be useful with both
SION and GPIO set. This could be used for instance as a workaround to an erratum
if an IOMUX function does not drive its output properly, but it needs to read
back the pin status to work fine. Thus, the GPIO function output could be used
to drive the pin, with SION set so that the flawed IOMUX function can still
probe the pin and function properly internally. Note that it's only a
theoretical example; I don't remember such an erratum.

Best regards,
Beno?t