Skip to content

drivers: gpio: xlnx_ps: Do not clear GPIO states on initialization #89424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

robhancocksed
Copy link
Contributor

This driver was setting all GPIO lines to input and the data register to zero on initialization. This does not appear to be common practice among other GPIO drivers, and in fact caused a serious problem on the ZynqMP platform, where between 1 and 4 of the top-most GPIO lines are frequently used by platform firmware and Vivado as reset lines for the programmable logic. Since these resets are active low, and their input/output state is ignored due to how they are connected to the EMIO GPIO outputs from the PS, this caused the PL reset to be asserted when the GPIO driver initialized, preventing any logic using that reset from functioning properly.

There may also be other cases where GPIO line states have already been set by the boot loader or firmware and clearing them may result in improper behavior or glitches on the lines during initialization.

Update the driver to disable GPIO interrupts but leave the pin modes/states unchanged until/unless they are explicitly reconfigured.

This driver was setting all GPIO lines to input and the data register to
zero on initialization. This does not appear to be common practice among
other GPIO drivers, and in fact caused a serious problem on the ZynqMP
platform, where between 1 and 4 of the top-most GPIO lines are
frequently used by platform firmware and Vivado as reset lines for the
programmable logic. Since these resets are active low, and their
input/output state is ignored due to how they are connected to the EMIO
GPIO outputs from the PS, this caused the PL reset to be asserted when
the GPIO driver initialized, preventing any logic using that reset from
functioning properly.

There may also be other cases where GPIO line states have already been
set by the boot loader or firmware and clearing them may result in
improper behavior or glitches on the lines during initialization.

Update the driver to disable GPIO interrupts but leave the pin
modes/states unchanged until/unless they are explicitly reconfigured.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
@kartben kartben merged commit 83488e4 into zephyrproject-rtos:main May 6, 2025
25 checks passed
@robhancocksed robhancocksed deleted the gpio-xlnx-ps-dont-reset-on-init branch May 13, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants