From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Tue, 01 Oct 2013 07:21:28 -0700 Subject: [U-Boot] [PATCH] mx6: Add IOMUX_CONFIG_SION flag to all GPIO pins In-Reply-To: References: <1380492900-910-1-git-send-email-otavio@ossystems.com.br> <524A88F2.9000903@denx.de> <201310011443.22955.marex@denx.de> Message-ID: <524ADA68.3090707@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/01/2013 06:08 AM, Otavio Salvador wrote: > On Tue, Oct 1, 2013 at 9:43 AM, Marek Vasut wrote: >> Dear Otavio Salvador, >> >>> On Tue, Oct 1, 2013 at 5:33 AM, Stefano Babic wrote: >>>> Hi Otavio, >>>> >>>> On 30/09/2013 00:15, Otavio Salvador wrote: >>>>> 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 >>>>> --- >>>> >>>> I come later in the discussion, but I see you all have found the >>>> solution ;-). >>>> >>>> I suggest you add in the commit message that this patch is only for >>>> i.MX6 (if you do not plan to extend it to the other i.MXes...), so that >>>> we can track that the same must be done also for the other SOCs. >>> >>> I think this is clear from the commit prefix. >> >> The commit message should be ARM: mx6: or such btw. >> >> It'd be nice to fix it up for MX5 as well so we're consistent. > > Benoit expressed some doubt if it can be assumed to behave the same > for all i.MX that's why I didn't apply it for all. I cannot look at > this, at this moment, so I prefer to not change it without checking > the datasheet for it. > The same behaviour is present on i.MX51 and i.MX53.