1/*
2 * Copyright (c) 2020 Henrik Brix Andersen <henrik@brixandersen.dk>
3 * Copyright 2023 NXP
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#include "lpcxpresso55s16-pinctrl.dtsi"
9#include <zephyr/dt-bindings/input/input-event-codes.h>
10
11/ {
12	chosen {
13		zephyr,sram = &sram0;
14		zephyr,flash = &flash0;
15		zephyr,code-partition = &slot0_partition;
16		zephyr,uart-mcumgr = &flexcomm0;
17		zephyr,console = &flexcomm0;
18		zephyr,shell-uart = &flexcomm0;
19		zephyr,entropy = &rng;
20		zephyr,canbus = &can0;
21		zephyr,flash-controller = &iap;
22	};
23
24	aliases{
25		led0 = &red_led;
26		led1 = &green_led;
27		led2 = &blue_led;
28		sw0 = &btn_wk;
29		sw1 = &btn_usr;
30		sw2 = &btn_isp;
31		usart-0 = &flexcomm0;
32		magn0 = &fxos8700;
33		accel0 = &fxos8700;
34		mcuboot-button0 = &btn_wk;
35	};
36
37	leds {
38		compatible = "gpio-leds";
39		red_led: led_0 {
40			gpios = <&gpio1 4 0>;
41			label = "Red LED";
42		};
43		green_led: led_1 {
44			gpios = <&gpio1 7 0>;
45			label = "Green LED";
46		};
47		blue_led: led_2 {
48			gpios = <&gpio1 6 0>;
49			label = "Blue LED";
50		};
51	};
52
53	gpio_keys {
54		compatible = "gpio-keys";
55		btn_wk: button_0 {
56			label = "Wakeup button";
57			gpios = <&gpio1 18 GPIO_ACTIVE_LOW>;
58			zephyr,code = <INPUT_KEY_WAKEUP>;
59		};
60		btn_usr: button_1 {
61			label = "USR button";
62			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
63			zephyr,code = <INPUT_KEY_0>;
64		};
65		btn_isp: button_2 {
66			label = "ISP button";
67			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
68			zephyr,code = <INPUT_KEY_1>;
69		};
70	};
71
72	mikrobus_header: mikrobus-connector {
73		compatible = "mikro-bus";
74		#gpio-cells = <2>;
75		gpio-map-mask = <0xffffffff 0xffffffc0>;
76		gpio-map-pass-thru = <0 0x3f>;
77		gpio-map =	<0 0 &gpio0 16 0>,	/* AN  */
78				/* Not a GPIO*/		/* RST */
79				<2 0 &gpio1 1 0>,	/* CS   */
80				<3 0 &gpio1 2 0>,	/* SCK  */
81				<4 0 &gpio1 3 0>,	/* MISO */
82				<5 0 &gpio0 26 0>,	/* MOSI */
83							/* +3.3V */
84							/* GND */
85				<6 0 &gpio1 5 0>,	/* PWM  */
86				<7 0 &gpio1 18 0>,	/* INT  */
87				<8 0 &gpio1 24 0>,	/* RX   */
88				<9 0 &gpio0 27 0>,	/* TX   */
89				<10 0 &gpio1 20 0>,	/* SCL  */
90				<11 0 &gpio1 21 0>;	/* SDA  */
91							/* +5V */
92							/* GND */
93	};
94
95	arduino_header: arduino-connector {
96		compatible = "arduino-header-r3";
97		#gpio-cells = <2>;
98		gpio-map-mask = <0xffffffff 0xffffffc0>;
99		gpio-map-pass-thru = <0 0x3f>;
100		gpio-map =	<0 0 &gpio0 16 0>,	/* A0 */
101				<1 0 &gpio0 23 0>,	/* A1 */
102				<2 0 &gpio0 0 0>,	/* A2 */
103				/* R63 DNP, A3 not connected  */
104				/* <3 0 &gpio1 31 0>,*/	/* A3 */
105				<4 0 &gpio0 13 0>,	/* A4 */
106				<5 0 &gpio0 14 0>,	/* A5 */
107				<6 0 &gpio1 24 0>,	/* D0 */
108				<7 0 &gpio0 27 0>,	/* D1 */
109				<8 0 &gpio0 15 0>,	/* D2 */
110				<9 0 &gpio1 6 0>,	/* D3 */
111				<10 0 &gpio1 7 0>,	/* D4 */
112				<11 0 &gpio1 4 0>,	/* D5 */
113				<12 0 &gpio1 10 0>,	/* D6 */
114				<13 0 &gpio1 9 0>,	/* D7 */
115				<14 0 &gpio1 8 0>,	/* D8 */
116				<15 0 &gpio1 5 0>,	/* D9 */
117				<16 0 &gpio1 1 0>,	/* D10 */
118				<17 0 &gpio0 26 0>,	/* D11 */
119				<18 0 &gpio1 3 0>,	/* D12 */
120				<19 0 &gpio1 2 0>,	/* D13 */
121				<20 0 &gpio1 21 0>,	/* D14 */
122				<21 0 &gpio1 20 0>;	/* D15 */
123	};
124};
125
126&flexcomm0 {
127	status = "okay";
128	compatible = "nxp,lpc-usart";
129	current-speed = <115200>;
130	pinctrl-0 = <&pinmux_flexcomm0_usart>;
131	pinctrl-names = "default";
132};
133
134&flexcomm4 {
135	status = "okay";
136	compatible = "nxp,lpc-i2c";
137	clock-frequency = <I2C_BITRATE_STANDARD>;
138	#address-cells = <1>;
139	#size-cells = <0>;
140	pinctrl-0 = <&pinmux_flexcomm4_i2c>;
141	pinctrl-names = "default";
142
143	fxos8700: fxos8700@1e {
144		compatible = "nxp,fxos8700";
145		reg = <0x1e>;
146		int1-gpios = <&gpio1 26 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
147	};
148};
149
150&can0 {
151	status = "okay";
152	pinctrl-0 = <&pinmux_can0>;
153	pinctrl-names = "default";
154
155	can-transceiver {
156		max-bitrate = <5000000>;
157	};
158};
159
160&hs_lspi {
161	status = "okay";
162	pinctrl-0 = <&pinmux_hs_lspi>;
163	pinctrl-names = "default";
164};
165
166&ctimer0 {
167	status = "okay";
168};
169
170&ctimer1 {
171	status = "okay";
172};
173
174&ctimer2 {
175	status = "okay";
176};
177
178&ctimer3 {
179	status = "okay";
180};
181
182&ctimer4 {
183	status = "okay";
184};
185
186&flash0 {
187	partitions {
188		compatible = "fixed-partitions";
189		#address-cells = <1>;
190		#size-cells = <1>;
191		boot_partition: partition@0 {
192			label = "mcuboot";
193			reg = <0x0 DT_SIZE_K(32)>;
194		};
195		slot0_partition: partition@8000 {
196			label = "image-0";
197			reg = <0x00008000 DT_SIZE_K(96)>;
198		};
199		slot1_partition: partition@20000 {
200			label = "image-1";
201			reg = <0x00020000 DT_SIZE_K(96)>;
202		};
203		storage_partition: partition@38000 {
204			label = "storage";
205			reg = <0x00038000 DT_SIZE_K(20)>;
206		};
207		/* The last 12KB are reserved for PFR on the 256KB flash. */
208	};
209};
210
211arduino_i2c: &flexcomm4 {};
212
213arduino_spi: &hs_lspi {};
214
215mikrobus_i2c: &flexcomm4 {};
216
217mikrobus_spi: &hs_lspi {};
218