-
Notifications
You must be signed in to change notification settings - Fork 8.2k
soc: rp2350: fix pinctrl and PWM for GPIOs 32 through 47 #93064
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
ajf58
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit (sorry): in the commit message "available on RP2030" is a minor but confusing typo that might be a bit of a pain when searching the commit history in the future.
Other than that this looks great.
I think both instances of that accurately reflect what I meant to write; what wording do you have in mind? |
RP2350 has 48 GPIOs, where only the first 30 are broken out to pins on RP2350A (same as RP2040) and the remaining 18 are only usable on RP2350B. This change makes the soc pinctrl driver support GPIOs above 31, where previously it was impossible to configure GPIOs 32 through 47. Tested on RP2350B, confirming that GPIO44 can be correctly configured for PWM. Signed-off-by: Peter Marheine <[email protected]>
Never mind, I realized it should be RP2040. |
RP2350 adds four more PWM slices from the eight available on RP2040, which are only broken out to package pins on RP2350B. This change fixes the driver to support the correct number of slices on RP2350. Tested by confirming that PWM can correctly be configured on GPIO 44 of RP2350B. Signed-off-by: Peter Marheine <[email protected]>
The macros for PWM output on these GPIOs had names that referred to PWM channels that do no exist on this chip- it only has 12 channels, where channels 8..11 are exposed on both GPIOs 32..39 and 40..47. Signed-off-by: Peter Marheine <[email protected]>
|
|
@ajf58 |



The rpi_pico pinctrl driver only supported up to 32 GPIOs, while RP2350 has up to 48. This changes the driver to support the additional ones, by allocating one more bit in pinctrl values.
The rpi_pico PWM driver also failed to handle PWM channels 8 through 11, which were added on RP2350. That driver is fixed to support up to the required 12 channels, and the pinctrl macros modified to accurately reflect which PWM channels can be connected to which pin.