Skip to content

Commit

Permalink
dts: arm: rpi_pico: remove #define from dts
Browse files Browse the repository at this point in the history
Removing direct #define usage in the DTSI file and converting these
definitions to use a dt-bindings header instead.

Relocates the RPI_PICO_DEFAULT_IRQ_PRIORITY definition to a DTSI file and
introduces an override.dtsi file. The override file is used when no other
override file is present, allowing for better flexibility and compliance
with Zephyr’s DTS structure.

Fixes: #79719

Signed-off-by: Tarang Raval <[email protected]>
  • Loading branch information
Siliconsignals authored and nashif committed Nov 20, 2024
1 parent 9863dc9 commit 31eee15
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
7 changes: 7 additions & 0 deletions dts/arm/rpi_pico/override.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* File intentionally left blank. Will be used when there is no other
* higher-priority override.dtsi file in use.
*/
10 changes: 9 additions & 1 deletion dts/arm/rpi_pico/rp2040.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@
#include <zephyr/dt-bindings/clock/rpi_pico_clock.h>
#include <zephyr/dt-bindings/i2c/i2c.h>
#include <zephyr/dt-bindings/regulator/rpi_pico.h>
#include <zephyr/dt-bindings/reset/rpi_pico_reset.h>
#include <mem.h>

#include "rpi_pico_common.dtsi"
#include <arm/rpi_pico/override.dtsi>
/*
* 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

/ {
aliases {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef RPI_PICO_DEFAULT_IRQ_PRIORITY
#define RPI_PICO_DEFAULT_IRQ_PRIORITY 3
#endif

#define RPI_PICO_RESETS_RESET_ADC 0
#define RPI_PICO_RESETS_RESET_BUSCTRL 1
#define RPI_PICO_RESETS_RESET_DMA 2
Expand Down

0 comments on commit 31eee15

Please sign in to comment.