|
| 1 | +/* |
| 2 | + * Copyright (c) 2024 Andrew Featherstone |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +/dts-v1/; |
| 8 | + |
| 9 | +#include <freq.h> |
| 10 | + |
| 11 | +#include <zephyr/dt-bindings/i2c/i2c.h> |
| 12 | +#include <zephyr/dt-bindings/pwm/pwm.h> |
| 13 | + |
| 14 | +#include <raspberrypi/rpi_pico/rp2350a.dtsi> |
| 15 | + |
| 16 | +#include "rpi_pico2-pinctrl.dtsi" |
| 17 | +#include "../common/rpi_pico-led.dtsi" |
| 18 | + |
| 19 | +/ { |
| 20 | + chosen { |
| 21 | + zephyr,sram = &sram0; |
| 22 | + zephyr,flash = &flash0; |
| 23 | + zephyr,console = &uart0; |
| 24 | + zephyr,shell-uart = &uart0; |
| 25 | + zephyr,code-partition = &code_partition; |
| 26 | + }; |
| 27 | + |
| 28 | + aliases { |
| 29 | + watchdog0 = &wdt0; |
| 30 | + }; |
| 31 | + |
| 32 | + pico_header: connector { |
| 33 | + compatible = "raspberrypi,pico-header"; |
| 34 | + #gpio-cells = <2>; |
| 35 | + gpio-map-mask = <0xffffffff 0xffffffc0>; |
| 36 | + gpio-map-pass-thru = <0 0x3f>; |
| 37 | + gpio-map = <0 0 &gpio0 0 0>, /* GP0 */ |
| 38 | + <1 0 &gpio0 1 0>, /* GP1 */ |
| 39 | + <2 0 &gpio0 2 0>, /* GP2 */ |
| 40 | + <3 0 &gpio0 3 0>, /* GP3 */ |
| 41 | + <4 0 &gpio0 4 0>, /* GP4 */ |
| 42 | + <5 0 &gpio0 5 0>, /* GP5 */ |
| 43 | + <6 0 &gpio0 6 0>, /* GP6 */ |
| 44 | + <7 0 &gpio0 7 0>, /* GP7 */ |
| 45 | + <8 0 &gpio0 8 0>, /* GP8 */ |
| 46 | + <9 0 &gpio0 9 0>, /* GP9 */ |
| 47 | + <10 0 &gpio0 10 0>, /* GP10 */ |
| 48 | + <11 0 &gpio0 11 0>, /* GP11 */ |
| 49 | + <12 0 &gpio0 12 0>, /* GP12 */ |
| 50 | + <13 0 &gpio0 13 0>, /* GP13 */ |
| 51 | + <14 0 &gpio0 14 0>, /* GP14 */ |
| 52 | + <15 0 &gpio0 15 0>, /* GP15 */ |
| 53 | + <16 0 &gpio0 16 0>, /* GP16 */ |
| 54 | + <17 0 &gpio0 17 0>, /* GP17 */ |
| 55 | + <18 0 &gpio0 18 0>, /* GP18 */ |
| 56 | + <19 0 &gpio0 19 0>, /* GP19 */ |
| 57 | + <20 0 &gpio0 20 0>, /* GP20 */ |
| 58 | + <21 0 &gpio0 21 0>, /* GP21 */ |
| 59 | + <22 0 &gpio0 22 0>, /* GP22 */ |
| 60 | + <26 0 &gpio0 26 0>, /* GP26 */ |
| 61 | + <27 0 &gpio0 27 0>, /* GP27 */ |
| 62 | + <28 0 &gpio0 28 0>; /* GP28 */ |
| 63 | + }; |
| 64 | +}; |
| 65 | + |
| 66 | +&flash0 { |
| 67 | + reg = <0x10000000 DT_SIZE_M(4)>; |
| 68 | + |
| 69 | + partitions { |
| 70 | + compatible = "fixed-partitions"; |
| 71 | + #address-cells = <1>; |
| 72 | + #size-cells = <1>; |
| 73 | + |
| 74 | + /* Reserved memory for an image definition block. The block is much |
| 75 | + * smaller than 256 bytes, but in practice the linker places the vector |
| 76 | + * table at a much larger alignment offset. |
| 77 | + */ |
| 78 | + image_def: partition@0 { |
| 79 | + label = "image_def"; |
| 80 | + reg = <0x00000000 0x100>; |
| 81 | + read-only; |
| 82 | + }; |
| 83 | + |
| 84 | + /* |
| 85 | + * Usable flash. Starts at 0x100, after the image definition block. |
| 86 | + * The partition size is 4MB minus the 0x100 bytes taken by the |
| 87 | + * image definition. |
| 88 | + */ |
| 89 | + code_partition: partition@100 { |
| 90 | + label = "code-partition"; |
| 91 | + reg = <0x100 (DT_SIZE_M(4) - 0x100)>; |
| 92 | + read-only; |
| 93 | + }; |
| 94 | + }; |
| 95 | +}; |
| 96 | + |
| 97 | +&uart0 { |
| 98 | + current-speed = <115200>; |
| 99 | + status = "okay"; |
| 100 | + pinctrl-0 = <&uart0_default>; |
| 101 | + pinctrl-names = "default"; |
| 102 | +}; |
| 103 | + |
| 104 | +&gpio0 { |
| 105 | + status = "okay"; |
| 106 | +}; |
| 107 | + |
| 108 | +&spi0 { |
| 109 | + clock-frequency = <DT_FREQ_M(8)>; |
| 110 | + pinctrl-0 = <&spi0_default>; |
| 111 | + pinctrl-names = "default"; |
| 112 | +}; |
| 113 | + |
| 114 | +&i2c0 { |
| 115 | + clock-frequency = <I2C_BITRATE_STANDARD>; |
| 116 | + pinctrl-0 = <&i2c0_default>; |
| 117 | + pinctrl-names = "default"; |
| 118 | + status = "okay"; |
| 119 | +}; |
| 120 | + |
| 121 | +&i2c1 { |
| 122 | + clock-frequency = <I2C_BITRATE_STANDARD>; |
| 123 | + pinctrl-0 = <&i2c1_default>; |
| 124 | + pinctrl-names = "default"; |
| 125 | + status = "okay"; |
| 126 | +}; |
| 127 | + |
| 128 | +&adc { |
| 129 | + pinctrl-0 = <&adc_default>; |
| 130 | + pinctrl-names = "default"; |
| 131 | + status = "okay"; |
| 132 | +}; |
| 133 | + |
| 134 | +&pwm { |
| 135 | + pinctrl-0 = <&pwm_ch4b_default>; |
| 136 | + pinctrl-names = "default"; |
| 137 | + divider-int-0 = <255>; |
| 138 | +}; |
| 139 | + |
| 140 | +&timer0 { |
| 141 | + status = "okay"; |
| 142 | +}; |
| 143 | + |
| 144 | +zephyr_udc0: &usbd { |
| 145 | + status = "okay"; |
| 146 | +}; |
| 147 | + |
| 148 | +pico_serial: &uart0 {}; |
0 commit comments