-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Add initial support for the Raspberry Pi Pico 2 #77368
base: main
Are you sure you want to change the base?
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
82e6a6f
to
161828a
Compare
@ajf58 |
161828a
to
b3ae76c
Compare
My suggestion. |
b3ae76c
to
83ab622
Compare
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.
Updates are OK. Though migration guide entry needed for the SoC symbol change
b4d5164
to
f5d043c
Compare
be3d6b9
to
384b0ee
Compare
@nordicjm where should this update go? Is under boards in doc/releases/migration-guide-4.0.rst correct? |
Yes |
The Raspberry Pi Pico 2's device is compatible with the existing Pico 1. The build system requires a `<board>.overlay` file, but these use the pre-processing to #include the sibling rpi_pico.overlay files rather than duplicating the contents as an attempt to keep things DRY. Tested locally. Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
For these tests' needs, the RP2350 on the Pico 2 is compatible with the RP2040 on the Pico 1. #include the latter's overlay in preference to duplicating the content. Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Add some documentation for the board itself (mostly aiming to refer to canonical sources of information rather duplicate). Add entries in the release notes where applicable. boards/raspberrypi/rpi_pico2/doc/img/rpi_pico2.webp is a cropped and compressed version of https://www.raspberrypi.com/documentation/microcontrollers/images/pico-2.png which is released under the CC-BY-SA-4.0 license. See https://github.com/raspberrypi/documentation/blob/develop/LICENSE.md Co-authored-by: Benjamin Cabé <kartben@gmail.com> Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Add OpenOCD debugger support. For now we will need a Raspberry Pi'a forked version of OpenOCD from https://github.com/raspberrypi/openocd . The default adapter speed is set to match Raspberry Pi's documentation. Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Extend gpio_api_1pin so that tests can require a test fixture to provide an external pulldown resistor to the board under test. Use the new test-gpio-external-pulldown device tree binding to define where that GPIO is, and, finally, add a device tree overlay for the Raspberry Pi Pico 2 board that defines where the pulldown provided by the fixture will be. Tested locally using `--fixture gpio_external_pull_down` when running Twister on the command line, or by creating and using a Hardware Map file, in combination with a modified Pico 2. Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Add initial support for the RP2350's PIO peripherals, extend the existing example under samples/boards/raspberrypi/rpi_pico/uart_pio to demonstrate this on the Raspberry Pi Pico 2, and update the board's documentation. Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com> Signed-off-by: Manuel Aebischer <manuel.aebischer@belden.com>
Add initial support for the RP2350's DMA peripheral, allow tests under drivers/dma/loop_transfer to run on on the Raspberry Pi Pico 2, and update the board's documentation. Signed-off-by: Manuel Aebischer <manuel.aebischer@belden.com> Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Avoid referring to Pico 2 (the name of a board). In this context, RPI_PICO is used to refer to the (Zephyr) `SOC_FAMILY` rather than the Pico 1 board. This clarifies common numerical values between the RP2040 and RP2350 SoC series, and enables existing DTS files to be used with RP2350-based boards with fewer changes. Remove the use of Zehpyr's `CONFIG_` macros from the device tree files, and replace them with `SOC_SERIES`-specific files. Update the driver implementation to conditionally include the correct file. Update documentation and samples to match. Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
From the API documentation, `dma_api_chan_filter`` can be given a value of NULL for `filter_param`. Match the behaviour of most implementations, and return true. This removes misleading error messages logged during tests (e.g. `test_tst_dma0_m2m_loop`). Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Increase test coverage for Raspberry Pi's SoCs. Use the `socs` folder rather than `boards` to enable these tests to run on any boards with the same SoCs. Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
The RP2350's PWM peripheral is largely unchanged from the RP2040's, but the higher clock frequency means the long blink delay must be lower. Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Assume that users want to run a dual Cortex-M33 on the Pico 2, and update various parts of the codebase to match. I expect the majority of the soc's definition will move from `dts/arm/raspberrypi` to `dts/common/raspberrypi` if/when support is added for the Hazard3 cores. Some parts of the codebase can cope without encoding the cluster in the filename (e.g. Twister seems to use the identifier in `boards/raspberrypi/rpi_pico2/rpi_pico2.yaml` rather than the filename itself), others can't (e.g. `rpi_pico2_m33_defconfig`) which itself is a form of <board>_<cpucluster>_defconfig and doesn't refer to the SoC. Despite this, some files have been given the verbose fully-specified name because this matches the current documentation. Update documentation to try to highlight the capabilities and limitations of the current support within Zephyr for the Pico 2 board and the underlying SoC. Update `.overlay` and `.conf` files in `samples/` and `tests/` to match the new requirement. Limited tested locally with no issues found. Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
b506648
to
c9567fb
Compare
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.
File name fettling has been done. Please note the commit message did (and still does) highlight that in several cases this wasn't required.
Since this is now not going into v4.0, I've also modified the relevant commit so that the documentation updates target v4.1's release notes.
Please note my comment regarding the squashing of rp2350: Define and implement a cpucluster of Cortex-M33s
. I'm not going to do that for the reasons I've already outlined above.
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright (c) 2024 Andrew Featherstone <andrew.featherstone@gmail.com> |
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.
Please can you mark this "conversation" as resolved? I don't think there's any more discussion to be had here.
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.
LGTM
This is clearly defined in the zephyr contribution guidelines, the exact point of which you have been made aware of earlier https://docs.zephyrproject.org/latest/contribute/guidelines.html#contribution-workflow
History has nothing to do with it, you're trying to claim if someone submits a PR with C code changes that do not compile, instead of fixing them in the original commit, they should add a new commit which fixes them on top of it to preserve the history, this makes absolutely no sense. |
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.
Squash requested changes into original commits
@nordicjm that's not at all what @ajf58 is saying (let alone "claiming"). Please, pretty please, refrain from telling people what they are saying "make no sense", especially if you're going into a straw man argument. The commit that's left "unsquashed" is transitioning from a working state to another working state, AFAICT, and reflecting changes along the lines of "initial support" --> "slightly improved initial support". That last commit would have likely been a different, follow-up, PR in other circumstances. |
The C part is applying the same logic here to code instead of a dts file. See #80707 (review)
Because we don't rebase history that has been merged, this has not been merged, you submit a clean PR which does what is needed, not add commits that you later fix up in the same PR, and this isn't even a zephyr this, this is a common sense thing with projects and git in general |
That is not how code review works here, or in Linux (which the process is inspired from), or I imagine in any other project with a maintainer structure. Fixups go in the commit that introduced a file, sure in other circumstances it would be fine, but this is not that and the fixup commit makes the stack incredibly hard to review and the whole PR evolution very VERY hard to follow, leading to this being delayed further. There's a reason why that's the process documented in the contribution guidelines. |
The commit content should not include the discussion process that led to this point, but rather revise it to a direct commit that reflects the final conclusion and commit it. I have sorted it out. Please check it out. (Need to clone the repository) There are some parts in the revision process that use my name, |
Do Not Merge @soburi 's branch.@kartben's comment is absolutely correct at #77368 (comment) . When @fabiobaltieri says:
There is no fixup commit. Again, kartben is absolutely spot on. This PR could have been merged as-is without the last commit. I don't endorse it, but it has to have my sign off because the "signed off by" process mandates it.
@soburi the branch you've created now really is wrong. At the very least:
No, absolutely not. You cannot take my work, break it, give it back to me, and expect me to fix it. |
Had a quick look at @soburi's branch and looks ok.
He's correctly squashed requested changes into the base commits
Have you ever actually used git before? This is what happens when you rebase, even if you make no changes, go and rebase and
Where? |
That's true. |
No one said my branch to merge.
Ok, of course, I'd welcome you to solve the problem your way. |
I share @fabiobaltieri 's concern. |
https://builds.zephyrproject.io/zephyr/pr/77368/docs/boards/index.html#name=pico+2
This is a PR to add support for the Raspberry Pi Pico 2 board, and the RP2350 SoC. See also the discussion at #77329
This should not be merged currently, as it includes changes that will break the clock control driver for the RP2040.Dependencies
cc: @yonsch @soburi