Skip to content

Commit 8c6d543

Browse files
committed
rp2350: Define and implement a cpucluster of Cortex-M33s
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 <[email protected]>
1 parent c15aba4 commit 8c6d543

File tree

20 files changed

+78
-22
lines changed

20 files changed

+78
-22
lines changed

boards/raspberrypi/rpi_pico2/Kconfig.rpi_pico2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
config BOARD_RPI_PICO2
5-
select SOC_RP2350A
5+
select SOC_RP2350A_M33 if BOARD_RPI_PICO2_RP2350A_M33

boards/raspberrypi/rpi_pico2/doc/index.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Overview
66
The Raspberry Pi Pico 2 is the second-generation product in the Raspberry Pi
77
Pico family. From the `Raspberry Pi website <https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html>`_ is referred to as Pico 2.
88

9+
There are many limitations of the board currently. Including but not limited to:
10+
- The Zephyr build only supports configuring the RP2350A with the Cortex-M33 cores.
11+
- As with the Pico 1, there's no support for running any code on the second core.
12+
913
Hardware
1014
********
1115

@@ -26,7 +30,7 @@ Hardware
2630
Supported Features
2731
==================
2832

29-
The ``rpi_pico2`` board target supports the following
33+
The ``rpi_pico2/rp2350a/m33`` board target supports the following
3034
hardware features:
3135

3236
.. list-table::

boards/raspberrypi/rpi_pico2/rpi_pico2.dts renamed to boards/raspberrypi/rpi_pico2/rpi_pico2.dtsi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
/dts-v1/;
8-
97
#include <freq.h>
108

119
#include <zephyr/dt-bindings/i2c/i2c.h>
1210
#include <zephyr/dt-bindings/pwm/pwm.h>
1311

14-
#include <raspberrypi/rpi_pico/rp2350a.dtsi>
15-
1612
#include "rpi_pico2-pinctrl.dtsi"
1713
#include "../common/rpi_pico-led.dtsi"
1814

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2024 Andrew Featherstone
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
/* The build system assumes that there's a cpucluster-specific file.
10+
*
11+
* This file provides composition of the device tree:
12+
* 1. The common features of the SoC
13+
* 2. Core-specific configuration.
14+
* 3. Board-specific configuration.
15+
*/
16+
#include <raspberrypi/rpi_pico/rp2350a.dtsi>
17+
#include <raspberrypi/rpi_pico/m33.dtsi>
18+
19+
/* there's nothing specific to the Cortex-M33 cores vs the (not yet
20+
* implemented) Hazard3 cores.
21+
*/
22+
#include "rpi_pico2.dtsi"

boards/raspberrypi/rpi_pico2/rpi_pico2.yaml renamed to boards/raspberrypi/rpi_pico2/rpi_pico2_rp2350a_m33.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
identifier: rpi_pico2
2-
name: Raspberry Pi Pico 2
1+
identifier: rpi_pico2/rp2350a/m33
2+
name: Raspberry Pi Pico 2 (Cortex-M33)
33
type: mcu
44
arch: arm
55
flash: 4096

boards/raspberrypi/rpi_pico2/rpi_pico2_defconfig renamed to boards/raspberrypi/rpi_pico2/rpi_pico2_rp2350a_m33_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This configuration is orthogonal to whether the Cortex-M33 or Hazard3 cores
2+
# are in use, but Zephyr does not support providing a qualifier-agnostic
3+
# _defconfig file.
14
CONFIG_BUILD_OUTPUT_HEX=y
25
CONFIG_BUILD_OUTPUT_UF2=y
36
CONFIG_CLOCK_CONTROL=y
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2024 Andrew Featherstone
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <arm/armv8-m.dtsi>
8+
9+
/* Model in the device tree a Cortex-M33 core being 'plugged' into each
10+
* 'socket' within the SoC. Within the datasheet these are core 0 and core 1.
11+
*/
12+
&cpu0 {
13+
compatible = "arm,cortex-m33";
14+
};
15+
16+
&cpu1 {
17+
compatible = "arm,cortex-m33";
18+
};
19+
20+
&nvic {
21+
arm,num-irq-priority-bits = <4>;
22+
};

dts/arm/raspberrypi/rpi_pico/rp2350.dtsi

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <arm/armv8-m.dtsi>
87
#include <zephyr/dt-bindings/adc/adc.h>
98
#include <zephyr/dt-bindings/gpio/gpio.h>
109
#include <zephyr/dt-bindings/clock/rpi_pico_rp2350_clock.h>
@@ -26,13 +25,16 @@
2625
#address-cells = <1>;
2726
#size-cells = <0>;
2827

28+
/* There are two CPU sockets in the RP2350-series SoCs.
29+
* Represent the sockets in the device tree as these two
30+
* partially-defined CPU instances. Use a separate DTSI file to
31+
* define what kind of CPU cores they are.
32+
*/
2933
cpu0: cpu@0 {
30-
compatible = "arm,cortex-m33";
3134
reg = <0>;
3235
};
3336

3437
cpu1: cpu@1 {
35-
compatible = "arm,cortex-m33";
3638
reg = <1>;
3739
};
3840
};
@@ -434,7 +436,3 @@
434436
status = "disabled";
435437
};
436438
};
437-
438-
&nvic {
439-
arm,num-irq-priority-bits = <4>;
440-
};

0 commit comments

Comments
 (0)