1/*
2 * Copyright (c) 2018 Endre Karlson
3 * Copyright (c) 2018 Peter Bigot Consulting, LLC
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/* Assignments common to all Feather-based Particle mesh boards.
9 *
10 * NOTE: This file is replicated in particle_{argon,boron,xenon}.
11 * Changes should be made in all instances. */
12
13/ {
14	aliases {
15		led0 = &user_led;
16		led1 = &status_red;
17		led2 = &status_green;
18		led3 = &status_blue;
19		sw0 = &mode_button;
20		sw1 = &reset_button;
21	};
22
23	chosen {
24		zephyr,console = &uart0;
25		zephyr,uart-mcumgr = &uart0;
26		zephyr,shell-uart = &uart0;
27		zephyr,sram = &sram0;
28		zephyr,flash = &flash0;
29		zephyr,code-partition = &slot0_partition;
30	};
31
32	leds {
33		compatible = "gpio-leds";
34		user_led: led_0 {
35			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
36			label = "User LED";
37		};
38		status_red: led_1 {
39			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
40			label = "Red LED";
41		};
42		status_green: led_2 {
43			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
44			label = "Green LED";
45		};
46		status_blue: led_3 {
47			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
48			label = "Blue LED";
49		};
50	};
51
52	gpio_keys {
53		compatible = "gpio-keys";
54		mode_button: button_0 {
55			gpios = <&gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
56			label = "Mode Button";
57		};
58
59		reset_button: button_1 {
60			gpios = <&gpio0 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
61			label = "Reset Button";
62		};
63	};
64
65	mesh_header: connector {
66		compatible = "particle-gen3-header";
67		#gpio-cells = <2>;
68		gpio-map-mask = <0xffffffff 0xffffffc0>;
69		gpio-map-pass-thru = <0 0x3f>;
70		gpio-map = <0 0 &gpio0 26 0>,   /* SDA */
71			   <1 0 &gpio0 27 0>,   /* SCL */
72			   <2 0 &gpio1 1 0>,    /* PWM3 */
73			   <3 0 &gpio1 2 0>,    /* PWM3 */
74			   <4 0 &gpio1 8 0>,    /* PWM1 */
75			   <5 0 &gpio1 10 0>,   /* PWM1 */
76			   <6 0 &gpio1 11 0>,   /* PWM1 */
77			   <7 0 &gpio1 12 0>,   /* PWM0 */
78			   <8 0 &gpio1 3 0>,    /* PWM1 */
79			   <9 0 &gpio0 6 0>,    /* TX */
80			   <10 0 &gpio0 8 0>,   /* RX */
81			   <11 0 &gpio1 14 0>,  /* MISO */
82			   <12 0 &gpio1 13 0>,  /* MOSI */
83			   <13 0 &gpio1 15 0>,  /* SCK */
84			   <14 0 &gpio0 31 0>,  /* SS */
85			   <15 0 &gpio0 30 0>,  /* ADC4 = AIN6 */
86			   <16 0 &gpio0 29 0>,  /* ADC3 = AIN5 */
87			   <17 0 &gpio0 28 0>,  /* ADC2 = AIN4 */
88			   <18 0 &gpio0 4 0>,   /* ADC1 = AIN2 */
89			   <19 0 &gpio0 3 0>,   /* ADC0 = AIN1 */
90			   <20 0 &gpio0 11 0>,  /* MODEn */
91			   <21 0 &gpio0 18 0>;  /* RESETn */
92	};
93
94	feather_header: feather_connector {
95		compatible = "adafruit-feather-header";
96		#gpio-cells = <2>;
97		gpio-map-mask = <0xffffffff 0xffffffc0>;
98		gpio-map-pass-thru = <0 0x3f>;
99		gpio-map = <12 0 &gpio0 26 0>,  /* SDA */
100			   <13 0 &gpio0 27 0>,  /* SCL */
101			   <14 0 &gpio1 1 0>,   /* PWM3 */
102			   <15 0 &gpio1 2 0>,   /* PWM3 */
103			   <16 0 &gpio1 8 0>,   /* PWM1 */
104			   <17 0 &gpio1 10 0>,  /* PWM1 */
105			   <18 0 &gpio1 11 0>,  /* PWM1 */
106			   <19 0 &gpio1 12 0>,  /* PWM0 */
107			   <20 0 &gpio1 3 0>,   /* PWM1 */
108			   /* 11 not connected */
109			   <10 0 &gpio0 6 0>,   /* TX */
110			   <9 0 &gpio0 8 0>,    /* RX */
111			   <8 0 &gpio1 14 0>,   /* MISO */
112			   <7 0 &gpio1 13 0>,   /* MOSI */
113			   <6 0 &gpio1 15 0>,   /* SCK */
114			   <5 0 &gpio0 31 0>,   /* SS */
115			   <4 0 &gpio0 30 0>,   /* ADC4 = AIN6 */
116			   <3 0 &gpio0 29 0>,   /* ADC3 = AIN5 */
117			   <2 0 &gpio0 28 0>,   /* ADC2 = AIN4 */
118			   <1 0 &gpio0 4 0>,    /* ADC1 = AIN2 */
119			   <0 0 &gpio0 3 0>;    /* ADC0 = AIN1 */
120	};
121};
122
123feather_adc: &adc { /* feather ADC */
124	status = "okay";
125};
126
127&flash0 {
128	partitions {
129		compatible = "fixed-partitions";
130		#address-cells = <1>;
131		#size-cells = <1>;
132
133		boot_partition: partition@0 {
134			label = "mcuboot";
135			reg = <0x000000000 0x0000C000>;
136		};
137		slot0_partition: partition@c000 {
138			label = "image-0";
139			reg = <0x0000C000 0x00067000>;
140		};
141		slot1_partition: partition@73000 {
142			label = "image-1";
143			reg = <0x00073000 0x00067000>;
144		};
145		scratch_partition: partition@da000 {
146			label = "image-scratch";
147			reg = <0x000da000 0x0001e000>;
148		};
149
150		/*
151		 * The flash starting at 0x000f8000 and ending at
152		 * 0x000fffff is reserved for use by the application.
153		 */
154
155		/*
156		 * Storage partition will be used by FCB/LittleFS/NVS
157		 * if enabled.
158		 */
159		storage_partition: partition@f8000 {
160			label = "storage";
161			reg = <0x000f8000 0x00008000>;
162		};
163	};
164};
165
166&gpio0 {
167	status = "okay";
168};
169
170&gpio1 {
171	status = "okay";
172};
173
174&gpiote {
175	status = "okay";
176};
177
178arduino_i2c: &i2c0 { /* feather I2C */
179	compatible = "nordic,nrf-twi";
180	status = "okay";
181	clock-frequency = <I2C_BITRATE_FAST>;
182	sda-pin = <26>;
183	scl-pin = <27>;
184};
185
186feather_i2c: &i2c0 { };
187
188/* TWI1 used on Boron; also see mesh_feather_spi_spi1.dtsi */
189
190&spi2 { /* dedicated MX25L */
191	compatible = "nordic,nrf-spi";
192	status = "okay";
193	sck-pin = <19>;
194	mosi-pin = <20>;
195	miso-pin = <21>;
196	cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
197	mx25l32: mx25l3233f@0 {
198		compatible = "jedec,spi-nor";
199		label = "MX25L3233F";
200		reg = <0>;
201		spi-max-frequency = <80000000>;
202		wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
203		hold-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
204		size = <0x2000000>;
205		has-dpd;
206		t-enter-dpd = <10000>;
207		t-exit-dpd = <100000>;
208		jedec-id = [c2 20 16];
209		sfdp-bfp = [
210			e5 20 f1 ff  ff ff ff 01  44 eb 08 6b  08 3b 04 bb
211			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
212			10 d8 00 ff
213		];
214	};
215};
216
217/* see mesh_feather_spi1_spi3.dtsi */
218
219feather_serial: &uart0 { /* feather UART1 */
220	compatible = "nordic,nrf-uarte";
221	current-speed = <115200>;
222	status = "okay";
223	tx-pin = <6>;
224	rx-pin = <8>;
225	/* optional mesh_feather_uart1_rtscts.dtsi */
226};
227
228zephyr_udc0: &usbd {
229	compatible = "nordic,nrf-usbd";
230	status = "okay";
231};
232