1/*
2 * Copyright 2018 Foundries.io Ltd
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#include "rv32m1_vega-pinctrl.dtsi"
7#include <zephyr/dt-bindings/input/input-event-codes.h>
8
9/ {
10	aliases {
11		led0 = &green_led;
12		led1 = &blue_led;
13		led2 = &red_led;
14		led3 = &sts_led;
15		pwm-led0 = &blue_pwm_led;
16		pwm-led1 = &green_pwm_led;
17		pwm-led2 = &red_pwm_led;
18		blue-pwm-led = &blue_pwm_led;
19		green-pwm-led = &green_pwm_led;
20		red-pwm-led = &red_pwm_led;
21		sw0 = &user_button_2;
22		sw1 = &user_button_3;
23		sw2 = &user_button_4;
24		sw3 = &user_button_5;
25		magn0 = &fxos8700;
26		accel0 = &fxos8700;
27	};
28
29	leds {
30		compatible = "gpio-leds";
31		blue_led: led_0 {
32			gpios = <&gpioa 22 GPIO_ACTIVE_HIGH>;
33			label = "User LD1";
34		};
35		green_led: led_1 {
36			gpios = <&gpioa 23 GPIO_ACTIVE_HIGH>;
37			label = "User LD2";
38		};
39		red_led: led_2 {
40			gpios = <&gpioa 24 GPIO_ACTIVE_HIGH>;
41			label = "User LD3";
42		};
43		sts_led: led_3 {
44			gpios = <&gpioe 0 GPIO_ACTIVE_HIGH>;
45			label = "User LD4";
46		};
47	};
48
49	pwmleds {
50		compatible = "pwm-leds";
51		blue_pwm_led: pwm_led_0 {
52			pwms = <&tpm2 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
53			label = "User PWM LD1";
54		};
55		green_pwm_led: pwm_led_1 {
56			pwms = <&tpm2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
57			label = "User PWM LD2";
58		};
59		red_pwm_led: pwm_led_2 {
60			pwms = <&tpm2 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
61			label = "User PWM LD3";
62		};
63	};
64
65	gpio_keys {
66		compatible = "gpio-keys";
67		user_button_2: button_0 {
68			label = "User SW2";
69			gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
70			zephyr,code = <INPUT_KEY_0>;
71		};
72		user_button_3: button_1 {
73			label = "User SW3";
74			gpios = <&gpioe 8 GPIO_ACTIVE_LOW>;
75			zephyr,code = <INPUT_KEY_1>;
76		};
77		user_button_4: button_2 {
78			label = "User SW4";
79			gpios = <&gpioe 9 GPIO_ACTIVE_LOW>;
80			zephyr,code = <INPUT_KEY_2>;
81		};
82		user_button_5: button_3 {
83			label = "User SW5";
84			gpios = <&gpioe 12 GPIO_ACTIVE_LOW>;
85			zephyr,code = <INPUT_KEY_3>;
86		};
87	};
88
89	arduino_header: connector {
90		compatible = "arduino-header-r3";
91		#gpio-cells = <2>;
92		gpio-map-mask = <0xffffffff 0xffffffc0>;
93		gpio-map-pass-thru = <0 0x3f>;
94		gpio-map = <0 0 &gpioc 11 0>,	/* A0 */
95			   <1 0 &gpioc 12 0>,	/* A1 */
96			   <2 0 &gpiob 9 0>,	/* A2 */
97			   <3 0 &gpioe 4 0>,	/* A3 */
98			   <4 0 &gpioe 10 0>,	/* A4 */
99			   <5 0 &gpioe 11 0>,	/* A5 */
100			   <6 0 &gpioa 25 0>,	/* D0 */
101			   <7 0 &gpioa 26 0>,	/* D1 */
102			   <8 0 &gpioa 27 0>,	/* D2 */
103			   <9 0 &gpiob 13 0>,	/* D3 */
104			   <10 0 &gpiob 14 0>,	/* D4 */
105			   <11 0 &gpioa 30 0>,	/* D5 */
106			   <12 0 &gpioa 31 0>,	/* D6 */
107			   <13 0 &gpiob 1 0>,	/* D7 */
108			   <14 0 &gpiob 2 0>,	/* D8 */
109			   <15 0 &gpiob 3 0>,	/* D9 */
110			   <16 0 &gpiob 6 0>,	/* D10 */
111			   <17 0 &gpiob 5 0>,	/* D11 */
112			   <18 0 &gpiob 7 0>,	/* D12 */
113			   <19 0 &gpiob 4 0>,	/* D13 */
114			   <20 0 &gpioc 9 0>,	/* D14 */
115			   <21 0 &gpioc 10 0>;	/* D15 */
116	};
117};
118
119arduino_serial: &lpuart1 {
120	pinctrl-0 = <&lpuart1_default>;
121	pinctrl-names = "default";
122};
123
124&lpuart0 {
125	current-speed = <115200>;
126	status = "okay";
127	pinctrl-0 = <&lpuart0_default>;
128	pinctrl-names = "default";
129};
130
131arduino_i2c: &lpi2c0 {
132	status = "okay";
133	pinctrl-0 = <&lpi2c0_default>;
134	pinctrl-names = "default";
135};
136
137&lpi2c3 {
138	status = "okay";
139	pinctrl-0 = <&lpi2c3_default>;
140	pinctrl-names = "default";
141
142	fxos8700: fxos8700@1e {
143		compatible = "nxp,fxos8700";
144		reg = <0x1e>;
145		reset-gpios = <&gpioe 27 GPIO_ACTIVE_HIGH>;
146		int1-gpios = <&gpioe 1 GPIO_ACTIVE_LOW>;
147		int2-gpios = <&gpioe 22 GPIO_ACTIVE_LOW>;
148	};
149};
150
151arduino_spi: &lpspi0 {
152	status = "okay";
153	pinctrl-0 = <&lpspi0_default>;
154	pinctrl-names = "default";
155};
156
157&lpspi1 {
158	status = "okay";
159	cs-gpios = <&gpiob 22 GPIO_ACTIVE_LOW>;
160	pinctrl-0 = <&lpspi1_default>;
161	pinctrl-names = "default";
162
163	mx25r32: mx25r3235f@0 {
164		compatible = "jedec,spi-nor";
165		reg = <0>;
166		spi-max-frequency = <80000000>;
167		jedec-id = [c2 28 16];
168		size = <33554432>;
169	};
170};
171
172&tpm2 {
173	status = "okay";
174	pinctrl-0 = <&tpm2_default>;
175	pinctrl-names = "default";
176};
177