rp23xx/rp23xx-rv: Fix GPIO interrupt handler for RP2350B variant.#18287
Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom Jan 30, 2026
Merged
rp23xx/rp23xx-rv: Fix GPIO interrupt handler for RP2350B variant.#18287xiaoxiang781216 merged 1 commit intoapache:masterfrom
xiaoxiang781216 merged 1 commit intoapache:masterfrom
Conversation
The GPIO interrupt handler had hardcoded values that only worked correctly for RP2350A (30 GPIOs). For RP2350B (48 GPIOs): - Loop count was hardcoded to 6 registers but should be computed based on RP23XX_GPIO_NUM (4 for RP2350A, 6 for RP2350B) - Reserved bits mask was always applied at register index 3, but for RP2350B register 3 contains valid GPIOs 24-31. This caused interrupts for GPIOs 30-31 to be incorrectly discarded - PWM port validation rejected valid ports 8-11 on RP2350B which has 12 PWM slices instead of 8 Changes: - Add RP23XX_GPIO_NREGS macro to compute number of interrupt registers - Use conditional compilation to only mask reserved bits on RP2350A where the last register has 6 valid GPIOs (bits 0-23) - Fix PWM port validation to allow 12 ports on RP2350B Signed-off-by: paolo <paolo.volpi@gmail.com>
acassis
approved these changes
Jan 30, 2026
xiaoxiang781216
approved these changes
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The GPIO interrupt handler had hardcoded values that only worked correctly for RP2350A (30 GPIOs). For RP2350B (48 GPIOs):
Changes:
Summary
Problem
The GPIO interrupt handler had hardcoded values that only worked for RP2350A (30 GPIOs):
Changes
RP23XX_GPIO_NREGSmacro to compute number of interrupt registersTesting
Tested on RP2350B hardware with GPIO interrupts on pins > 29.
Impact
Both ARM (rp23xx) and RISC-V (rp23xx-rv) architectures are fixed.