1/*
2 * Copyright (c) 2021 Yonatan Schachter
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8
9#include <raspberrypi/rpi_pico/rp2040.dtsi>
10#include "sparkfun_pro_micro_rp2040-pinctrl.dtsi"
11#include "sparkfun_pro_micro_connector.dtsi"
12#include <freq.h>
13#include <zephyr/dt-bindings/led/led.h>
14
15/ {
16	chosen {
17		zephyr,sram = &sram0;
18		zephyr,flash = &flash0;
19		zephyr,flash-controller = &ssi;
20		zephyr,console = &uart0;
21		zephyr,code-partition = &code_partition;
22	};
23
24	aliases {
25		watchdog0 = &wdt0;
26		led-strip = &ws2812;
27	};
28};
29
30&flash0 {
31	/* 16MB of flash minus the 0x100 used for
32	 * the second stage bootloader
33	 */
34	reg = <0x10000000 DT_SIZE_M(16)>;
35
36	partitions {
37		compatible = "fixed-partitions";
38		#address-cells = <1>;
39		#size-cells = <1>;
40
41		/* Reserved memory for the second stage bootloader */
42		second_stage_bootloader: partition@0 {
43			label = "second_stage_bootloader";
44			reg = <0x00000000 0x100>;
45			read-only;
46		};
47
48
49		/*
50		 * Usable flash. Starts at 0x100, after the bootloader. The partition
51		 * size is 16MB minus the 0x100 bytes taken by the bootloader.
52		 */
53		code_partition: partition@100 {
54			label = "code-partition";
55			reg = <0x100 (DT_SIZE_M(16) - 0x100)>;
56			read-only;
57		};
58	};
59};
60
61&uart0 {
62	current-speed = <115200>;
63	status = "okay";
64	pinctrl-0 = <&uart0_default>;
65	pinctrl-names = "default";
66};
67
68&i2c1 {
69	status = "okay";
70	pinctrl-0 = <&i2c1_default>;
71	pinctrl-names = "default";
72	clock-frequency = <I2C_BITRATE_FAST>;
73};
74
75&spi0 {
76	status = "okay";
77	pinctrl-0 = <&spi0_default>;
78	pinctrl-names = "default";
79	clock-frequency = <DT_FREQ_M(2)>;
80};
81
82&gpio0 {
83	status = "okay";
84};
85
86&wdt0 {
87	status = "okay";
88};
89
90&adc {
91	status = "okay";
92	pinctrl-0 = <&adc_default>;
93	pinctrl-names = "default";
94};
95
96&pio0 {
97	status = "okay";
98
99	pio-ws2812 {
100		compatible = "worldsemi,ws2812-rpi_pico-pio";
101		status = "okay";
102		pinctrl-0 = <&ws2812_pio0_default>;
103		pinctrl-names = "default";
104		bit-waveform = <3>, <3>, <4>;
105
106		ws2812: ws2812 {
107			status = "okay";
108			gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
109			chain-length = <1>;
110			color-mapping = <LED_COLOR_ID_GREEN
111					 LED_COLOR_ID_RED
112					 LED_COLOR_ID_BLUE>;
113			reset-delay = <280>;
114			frequency = <800000>;
115		};
116	};
117};
118
119zephyr_udc0: &usbd {
120	status = "okay";
121};
122
123&vreg {
124	regulator-always-on;
125	regulator-allowed-modes = <REGULATOR_RPI_PICO_MODE_NORMAL>;
126};
127