From e161e175b01aaefa0e0dbb851718d7404ed3d3ad Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Tue, 27 Aug 2024 17:55:49 +0100 Subject: [PATCH 1/8] dts: arm: Move rpi_pico under raspberrypi Follow the wider directory convention of dts///. This is foundation work ahead of introducing support for the RP2350. Signed-off-by: Andrew Featherstone --- MAINTAINERS.yml | 2 +- boards/adafruit/kb2040/adafruit_kb2040.dts | 2 +- boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts | 2 +- boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi | 2 +- boards/seeed/xiao_rp2040/xiao_rp2040.dts | 2 +- boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts | 2 +- boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts | 2 +- dts/arm/{ => raspberrypi}/rpi_pico/override.dtsi | 0 dts/arm/{ => raspberrypi}/rpi_pico/rp2040.dtsi | 2 +- 9 files changed, 8 insertions(+), 8 deletions(-) rename dts/arm/{ => raspberrypi}/rpi_pico/override.dtsi (100%) rename dts/arm/{ => raspberrypi}/rpi_pico/rp2040.dtsi (99%) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 949652a8a4037..0f26dc834d850 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -3515,7 +3515,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*/ diff --git a/boards/adafruit/kb2040/adafruit_kb2040.dts b/boards/adafruit/kb2040/adafruit_kb2040.dts index 45ff45595d29c..b42b196b17386 100644 --- a/boards/adafruit/kb2040/adafruit_kb2040.dts +++ b/boards/adafruit/kb2040/adafruit_kb2040.dts @@ -7,7 +7,7 @@ /dts-v1/; -#include +#include #include "adafruit_kb2040-pinctrl.dtsi" #include "sparkfun_pro_micro_connector.dtsi" #include diff --git a/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts index 0209c1b86cd29..088325845c4ff 100644 --- a/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts +++ b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts @@ -7,7 +7,7 @@ /dts-v1/; -#include +#include #include "adafruit_qt_py_rp2040-pinctrl.dtsi" #include "seeed_xiao_connector.dtsi" #include diff --git a/boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi b/boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi index 2b40cf3540bc0..8a39871e192e5 100644 --- a/boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi +++ b/boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi @@ -6,7 +6,7 @@ #include -#include +#include #include "rpi_pico-pinctrl.dtsi" #include diff --git a/boards/seeed/xiao_rp2040/xiao_rp2040.dts b/boards/seeed/xiao_rp2040/xiao_rp2040.dts index 0a52f47d672d4..61c917be38ac2 100644 --- a/boards/seeed/xiao_rp2040/xiao_rp2040.dts +++ b/boards/seeed/xiao_rp2040/xiao_rp2040.dts @@ -7,7 +7,7 @@ /dts-v1/; -#include +#include #include "xiao_rp2040-pinctrl.dtsi" #include "seeed_xiao_connector.dtsi" #include diff --git a/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts b/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts index 43761b85a1426..8c4e5acaf2cbe 100644 --- a/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts +++ b/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "sparkfun_pro_micro_rp2040-pinctrl.dtsi" #include "sparkfun_pro_micro_connector.dtsi" #include diff --git a/boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts b/boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts index c14cb0b7d649d..5f5cf14ccedfd 100644 --- a/boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts +++ b/boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts @@ -9,7 +9,7 @@ #include -#include +#include #include "w5500_evb_pico-pinctrl.dtsi" #include diff --git a/dts/arm/rpi_pico/override.dtsi b/dts/arm/raspberrypi/rpi_pico/override.dtsi similarity index 100% rename from dts/arm/rpi_pico/override.dtsi rename to dts/arm/raspberrypi/rpi_pico/override.dtsi diff --git a/dts/arm/rpi_pico/rp2040.dtsi b/dts/arm/raspberrypi/rpi_pico/rp2040.dtsi similarity index 99% rename from dts/arm/rpi_pico/rp2040.dtsi rename to dts/arm/raspberrypi/rpi_pico/rp2040.dtsi index 00d53f8b3d205..f192e596d0369 100644 --- a/dts/arm/rpi_pico/rp2040.dtsi +++ b/dts/arm/raspberrypi/rpi_pico/rp2040.dtsi @@ -13,7 +13,7 @@ #include #include -#include +#include /* * This value can be overridden at the board level or in an application specific * override.dtsi file. From 22e20f90c74ef1c403f05b9aa2c7b9ae30c0563f Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Tue, 27 Aug 2024 10:22:11 +0100 Subject: [PATCH 2/8] dts: arm: rp2040: Improve naming of included files Rename rpi_pico_common.dtsi to rp2040_reset.h . This is more consistent with the wider Zephyr source tree, and is foundation work ahead of introducing the RP2350 SoC. Add missing include guard. This shouldn't be required, but it is consistent with other header files in the same directory. Signed-off-by: Andrew Featherstone --- dts/arm/raspberrypi/rpi_pico/rp2040.dtsi | 3 +- .../zephyr/dt-bindings/reset/rp2040_reset.h | 36 +++++++++++++++++++ .../zephyr/dt-bindings/reset/rpi_pico_reset.h | 31 ---------------- 3 files changed, 38 insertions(+), 32 deletions(-) create mode 100644 include/zephyr/dt-bindings/reset/rp2040_reset.h delete mode 100644 include/zephyr/dt-bindings/reset/rpi_pico_reset.h diff --git a/dts/arm/raspberrypi/rpi_pico/rp2040.dtsi b/dts/arm/raspberrypi/rpi_pico/rp2040.dtsi index f192e596d0369..ae449e3b7cc54 100644 --- a/dts/arm/raspberrypi/rpi_pico/rp2040.dtsi +++ b/dts/arm/raspberrypi/rpi_pico/rp2040.dtsi @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -18,6 +18,7 @@ * This value can be overridden at the board level or in an application specific * override.dtsi file. */ + #ifndef RPI_PICO_DEFAULT_IRQ_PRIORITY #define RPI_PICO_DEFAULT_IRQ_PRIORITY 3 #endif diff --git a/include/zephyr/dt-bindings/reset/rp2040_reset.h b/include/zephyr/dt-bindings/reset/rp2040_reset.h new file mode 100644 index 0000000000000..eeb253c383943 --- /dev/null +++ b/include/zephyr/dt-bindings/reset/rp2040_reset.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Yonatan Schachter + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_RESET_RP2040_RESET_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_RESET_RP2040_RESET_H_ + +#define RPI_PICO_RESETS_RESET_ADC 0 +#define RPI_PICO_RESETS_RESET_BUSCTRL 1 +#define RPI_PICO_RESETS_RESET_DMA 2 +#define RPI_PICO_RESETS_RESET_I2C0 3 +#define RPI_PICO_RESETS_RESET_I2C1 4 +#define RPI_PICO_RESETS_RESET_IO_BANK0 5 +#define RPI_PICO_RESETS_RESET_IO_QSPI 6 +#define RPI_PICO_RESETS_RESET_JTAG 7 +#define RPI_PICO_RESETS_RESET_PADS_BANK0 8 +#define RPI_PICO_RESETS_RESET_PADS_QSPI 9 +#define RPI_PICO_RESETS_RESET_PIO0 10 +#define RPI_PICO_RESETS_RESET_PIO1 11 +#define RPI_PICO_RESETS_RESET_PLL_SYS 12 +#define RPI_PICO_RESETS_RESET_PLL_USB 13 +#define RPI_PICO_RESETS_RESET_PWM 14 +#define RPI_PICO_RESETS_RESET_RTC 15 +#define RPI_PICO_RESETS_RESET_SPI0 16 +#define RPI_PICO_RESETS_RESET_SPI1 17 +#define RPI_PICO_RESETS_RESET_SYSCFG 18 +#define RPI_PICO_RESETS_RESET_SYSINFO 19 +#define RPI_PICO_RESETS_RESET_TBMAN 20 +#define RPI_PICO_RESETS_RESET_TIMER 21 +#define RPI_PICO_RESETS_RESET_UART0 22 +#define RPI_PICO_RESETS_RESET_UART1 23 +#define RPI_PICO_RESETS_RESET_USBCTRL 24 + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_RESET_RP2040_RESET_H_ */ diff --git a/include/zephyr/dt-bindings/reset/rpi_pico_reset.h b/include/zephyr/dt-bindings/reset/rpi_pico_reset.h deleted file mode 100644 index 6f8c537ba4c66..0000000000000 --- a/include/zephyr/dt-bindings/reset/rpi_pico_reset.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Yonatan Schachter - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#define RPI_PICO_RESETS_RESET_ADC 0 -#define RPI_PICO_RESETS_RESET_BUSCTRL 1 -#define RPI_PICO_RESETS_RESET_DMA 2 -#define RPI_PICO_RESETS_RESET_I2C0 3 -#define RPI_PICO_RESETS_RESET_I2C1 4 -#define RPI_PICO_RESETS_RESET_IO_BANK0 5 -#define RPI_PICO_RESETS_RESET_IO_QSPI 6 -#define RPI_PICO_RESETS_RESET_JTAG 7 -#define RPI_PICO_RESETS_RESET_PADS_BANK0 8 -#define RPI_PICO_RESETS_RESET_PADS_QSPI 9 -#define RPI_PICO_RESETS_RESET_PIO0 10 -#define RPI_PICO_RESETS_RESET_PIO1 11 -#define RPI_PICO_RESETS_RESET_PLL_SYS 12 -#define RPI_PICO_RESETS_RESET_PLL_USB 13 -#define RPI_PICO_RESETS_RESET_PWM 14 -#define RPI_PICO_RESETS_RESET_RTC 15 -#define RPI_PICO_RESETS_RESET_SPI0 16 -#define RPI_PICO_RESETS_RESET_SPI1 17 -#define RPI_PICO_RESETS_RESET_SYSCFG 18 -#define RPI_PICO_RESETS_RESET_SYSINFO 19 -#define RPI_PICO_RESETS_RESET_TBMAN 20 -#define RPI_PICO_RESETS_RESET_TIMER 21 -#define RPI_PICO_RESETS_RESET_UART0 22 -#define RPI_PICO_RESETS_RESET_UART1 23 -#define RPI_PICO_RESETS_RESET_USBCTRL 24 From c4cfe63f850c718c45beabccae024a3d01a4430c Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Thu, 29 Aug 2024 21:25:19 +0100 Subject: [PATCH 3/8] drivers: clock_control: rpi_pico: Correct bitfields during init RESETS_RESET_PLL_USB_BITS was logically or'd twice and 'unreset'ting PWM doesn't seem to be required, based on the contents of the SDK. Signed-off-by: Andrew Featherstone --- drivers/clock_control/clock_control_rpi_pico.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clock_control/clock_control_rpi_pico.c b/drivers/clock_control/clock_control_rpi_pico.c index 3f5118ee11c24..60353606a1017 100644 --- a/drivers/clock_control/clock_control_rpi_pico.c +++ b/drivers/clock_control/clock_control_rpi_pico.c @@ -608,14 +608,13 @@ static int clock_control_rpi_pico_init(const struct device *dev) /* Reset all function before clock configuring */ reset_block(~(RESETS_RESET_IO_QSPI_BITS | RESETS_RESET_PADS_QSPI_BITS | RESETS_RESET_PLL_USB_BITS | RESETS_RESET_USBCTRL_BITS | - RESETS_RESET_PLL_USB_BITS | RESETS_RESET_SYSCFG_BITS | - RESETS_RESET_PLL_SYS_BITS)); + RESETS_RESET_SYSCFG_BITS | RESETS_RESET_PLL_SYS_BITS)); unreset_block_wait(RESETS_RESET_BITS & ~(RESETS_RESET_ADC_BITS | RESETS_RESET_RTC_BITS | RESETS_RESET_SPI0_BITS | RESETS_RESET_SPI1_BITS | RESETS_RESET_UART0_BITS | RESETS_RESET_UART1_BITS | - RESETS_RESET_USBCTRL_BITS | RESETS_RESET_PWM_BITS)); + RESETS_RESET_USBCTRL_BITS)); /* Start tick in watchdog */ watchdog_hw->tick = ((CLOCK_FREQ_xosc/1000000) | WATCHDOG_TICK_ENABLE_BITS); From cbf1a58d84c0f56858513e2d471de46345ce0622 Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Sun, 6 Oct 2024 15:34:02 +0100 Subject: [PATCH 4/8] dts: bindings: clock: rpi_pico: Add default value matching the Pico SDK The Pico SDK defines a default value for its XOSC multiplier. Reflect this in the device tree binding so that it doesn't need to be repeated. Signed-off-by: Andrew Featherstone --- dts/bindings/clock/raspberrypi,pico-xosc.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dts/bindings/clock/raspberrypi,pico-xosc.yaml b/dts/bindings/clock/raspberrypi,pico-xosc.yaml index de01d3c4d5e9f..924db759ae854 100644 --- a/dts/bindings/clock/raspberrypi,pico-xosc.yaml +++ b/dts/bindings/clock/raspberrypi,pico-xosc.yaml @@ -11,4 +11,6 @@ include: raspberrypi,pico-clock.yaml properties: startup-delay-multiplier: type: int - description: Startup delay multiplier + default: 1 + description: | + Startup delay multiplier. The default value matches the Pico SDK. From 99644700a34f51a59c18f53d74bc7cf97726868e Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Fri, 27 Sep 2024 12:51:59 +0100 Subject: [PATCH 5/8] drivers: clock_control: rpi_pico: Make pinctrl-0 optional No in-tree board uses this driver's pinctrl functionality, and every RP2040-based board was configuring this to be an empty node in the device tree, so remove them. Signed-off-by: Andrew Featherstone --- boards/adafruit/kb2040/adafruit_kb2040-pinctrl.dtsi | 3 --- boards/adafruit/kb2040/adafruit_kb2040.dts | 5 ----- .../adafruit/qt_py_rp2040/adafruit_qt_py_rp2040-pinctrl.dtsi | 3 --- boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts | 5 ----- boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi | 5 ----- boards/raspberrypi/rpi_pico/rpi_pico-pinctrl.dtsi | 3 --- boards/seeed/xiao_rp2040/xiao_rp2040-pinctrl.dtsi | 3 --- boards/seeed/xiao_rp2040/xiao_rp2040.dts | 5 ----- .../pro_micro_rp2040/sparkfun_pro_micro_rp2040-pinctrl.dtsi | 3 --- .../sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts | 5 ----- boards/wiznet/w5500_evb_pico/w5500_evb_pico-pinctrl.dtsi | 3 --- boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts | 5 ----- drivers/clock_control/clock_control_rpi_pico.c | 2 +- 13 files changed, 1 insertion(+), 49 deletions(-) diff --git a/boards/adafruit/kb2040/adafruit_kb2040-pinctrl.dtsi b/boards/adafruit/kb2040/adafruit_kb2040-pinctrl.dtsi index cf1289acedc34..79681bb8ad346 100644 --- a/boards/adafruit/kb2040/adafruit_kb2040-pinctrl.dtsi +++ b/boards/adafruit/kb2040/adafruit_kb2040-pinctrl.dtsi @@ -48,9 +48,6 @@ }; }; - clocks_default: clocks_default { - }; - ws2812_pio0_default: ws2812_pio0_default { ws2812 { pinmux = ; diff --git a/boards/adafruit/kb2040/adafruit_kb2040.dts b/boards/adafruit/kb2040/adafruit_kb2040.dts index b42b196b17386..c79794217b54c 100644 --- a/boards/adafruit/kb2040/adafruit_kb2040.dts +++ b/boards/adafruit/kb2040/adafruit_kb2040.dts @@ -56,11 +56,6 @@ }; }; -&clocks { - pinctrl-0 = <&clocks_default>; - pinctrl-names = "default"; -}; - &uart0 { current-speed = <115200>; status = "okay"; diff --git a/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040-pinctrl.dtsi b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040-pinctrl.dtsi index d2e84ae41f863..561db005e65c5 100644 --- a/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040-pinctrl.dtsi +++ b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040-pinctrl.dtsi @@ -59,9 +59,6 @@ }; }; - clocks_default: clocks_default { - }; - ws2812_pio1_default: ws2812_pio1_default { ws2812 { pinmux = ; diff --git a/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts index 088325845c4ff..94fca20837c2d 100644 --- a/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts +++ b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts @@ -56,11 +56,6 @@ }; }; -&clocks { - pinctrl-0 = <&clocks_default>; - pinctrl-names = "default"; -}; - &uart1 { current-speed = <115200>; status = "okay"; diff --git a/boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi b/boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi index 8a39871e192e5..811dafcdf7732 100644 --- a/boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi +++ b/boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi @@ -89,11 +89,6 @@ }; }; -&clocks { - pinctrl-0 = <&clocks_default>; - pinctrl-names = "default"; -}; - &uart0 { current-speed = <115200>; status = "okay"; diff --git a/boards/raspberrypi/rpi_pico/rpi_pico-pinctrl.dtsi b/boards/raspberrypi/rpi_pico/rpi_pico-pinctrl.dtsi index 761354420c616..747b0d04e4095 100644 --- a/boards/raspberrypi/rpi_pico/rpi_pico-pinctrl.dtsi +++ b/boards/raspberrypi/rpi_pico/rpi_pico-pinctrl.dtsi @@ -54,7 +54,4 @@ input-enable; }; }; - - clocks_default: clocks_default { - }; }; diff --git a/boards/seeed/xiao_rp2040/xiao_rp2040-pinctrl.dtsi b/boards/seeed/xiao_rp2040/xiao_rp2040-pinctrl.dtsi index 0e235884bf22c..eb72fe503c00e 100644 --- a/boards/seeed/xiao_rp2040/xiao_rp2040-pinctrl.dtsi +++ b/boards/seeed/xiao_rp2040/xiao_rp2040-pinctrl.dtsi @@ -57,9 +57,6 @@ }; }; - clocks_default: clocks_default { - }; - ws2812_pio0_default: ws2812_pio0_default { ws2812 { pinmux = ; diff --git a/boards/seeed/xiao_rp2040/xiao_rp2040.dts b/boards/seeed/xiao_rp2040/xiao_rp2040.dts index 61c917be38ac2..728af5e28b4f6 100644 --- a/boards/seeed/xiao_rp2040/xiao_rp2040.dts +++ b/boards/seeed/xiao_rp2040/xiao_rp2040.dts @@ -86,11 +86,6 @@ }; }; -&clocks { - pinctrl-0 = <&clocks_default>; - pinctrl-names = "default"; -}; - &timer { status = "okay"; }; diff --git a/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040-pinctrl.dtsi b/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040-pinctrl.dtsi index 5b9c353f802fc..b2386014d6f71 100644 --- a/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040-pinctrl.dtsi +++ b/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040-pinctrl.dtsi @@ -47,9 +47,6 @@ }; }; - clocks_default: clocks_default { - }; - ws2812_pio0_default: ws2812_pio_default { ws2812 { pinmux = ; diff --git a/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts b/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts index 8c4e5acaf2cbe..999da05609536 100644 --- a/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts +++ b/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts @@ -58,11 +58,6 @@ }; }; -&clocks { - pinctrl-0 = <&clocks_default>; - pinctrl-names = "default"; -}; - &uart0 { current-speed = <115200>; status = "okay"; diff --git a/boards/wiznet/w5500_evb_pico/w5500_evb_pico-pinctrl.dtsi b/boards/wiznet/w5500_evb_pico/w5500_evb_pico-pinctrl.dtsi index 761354420c616..747b0d04e4095 100644 --- a/boards/wiznet/w5500_evb_pico/w5500_evb_pico-pinctrl.dtsi +++ b/boards/wiznet/w5500_evb_pico/w5500_evb_pico-pinctrl.dtsi @@ -54,7 +54,4 @@ input-enable; }; }; - - clocks_default: clocks_default { - }; }; diff --git a/boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts b/boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts index 5f5cf14ccedfd..3f853ce06051b 100644 --- a/boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts +++ b/boards/wiznet/w5500_evb_pico/w5500_evb_pico.dts @@ -112,11 +112,6 @@ }; }; -&clocks { - pinctrl-0 = <&clocks_default>; - pinctrl-names = "default"; -}; - &uart0 { current-speed = <115200>; status = "okay"; diff --git a/drivers/clock_control/clock_control_rpi_pico.c b/drivers/clock_control/clock_control_rpi_pico.c index 60353606a1017..40d678017e4bb 100644 --- a/drivers/clock_control/clock_control_rpi_pico.c +++ b/drivers/clock_control/clock_control_rpi_pico.c @@ -713,7 +713,7 @@ static int clock_control_rpi_pico_init(const struct device *dev) } ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); - if (ret < 0) { + if (ret < 0 && ret != -ENOENT) { return ret; } From c3590650919e64114fd66b87bb46af31843d7257 Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Wed, 9 Oct 2024 17:49:11 +0100 Subject: [PATCH 6/8] boards: rp2040: Lint whitespace in board.cmake files Change whitespace to match the coding style for CMake files for all rp2040-based boards. This is foundation work ahead of adding support for boards based on the RP235XX SoCs. Signed-off-by: Andrew Featherstone --- boards/raspberrypi/rpi_pico/board.cmake | 2 +- boards/sparkfun/pro_micro_rp2040/board.cmake | 2 +- boards/wiznet/w5500_evb_pico/board.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/boards/raspberrypi/rpi_pico/board.cmake b/boards/raspberrypi/rpi_pico/board.cmake index e9cd4edc18f59..8d09fe3ab05ef 100644 --- a/boards/raspberrypi/rpi_pico/board.cmake +++ b/boards/raspberrypi/rpi_pico/board.cmake @@ -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() diff --git a/boards/sparkfun/pro_micro_rp2040/board.cmake b/boards/sparkfun/pro_micro_rp2040/board.cmake index 7d557630b9be3..9add174b5659a 100644 --- a/boards/sparkfun/pro_micro_rp2040/board.cmake +++ b/boards/sparkfun/pro_micro_rp2040/board.cmake @@ -16,7 +16,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() diff --git a/boards/wiznet/w5500_evb_pico/board.cmake b/boards/wiznet/w5500_evb_pico/board.cmake index e95d4d3767f65..a52ac5d15e0cb 100644 --- a/boards/wiznet/w5500_evb_pico/board.cmake +++ b/boards/wiznet/w5500_evb_pico/board.cmake @@ -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() From 7f7c0c64cadf87e9548a934959f616c7ce157a36 Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Fri, 18 Oct 2024 09:05:13 +0100 Subject: [PATCH 7/8] drivers: dma: rpi_pico: Correct handling of NULL filter_param 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 --- drivers/dma/dma_rpi_pico.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma/dma_rpi_pico.c b/drivers/dma/dma_rpi_pico.c index 57c23ced657f1..581116d1ebae8 100644 --- a/drivers/dma/dma_rpi_pico.c +++ b/drivers/dma/dma_rpi_pico.c @@ -288,8 +288,7 @@ static bool dma_rpi_pico_api_chan_filter(const struct device *dev, int ch, void uint32_t filter; if (!filter_param) { - LOG_ERR("filter_param must not be NULL"); - return false; + return true; } filter = *((uint32_t *)filter_param); From 6fce055e11ae9d45a6bdee78a76ed0e51cf4b689 Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Sat, 19 Oct 2024 08:22:30 +0100 Subject: [PATCH 8/8] tests: drivers: dma: Increase test coverage for RP2040 Increase test coverage for Raspberry Pi's RP2040. 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 --- tests/drivers/dma/chan_blen_transfer/socs/rp2040.overlay | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/drivers/dma/chan_blen_transfer/socs/rp2040.overlay diff --git a/tests/drivers/dma/chan_blen_transfer/socs/rp2040.overlay b/tests/drivers/dma/chan_blen_transfer/socs/rp2040.overlay new file mode 100644 index 0000000000000..ed3236a449c20 --- /dev/null +++ b/tests/drivers/dma/chan_blen_transfer/socs/rp2040.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Andrew Featherstone + * + * SPDX-License-Identifier: Apache-2.0 + */ + +tst_dma0: &dma { + status = "okay"; +};