Skip to content
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

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3564e69
dts: arm: Move rpi_pico under raspberrypi
ajf58 Aug 27, 2024
ab685f9
dts: arm: rp2040: Improve naming of included files
ajf58 Aug 27, 2024
08d8ed7
drivers: clock_control: rpi_pico: Correct bitfields during init
ajf58 Aug 29, 2024
624a653
dts: bindings: clock: rpi_pico: Add default value matching the Pico SDK
ajf58 Oct 6, 2024
2908fde
drivers: clock_control: rpi_pico: Make pinctrl-0 optional
ajf58 Sep 27, 2024
f1be0dc
drivers: clock_control: rpi_pico: Add support for the RP2350.
ajf58 Aug 21, 2024
5560f15
soc: rp2350: Add initial support for the Raspberry Pi RP2350
ajf58 Aug 21, 2024
fcc98a1
drivers: hwinfo: rp2350: Add initial support for RP2350
ajf58 Aug 23, 2024
6f567cf
drivers: clock_control: rpi_pico: Start tick generators for timers
ajf58 Sep 1, 2024
e084ac0
drivers: watchdog: rpi_pico: Add support for RP2350
soburi Sep 2, 2024
f2432f9
drivers: counter: rpi_pico_timer: Add support for RP2350
ajf58 Sep 25, 2024
a1cf375
pinctrl: raspberrypi: rp2350: Add support for RP2350X
ajf58 Sep 9, 2024
9f2c7cf
boards: rp2040: Lint whitespace in board.cmake files
ajf58 Oct 9, 2024
897af30
rp2350: Fix for storing larger pinctrl alt func
petejohanson Nov 4, 2024
af28df1
boards: Add initial support for the Raspberry Pi Pico 2
ajf58 Aug 21, 2024
f9183a4
UF2: Enable support for Raspberry Pi RP2350
oscardagrach Sep 20, 2024
3bba48b
samples: rpi_pico2: Add ADC-related samples for rpi_pico2
ajf58 Aug 31, 2024
1320458
tests: drivers: adc_api: Add support for the Raspberry Pi Pico 2
ajf58 Sep 3, 2024
37dba18
doc: rpi_pico2: Document Raspberry Pi Pico 2 and related changes
ajf58 Aug 31, 2024
164f9d4
boards: raspberrypi: rpi_pico2: Add OpenOCD runner configuration
ajf58 Sep 27, 2024
7dcb537
tests: gpio_api_1pin: rpi_pico2: Support using external pulldowns
ajf58 Oct 4, 2024
0568837
rpi_pico2: rp2350: Add PIO support and extend samples
Oct 15, 2024
3bb3bea
rpi_pico2: rp2350: Add DMA support
ajf58 Oct 16, 2024
e4bd97e
drivers: dma: rpi_pico: Refactor DMA files for Raspberry Pi SoCs
ajf58 Oct 17, 2024
cd90b2d
drivers: dma: rpi_pico: Correct handling of NULL filter_param
ajf58 Oct 18, 2024
b94ec77
tests: drivers: dma: Increase test coverage for RP2040 and RP2350A
ajf58 Oct 19, 2024
c73a7e9
samples: drivers: led: pwm: Add rpi_pico2 board
ajf58 Oct 19, 2024
c9567fb
rp2350: Define and implement a cpucluster of Cortex-M33s
ajf58 Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
/dts/arm/nxp/ @mmahadevan108 @dleach02
/dts/arm/nxp/nxp_s32* @manuargue
/dts/arm/microchip/ @franciscomunoz @albertofloyd @sjvasanth1
/dts/arm/rpi_pico/ @yonsch
/dts/arm/raspberry/rpi_pico/ @yonsch
/dts/arm/silabs/efm32_pg_1b.dtsi @rdmeneze
/dts/arm/silabs/efm32gg11b* @oanerer
/dts/arm/silabs/efr32bg13p* @mnkp
Expand Down
3 changes: 2 additions & 1 deletion Kconfig.zephyr
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,8 @@ config BUILD_OUTPUT_UF2_FAMILY_ID
default "0xada52840" if SOC_NRF52840_QIAA
default "0x4fb2d5bd" if SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX
default "0x2abc77ec" if SOC_SERIES_LPC55XXX
default "0xe48bff56" if SOC_SERIES_RP2XXX
default "0xe48bff56" if SOC_SERIES_RP2040
soburi marked this conversation as resolved.
Show resolved Hide resolved
default "0xe48bff57" if SOC_SERIES_RP2350
default "0x68ed2b88" if SOC_SERIES_SAMD21
default "0x55114460" if SOC_SERIES_SAMD51
default "0x647824b6" if SOC_SERIES_STM32F0X
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3501,7 +3501,7 @@ Raspberry Pi Pico Platforms:
- boards/raspberrypi/
- boards/adafruit/kb2040/
- boards/sparkfun/pro_micro_rp2040/
- dts/arm/rpi_pico/
- dts/arm/raspberrypi/rpi_pico/
- dts/bindings/*/raspberrypi,pico*
- drivers/*/*rpi_pico
- drivers/*/*rpi_pico*/
Expand Down
3 changes: 0 additions & 3 deletions boards/adafruit/kb2040/adafruit_kb2040-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
};
};

clocks_default: clocks_default {
};

ws2812_pio0_default: ws2812_pio0_default {
ws2812 {
pinmux = <PIO0_P17>;
Expand Down
7 changes: 1 addition & 6 deletions boards/adafruit/kb2040/adafruit_kb2040.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/dts-v1/;

#include <rpi_pico/rp2040.dtsi>
#include <raspberrypi/rpi_pico/rp2040.dtsi>
#include "adafruit_kb2040-pinctrl.dtsi"
#include "sparkfun_pro_micro_connector.dtsi"
#include <freq.h>
Expand Down Expand Up @@ -56,11 +56,6 @@
};
};

&clocks {
pinctrl-0 = <&clocks_default>;
pinctrl-names = "default";
};

&uart0 {
current-speed = <115200>;
status = "okay";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
};
};

clocks_default: clocks_default {
};

ws2812_pio1_default: ws2812_pio1_default {
ws2812 {
pinmux = <PIO1_P12>;
Expand Down
7 changes: 1 addition & 6 deletions boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/dts-v1/;

#include <rpi_pico/rp2040.dtsi>
#include <raspberrypi/rpi_pico/rp2040.dtsi>
#include "adafruit_qt_py_rp2040-pinctrl.dtsi"
#include "seeed_xiao_connector.dtsi"
#include <freq.h>
Expand Down Expand Up @@ -56,11 +56,6 @@
};
};

&clocks {
pinctrl-0 = <&clocks_default>;
pinctrl-names = "default";
};

&uart1 {
current-speed = <115200>;
status = "okay";
Expand Down
30 changes: 30 additions & 0 deletions boards/raspberrypi/common/rpi_pico-led.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2021 Yonatan Schachter
*
* SPDX-License-Identifier: Apache-2.0
*/

/* Pico and Pico 2 boards (but not Pico W) have a common LED placement. */
/ {
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
label = "LED";
};
};

pwm_leds {
compatible = "pwm-leds";
status = "disabled";
pwm_led0: pwm_led_0 {
pwms = <&pwm 9 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
label = "PWM_LED";
};
};

aliases {
led0 = &led0;
pwm-led0 = &pwm_led0;
};
};
56 changes: 56 additions & 0 deletions boards/raspberrypi/common/rpi_pico-pinctrl-common.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2021, Yonatan Schachter
* SPDX-License-Identifier: Apache-2.0
*/

/* The Pico and Pico 2 are pin compatible. */
&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_P0>;
};
group2 {
pinmux = <UART0_RX_P1>;
input-enable;
};
};

i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_P4>, <I2C0_SCL_P5>;
input-enable;
input-schmitt-enable;
};
};

i2c1_default: i2c1_default {
group1 {
pinmux = <I2C1_SDA_P6>, <I2C1_SCL_P7>;
input-enable;
input-schmitt-enable;
};
};

spi0_default: spi0_default {
group1 {
pinmux = <SPI0_CSN_P17>, <SPI0_SCK_P18>, <SPI0_TX_P19>;
};
group2 {
pinmux = <SPI0_RX_P16>;
input-enable;
};
};

pwm_ch4b_default: pwm_ch4b_default {
group1 {
pinmux = <PWM_4B_P25>;
};
};

adc_default: adc_default {
group1 {
pinmux = <ADC_CH0_P26>, <ADC_CH1_P27>, <ADC_CH2_P28>, <ADC_CH3_P29>;
input-enable;
};
};
};
2 changes: 1 addition & 1 deletion boards/raspberrypi/rpi_pico/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# The value must be the 'stem' part of the name of one of the files
# in the openocd interface configuration file.
# The setting is store to CMakeCache.txt.
if ("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "")
if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "")
set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap")
endif()

Expand Down
2 changes: 2 additions & 0 deletions boards/raspberrypi/rpi_pico/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ hardware features:
- :kconfig:option:`CONFIG_SPI`
- :dtcompatible:`raspberrypi,pico-spi-pio`

.. _rpi_pico_pin_mapping:

Pin Mapping
===========

Expand Down
7 changes: 1 addition & 6 deletions boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <freq.h>

#include <rpi_pico/rp2040.dtsi>
#include <raspberrypi/rpi_pico/rp2040.dtsi>
#include "rpi_pico-pinctrl.dtsi"
#include <zephyr/dt-bindings/pwm/pwm.h>

Expand Down Expand Up @@ -89,11 +89,6 @@
};
};

&clocks {
pinctrl-0 = <&clocks_default>;
pinctrl-names = "default";
};

&uart0 {
current-speed = <115200>;
status = "okay";
Expand Down
54 changes: 1 addition & 53 deletions boards/raspberrypi/rpi_pico/rpi_pico-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,4 @@

#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2040-pinctrl.h>

&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_P0>;
};
group2 {
pinmux = <UART0_RX_P1>;
input-enable;
};
};

i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_P4>, <I2C0_SCL_P5>;
input-enable;
input-schmitt-enable;
};
};

i2c1_default: i2c1_default {
group1 {
pinmux = <I2C1_SDA_P6>, <I2C1_SCL_P7>;
input-enable;
input-schmitt-enable;
};
};

spi0_default: spi0_default {
group1 {
pinmux = <SPI0_CSN_P17>, <SPI0_SCK_P18>, <SPI0_TX_P19>;
};
group2 {
pinmux = <SPI0_RX_P16>;
input-enable;
};
};

pwm_ch4b_default: pwm_ch4b_default {
group1 {
pinmux = <PWM_4B_P25>;
};
};

adc_default: adc_default {
group1 {
pinmux = <ADC_CH0_P26>, <ADC_CH1_P27>, <ADC_CH2_P28>, <ADC_CH3_P29>;
input-enable;
};
};

clocks_default: clocks_default {
};
};
#include "../common/rpi_pico-pinctrl-common.dtsi"
25 changes: 1 addition & 24 deletions boards/raspberrypi/rpi_pico/rpi_pico.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,4 @@
/dts-v1/;

#include "rpi_pico-common.dtsi"

/ {
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
label = "LED";
};
};

pwm_leds {
compatible = "pwm-leds";
status = "disabled";
pwm_led0: pwm_led_0 {
pwms = <&pwm 9 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
label = "PWM_LED";
};
};

aliases {
led0 = &led0;
pwm-led0 = &pwm_led0;
};
};
#include "../common/rpi_pico-led.dtsi"
9 changes: 9 additions & 0 deletions boards/raspberrypi/rpi_pico2/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024 Andrew Featherstone
# SPDX-License-Identifier: Apache-2.0

if BOARD_RPI_PICO2

config USB_SELF_POWERED
default n

endif # BOARD_RPI_PICO2
5 changes: 5 additions & 0 deletions boards/raspberrypi/rpi_pico2/Kconfig.rpi_pico2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Andrew Featherstone
# SPDX-License-Identifier: Apache-2.0

config BOARD_RPI_PICO2
select SOC_RP2350A_M33 if BOARD_RPI_PICO2_RP2350A_M33
18 changes: 18 additions & 0 deletions boards/raspberrypi/rpi_pico2/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-License-Identifier: Apache-2.0

if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "")
set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap")
endif()

board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]")
board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]")

# The adapter speed is expected to be set by interface configuration.
# The Raspberry Pi's OpenOCD fork doesn't, so match their documentation at
# https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#debugging-with-swd
board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 5000")

board_runner_args(uf2 "--board-id=RP2350")

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
6 changes: 6 additions & 0 deletions boards/raspberrypi/rpi_pico2/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: rpi_pico2
ajf58 marked this conversation as resolved.
Show resolved Hide resolved
full_name: Raspberry Pi Pico 2
vendor: raspberrypi
socs:
- name: rp2350a
Binary file not shown.
Loading
Loading