1/*
2 * Copyright (c) 2022 metraTec
3 * Copyright 2022-2023 NXP
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#include "lpcxpresso55s06-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,flash-controller = &iap;
21		zephyr,canbus = &can0;
22	};
23
24	aliases {
25		led0 = &blue_led;
26		led1 = &red_led;
27		led2 = &green_led;
28		sw0 = &btn_wk;
29		sw1 = &btn_usr;
30		sw2 = &btn_isp;
31		usart-0 = &flexcomm0;
32		mcuboot-button0 = &btn_wk;
33	};
34
35	leds {
36		compatible = "gpio-leds";
37		blue_led: led_0 {
38			gpios = <&gpio0 22 0>;
39			label = "Blue LED";
40		};
41		red_led: led_1 {
42			gpios = <&gpio0 21 0>;
43			label = "Red LED";
44		};
45		green_led: led_2 {
46			gpios = <&gpio0 18 0>;
47			label = "Green LED";
48		};
49	};
50
51	gpio_keys {
52		compatible = "gpio-keys";
53		btn_wk: button_0 {
54			label = "Wakeup button";
55			gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
56			zephyr,code = <INPUT_KEY_WAKEUP>;
57		};
58		btn_usr: button_1 {
59			label = "User button";
60			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
61			zephyr,code = <INPUT_KEY_0>;
62		};
63		btn_isp: button_2 {
64			label = "ISP button";
65			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
66			zephyr,code = <INPUT_KEY_1>;
67		};
68	};
69
70	mikrobus_header: mikrobus-connector {
71		compatible = "mikro-bus";
72		#gpio-cells = <2>;
73		gpio-map-mask = <0xffffffff 0xffffffc0>;
74		gpio-map-pass-thru = <0 0x3f>;
75		gpio-map =	<0 0 &gpio0 16 0>,	/* AN   */
76				/* Not a GPIO */	/* RST  */
77				<2 0 &gpio1 1 0>,	/* CS   */
78				<3 0 &gpio1 2 0>,	/* SCK  */
79				<4 0 &gpio1 3 0>,	/* MISO */
80				<5 0 &gpio0 26 0>,	/* MOSI */
81							/* +3.3V */
82							/* GND  */
83				<6 0 &gpio1 5 0>,	/* PWM  */
84				<7 0 &gpio0 28 0>,	/* INT  */
85				<8 0 &gpio1 10 0>,	/* RX   */
86				<9 0 &gpio1 11 0>,	/* TX   */
87				<10 0 &gpio0 24 0>,	/* SCL  */
88				<11 0 &gpio0 25 0>;	/* SDA  */
89							/* +5V  */
90							/* GND  */
91	};
92
93	arduino_header: arduino-connector {
94		compatible = "arduino-header-r3";
95		#gpio-cells = <2>;
96		gpio-map-mask = <0xffffffff 0xffffffc0>;
97		gpio-map-pass-thru = <0 0x3f>;
98		gpio-map =	<0 0 &gpio0 16 0>,	/* A0 */
99				<1 0 &gpio0 23 0>,	/* A1 */
100				<2 0 &gpio0 9 0>,	/* A2 */
101				<3 0 &gpio0 0 0>,	/* A3 */
102				<4 0 &gpio0 13 0>,	/* A4 */
103				<5 0 &gpio0 14 0>,	/* A5 */
104				<6 0 &gpio1 10 0>,	/* D0 */
105				<7 0 &gpio1 11 0>,	/* D1 */
106				<8 0 &gpio0 15 0>,	/* D2 */
107				<9 0 &gpio0 23 0>,	/* D3 */
108				<10 0 &gpio0 22 0>,	/* D4 */
109				<11 0 &gpio0 19 0>,	/* D5 */
110				<12 0 &gpio0 18 0>,	/* D6 */
111				<13 0 &gpio0 2 0>,	/* D7 */
112				<14 0 &gpio0 10 0>,	/* D8 */
113				<15 0 &gpio0 25 0>,	/* D9 */
114				<16 0 &gpio1 1 0>,	/* D10 */
115				<17 0 &gpio0 26 0>,	/* D11 */
116				<18 0 &gpio1 3 0>,	/* D12 */
117				<19 0 &gpio1 2 0>;	/* D13 */
118	};
119};
120
121&flash0 {
122	partitions {
123		compatible = "fixed-partitions";
124		#address-cells = <1>;
125		#size-cells = <1>;
126		boot_partition: partition@0 {
127			label = "mcuboot";
128			reg = <0x0 DT_SIZE_K(32)>;
129		};
130		slot0_partition: partition@8000 {
131			label = "image-0";
132			reg = <0x00008000 DT_SIZE_K(96)>;
133		};
134		slot1_partition: partition@20000 {
135			label = "image-1";
136			reg = <0x00020000 DT_SIZE_K(96)>;
137		};
138		storage_partition: partition@38000 {
139			label = "storage";
140			reg = <0x00038000 DT_SIZE_K(20)>;
141		};
142		/* The last 12KB are reserved for PFR on the 256KB flash. */
143	};
144};
145
146&flexcomm0 {
147	status = "okay";
148	compatible = "nxp,lpc-usart";
149	current-speed = <115200>;
150	pinctrl-0 = <&pinmux_flexcomm0_usart>;
151	pinctrl-names = "default";
152};
153
154&can0 {
155	status = "okay";
156	pinctrl-0 = <&pinmux_can0>;
157	pinctrl-names = "default";
158
159	can-transceiver {
160		max-bitrate = <5000000>;
161	};
162};
163