Skip to content

treewide: rp2350: migrate rp2350 to HWMV2 compliant CPU clusters - #117192

Open
afantino951 wants to merge 15 commits into
zephyrproject-rtos:mainfrom
afantino951:rp2350-migration-perboard
Open

treewide: rp2350: migrate rp2350 to HWMV2 compliant CPU clusters #117192
afantino951 wants to merge 15 commits into
zephyrproject-rtos:mainfrom
afantino951:rp2350-migration-perboard

Conversation

@afantino951

@afantino951 afantino951 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Background

The rp2350 is a 2 core MCU where each core can be either a Cortex-M33 or Hazard3 core (See Figure 6 from the rp2350 datasheet).

Currently, the rp2350's soc files defines an m33 and hazard3 cpu cluster and its cpu cluster Kconfig symbols are

config SOC_RP2350A_HAZARD3
bool
select SOC_RP2350A
help
Use the RP2350A with a Hazard3 core in both 'sockets'.

The rp2350's CPU Cluster does not follow the HWMV2, and needs to be updated to match the definition of CPU Cluster, before work can proceed on multi-core AMP on the rpi_pico2 (#109953).

Summary of changes

  • Deprecate SOC_RP2350(AB)_[HAZARD3|M33] in favor of SOC_RP2350(AB)_[HAZARD3|M33]_0
  • Add m33_0/hazard3_0 CPU clusters to the soc.yaml. Do not remove m33/hazard3 cpu clusters to avoid breaking downstream boards.
  • Update all in-tree boards, samples, tests, documentation, etc, to use the corrected board target with help from LLM-generated script
    • Example: instead of rpi_pico2/rp2350a/m33, the board target is now rpi_pico2/rp2350a/m33_0

Testing

The following rg command should return very little (enough to be verified by a human):

rg --files | rg -iP 'rp2350[ab][_/](hazard3|m33)(?!_0)'
rg -iP 'rp2350[ab][_/](hazard3|m33)(?!_0)'

Note

There are 2 files that in tests/drivers/adc that will show as output to the rg --files, but these will be removed in #117191

Ran west twister -p rpi_pico2/rp2350a/m33_0 -p rpi_pico2/rp2350a/m33_0_w -p rpi_pico2/rp2350a/hazard3_0 and other cases. My machine not beefy enough to handle all 15376 test cases to build verify on each changed board, so I did a small sample on other boards.


Open Questions

  1. Do we want to keep the m33 and hazard3 cpu clusters for now and remove them after a release? Is it ok to remove them now and have downstream boards use ZEPHYR_BOARD_ALIAS?
  2. I originally added a commit at the very end of this PR to remove the migration script, but internal feedback suggested that I leave it in tree for a release so downstream boards can use it. The migration script is "AI Slop" and I cannot vouch for its quality other than the fact that it was used it to do the migration for the in-tree boards programatically.

The rp2350 has 2 cores that can independently configured to use either
the Cortex-M33 or the Hazard3 cpu. The current m33 and hazard3 cpu
clusters do not conform to the hardware model v2.

Deprecate the m33 and hazard3 cpucluster's Kconfigs and replace with
m33_0 and hazard3_0 cpuclusters.

The m33 cpucluster will be removed from the soc.yml in a later release
to avoid breaking downstream boards.

Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Adds scripts/migrate_rp2350_clusters.py to mechanically migrate rp2350a/
rp2350b boards from the legacy bare "hazard3"/"m33" cpucluster
qualifiers to the dual-core-aware "hazard3_0"/"m33_0" qualifiers:
renames/copies board file triples (dts/yaml/defconfig), adds the missing
Kconfig select lines, renames SoC-scoped test overlays, and fixes
tests.yaml/sample.yaml qualifier references.

Also add find_readme_edits to fix the same "<board>/<soc>/<cluster>"
qualifier references in tests/**/README.rst and samples/**/README.rst
files, mirroring find_board_doc_edits for board doc/index.rst pages -
these are a separate location the earlier doc-edit pass didn't cover.

Add find_board_yml_cpucluster_edits to rewrite "cpucluster: <cluster>"
lines in each migrated board's own board.yml to the "_0" form, deduped
per (board_dir, old_cluster) since the field isn't SoC-scoped.

Dry-run by default; --apply performs the changes, --boards scopes to
specific boards.

Assisted-by: Claude:sonnet5[1m]
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to adafruit_metro_rp2350.

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to motion_2350_pro.

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to beetle_rp2350

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to pico2_spe board.

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to pico_plus2 board

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to rpi_pico2 board

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to xiao_rp2350 board

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to rp2350_zero board

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to rp2350b_core board

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to w5500_evb_pico2 board

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py scripts to w6100_evb_pico2 board

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Applies migrate_rp2350_clusters.py script to w6300_evb_pico2 board

Renames the board's file triple, per-board overlay/conf files, and (once
no other board still depends on it) shared SoC-scoped overlays to their
_0 counterparts, retires the stale bare Kconfig select line, and fixes
qualifier references in tests.yaml/sample.yaml and doc/index.rst.

Assisted-by: Claude:sonnet5
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
Documents the deprecation of the bare hazard3/m33 RP2350 cpucluster
qualifiers and their SOC_RP2350[AB]_HAZARD3/_M33 Kconfig symbols in
favor of hazard3_0/m33_0, in both the 4.5 migration guide and release
notes. Both the old Kconfig symbols and the bare soc.yml cpucluster
entries will be removed in a future release.

Assisted-by: Claude:sonnet5[1m]
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
@afantino951 afantino951 changed the title Rp2350 migration perboard treewide: rp2350: migrate rp2350 to HWMV2 compliant CPU clusters Aug 24, 2026
@zephyrbot zephyrbot added area: ADC Analog-to-Digital Converter (ADC) area: Boards/SoCs area: DMA Direct Memory Access area: GPIO area: LED Label to identify LED subsystem area: Samples Samples area: Shields Shields (add-on boards) area: Tests Issues related to a particular existing or missing test platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico) platform: Seeed Studio Seeed Studio platforms labels Aug 24, 2026
Comment on lines 12 to +13
config SOC_RP2350A_HAZARD3
select DEPRECATED

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

deprecate in Kconfig.soc


config BOARD_ADAFRUIT_METRO_RP2350
select SOC_RP2350B_M33 if BOARD_ADAFRUIT_METRO_RP2350_RP2350B_M33
select SOC_RP2350B_M33_0 if BOARD_ADAFRUIT_METRO_RP2350_RP2350B_M33_0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you cannot deprecate until all in-tree instances have been moved over

Comment on lines +1 to +4
/*
* SPDX-FileCopyrightText: Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
* SPDX-License-Identifier: Apache-2.0
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can't steal a copyright

Comment on lines +1 to +4
/*
* SPDX-FileCopyrightText: Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
* SPDX-License-Identifier: Apache-2.0
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

likewise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ADC Analog-to-Digital Converter (ADC) area: Boards/SoCs area: DMA Direct Memory Access area: GPIO area: LED Label to identify LED subsystem area: Samples Samples area: Shields Shields (add-on boards) area: Tests Issues related to a particular existing or missing test platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico) platform: Seeed Studio Seeed Studio platforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants