Skip to content

Conversation

jwnrt
Copy link

@jwnrt jwnrt commented Oct 3, 2025

GPIO has a chardev interface for driving the inputs into QEMU, however we're currently clearing our memory of these lines at reset.

For bootstrapping Earlgrey we need to assert some pins and then reset the chip. I have restored the input lines on reset so we remember which pins were asserted.

@rivos-eblot
Copy link

rivos-eblot commented Oct 3, 2025

I start to think that we are trying to solve these reset issues the wrong way.
I do not think it is the GPIO that should not be reset. There should be some persistent state, but that is not part of the GPIO that does get reset if I'm not mistaken.

The state is preserved on the board/chip package where some signal are maintained. On reset, the GPIO gets reset as other IPs, then samples what's on the external pins. The more we deviate from the actual HW, the more we'll get into trouble.

I think what is really needed here is a padring which should be part of the SoC and that the GPIO must be connected to it.

@jwnrt
Copy link
Author

jwnrt commented Oct 7, 2025

Yes, I think you're right. The padring should have the chardev interface that GPIO currently has and we should route those pads through pinmux and to the GPIO block. It would also be nice to have a "pin" for reset in the padring too.

Would you be willing to accept this patch to the GPIO block before we start moving everything to padring? We'd like to get bootstrapping working in the shorter term if possible.

@rivos-eblot
Copy link

rivos-eblot commented Oct 7, 2025

Would you be willing to accept this patch to the GPIO block before we start moving everything to padring?

Can you only keep it for EG? I'm pretty sure if we use the DJ version we will get into trouble ( + add a new ticket for the padring work)

@jwnrt jwnrt force-pushed the jw/gpio-remember-inputs branch 3 times, most recently from f9d0b9a to 670483c Compare October 7, 2025 10:24
Copy link

@rivos-eblot rivos-eblot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the format of the PR title as well? Thanks.

Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
@jwnrt jwnrt force-pushed the jw/gpio-remember-inputs branch from 670483c to 32a8be4 Compare October 7, 2025 11:10
@jwnrt jwnrt requested a review from rivos-eblot October 7, 2025 11:10
Copy link

@rivos-eblot rivos-eblot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can you update the PR title with the "new" syntax? Thanks.

@jwnrt jwnrt changed the title [ot] hw/opentitan: gpio: remember input lines between resets gpio: remember input lines between resets Oct 7, 2025
@AlexJones0 AlexJones0 changed the title gpio: remember input lines between resets ot_gpio_eg: remember input lines between resets Oct 7, 2025
@jwnrt jwnrt merged commit c232d98 into lowRISC:ot-9.2.0 Oct 7, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants