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