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