Re: [PATCH] gpio: mxc_gpio: fix reading state of GPIO pins in output mode

Tomas Paukrt tomaspaukrt at email.cz
Wed Aug 28 03:31:52 CEST 2024


> 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_8JtY4Kab6JQ@mail.gmail.com/
>
> I hope this helps to clarify.

There is a good point that using the PSR register is useful for board prototyping,
because it indicates the level sensed on the pad which may differ if there
is an external level conflict on the pin.

On the other hand, there is a note that enabling SION for all pads in GPIO mode
will have some impact on the power consumption.

I checked the current Linux driver and it uses the DR register for all outputs.
This change was implemented about a year later after the mentioned discussion:

https://lore.kernel.org/all/1430321701-13758-5-git-send-email-vladimir_zapolskiy@mentor.com/

So both the Linux kernel and the NXP U-Boot work as expected, but the mainline U-Boot does not.

Best regards

Tomas


More information about the U-Boot mailing list