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-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 45ff45595d29c..c79794217b54c 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 @@ -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 0209c1b86cd29..94fca20837c2d 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 @@ -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/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/raspberrypi/rpi_pico/rpi_pico-common.dtsi b/boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi index 2b40cf3540bc0..811dafcdf7732 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 @@ -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 0a52f47d672d4..728af5e28b4f6 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 @@ -86,11 +86,6 @@ }; }; -&clocks { - pinctrl-0 = <&clocks_default>; - pinctrl-names = "default"; -}; - &timer { status = "okay"; }; 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/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 43761b85a1426..999da05609536 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 @@ -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/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() 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 c14cb0b7d649d..3f853ce06051b 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 @@ -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 3f5118ee11c24..40d678017e4bb 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); @@ -714,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; } 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); 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..ae449e3b7cc54 100644 --- a/dts/arm/rpi_pico/rp2040.dtsi +++ b/dts/arm/raspberrypi/rpi_pico/rp2040.dtsi @@ -10,14 +10,15 @@ #include #include #include -#include +#include #include -#include +#include /* * 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/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. 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 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"; +};