1/* 2 * Copyright (c) 2021 Yonatan Schachter 3 * Copyright (c) 2023 Ian Wakely 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8/dts-v1/; 9 10#include <freq.h> 11 12#include <raspberrypi/rpi_pico/rp2040.dtsi> 13#include "w5500_evb_pico-pinctrl.dtsi" 14#include <zephyr/dt-bindings/pwm/pwm.h> 15 16#include <zephyr/dt-bindings/i2c/i2c.h> 17 18/ { 19 chosen { 20 zephyr,sram = &sram0; 21 zephyr,flash = &flash0; 22 zephyr,flash-controller = &ssi; 23 zephyr,console = &uart0; 24 zephyr,shell-uart = &uart0; 25 zephyr,code-partition = &code_partition; 26 }; 27 28 pico_header: connector { 29 compatible = "raspberrypi,pico-header"; 30 #gpio-cells = <2>; 31 gpio-map-mask = <0xffffffff 0xffffffc0>; 32 gpio-map-pass-thru = <0 0x3f>; 33 gpio-map = <0 0 &gpio0 0 0>, /* GP0 */ 34 <1 0 &gpio0 1 0>, /* GP1 */ 35 <2 0 &gpio0 2 0>, /* GP2 */ 36 <3 0 &gpio0 3 0>, /* GP3 */ 37 <4 0 &gpio0 4 0>, /* GP4 */ 38 <5 0 &gpio0 5 0>, /* GP5 */ 39 <6 0 &gpio0 6 0>, /* GP6 */ 40 <7 0 &gpio0 7 0>, /* GP7 */ 41 <8 0 &gpio0 8 0>, /* GP8 */ 42 <9 0 &gpio0 9 0>, /* GP9 */ 43 <10 0 &gpio0 10 0>, /* GP10 */ 44 <11 0 &gpio0 11 0>, /* GP11 */ 45 <12 0 &gpio0 12 0>, /* GP12 */ 46 <13 0 &gpio0 13 0>, /* GP13 */ 47 <14 0 &gpio0 14 0>, /* GP14 */ 48 <15 0 &gpio0 15 0>, /* GP15 */ 49 <16 0 &gpio0 16 0>, /* GP16 */ 50 <17 0 &gpio0 17 0>, /* GP17 */ 51 <18 0 &gpio0 18 0>, /* GP18 */ 52 <19 0 &gpio0 19 0>, /* GP19 */ 53 <20 0 &gpio0 20 0>, /* GP20 */ 54 <21 0 &gpio0 21 0>, /* GP21 */ 55 <22 0 &gpio0 22 0>, /* GP22 */ 56 <26 0 &gpio0 26 0>, /* GP26 */ 57 <27 0 &gpio0 27 0>, /* GP27 */ 58 <28 0 &gpio0 28 0>; /* GP28 */ 59 }; 60 61 leds { 62 compatible = "gpio-leds"; 63 led0: led_0 { 64 gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; 65 label = "LED"; 66 }; 67 }; 68 69 pwm_leds { 70 compatible = "pwm-leds"; 71 status = "disabled"; 72 pwm_led0: pwm_led_0 { 73 pwms = <&pwm 9 PWM_MSEC(20) PWM_POLARITY_NORMAL>; 74 label = "PWM_LED"; 75 }; 76 }; 77 78 aliases { 79 led0 = &led0; 80 pwm-led0 = &pwm_led0; 81 watchdog0 = &wdt0; 82 }; 83}; 84 85&flash0 { 86 /* 16MB of flash minus the 0x100 used for 87 * the second stage bootloader 88 */ 89 reg = <0x10000000 DT_SIZE_M(16)>; 90 91 partitions { 92 compatible = "fixed-partitions"; 93 #address-cells = <1>; 94 #size-cells = <1>; 95 96 /* Reserved memory for the second stage bootloader */ 97 second_stage_bootloader: partition@0 { 98 label = "second_stage_bootloader"; 99 reg = <0x00000000 0x100>; 100 read-only; 101 }; 102 103 /* 104 * Usable flash. Starts at 0x100, after the bootloader. The partition 105 * size is 16MB minus the 0x100 bytes taken by the bootloader. 106 */ 107 code_partition: partition@100 { 108 label = "code-partition"; 109 reg = <0x100 (DT_SIZE_M(16) - 0x100)>; 110 read-only; 111 }; 112 }; 113}; 114 115&uart0 { 116 current-speed = <115200>; 117 status = "okay"; 118 pinctrl-0 = <&uart0_default>; 119 pinctrl-names = "default"; 120}; 121 122&gpio0 { 123 status = "okay"; 124}; 125 126&i2c0 { 127 clock-frequency = <I2C_BITRATE_STANDARD>; 128 status = "okay"; 129 pinctrl-0 = <&i2c0_default>; 130 pinctrl-names = "default"; 131}; 132 133&i2c1 { 134 pinctrl-0 = <&i2c1_default>; 135 pinctrl-names = "default"; 136 status = "disabled"; 137 clock-frequency = <I2C_BITRATE_FAST>; 138}; 139 140&spi0 { 141 clock-frequency = <DT_FREQ_M(8)>; 142 status = "okay"; 143 pinctrl-0 = <&spi0_default>; 144 pinctrl-names = "default"; 145 cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; 146 147 ethernet: w5500@0 { 148 compatible = "wiznet,w5500"; 149 reg = <0x0>; 150 spi-max-frequency = <50000000>; 151 int-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; 152 reset-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; 153 local-mac-address = [00 00 00 01 02 03]; 154 status = "okay"; 155 }; 156}; 157 158&timer { 159 status = "okay"; 160}; 161 162&wdt0 { 163 status = "okay"; 164}; 165 166&adc { 167 status = "okay"; 168 pinctrl-0 = <&adc_default>; 169 pinctrl-names = "default"; 170}; 171 172zephyr_udc0: &usbd { 173 status = "okay"; 174}; 175 176&pwm { 177 pinctrl-0 = <&pwm_ch4b_default>; 178 pinctrl-names = "default"; 179 divider-int-0 = <255>; 180}; 181 182&vreg { 183 regulator-always-on; 184 regulator-allowed-modes = <REGULATOR_RPI_PICO_MODE_NORMAL>; 185}; 186 187pico_spi: &spi0 {}; 188pico_i2c0: &i2c0 {}; 189pico_i2c1: &i2c1 {}; 190