Hi Tomas, On Tue, Aug 27, 2024 at 4:53 PM Fabio Estevam <[email protected]> wrote: > > Hi Tomas, > > On Tue, Aug 27, 2024 at 4:41 PM Tomas Paukrt <[email protected]> wrote: > > > Hi Fabio, > > > > you are correct that the existing code will work if the SION bit is set, > > but this is not always possible or desirable. For example, if you use the > > command "gpio set" to set the state of a pin that is not configured in DTS > > then you will get the error message "Warning: value of pin is still 0". > > Also the command "gpio status -a" shows wrong states of some output pins > > without this patch. > > This happens due to an incorrect devicetree description, i.e, the lack > of setting the SION bit. > > > Please see the chapters "GPIO data register (GPIOx_DR)" and "GPIO pad > > status register (GPIOx_PSR)" in the document IMX6ULLRM.pdf which show that > > it is possible to use the DR register instead of the PSR register in this > > case. > > > > I also found the exactly same modification in NXP version of U-Boot > > (https://github.com/nxp-imx/uboot-imx/commit/4afc3f90943c6b117f79b66d2cd04e64f437b0c2) > > made by an NXP employee. > > Adding Ye Li on Cc. > > There were many attempts to fix this in both U-Boot and the kernel, > but the recommendation has always been: "Set the SION bit if you need > to read the output state".
For more information, please read this thread posted on linux-arm-kernel ten years ago: https://patchwork.kernel.org/project/linux-arm-kernel/patch/CAJ+vNU3w9Oi+dErmy9x8g6ps=eLHLNLO-w7=gn_8jty4kab...@mail.gmail.com/ I hope this helps to clarify.

