1/* Copyright (c) 2018 SiFive, Inc. */
2/* SPDX-License-Identifier: Apache-2.0 */
3
4/dts-v1/;
5
6#include <sifive/riscv32-fe310.dtsi>
7#include <zephyr/dt-bindings/i2c/i2c.h>
8#include "hifive1-pinctrl.dtsi"
9
10/ {
11	model = "SiFive HiFive 1";
12	compatible = "sifive,hifive1";
13
14	aliases {
15		led0 = &led0;
16		led1 = &led1;
17		led2 = &led2;
18		pwm-led0 = &pwmled0;
19		pwm-led1 = &pwmled1;
20		pwm-led2 = &pwmled2;
21		watchdog0 = &wdog0;
22	};
23
24	chosen {
25		zephyr,console = &uart0;
26		zephyr,shell-uart = &uart0;
27		zephyr,sram = &dtim;
28		zephyr,flash = &flash0;
29	};
30
31	leds {
32		compatible = "gpio-leds";
33		led0: led_0 {
34			gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
35			label = "Green LED";
36		};
37		led1: led_1 {
38			gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
39			label = "Blue LED";
40		};
41		led2: led_2 {
42			gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
43			label = "Red LED";
44		};
45	};
46
47	pwmleds {
48		compatible = "pwm-leds";
49		pwmled0: pwmled_0 {
50			pwms = <&pwm1 1 PWM_MSEC(20)>;
51			label = "Green LED";
52		};
53		pwmled1: pwmled_1 {
54			pwms = <&pwm1 2 PWM_MSEC(20)>;
55			label = "Blue LED";
56		};
57		pwmled2: pwmled_2 {
58			pwms = <&pwm1 3 PWM_MSEC(20)>;
59			label = "Red LED";
60		};
61	};
62
63	arduino_header: connector {
64		compatible = "arduino-header-r3";
65		#gpio-cells = <2>;
66		gpio-map-mask = <0xffffffff 0xffffffc0>;
67		gpio-map-pass-thru = <0 0x3f>;
68		gpio-map = /* A0 not connected */
69			   <1 0 &gpio0 9 0>,	/* A1, also CS2 */
70			   <2 0 &gpio0 10 0>,	/* A2, also WF_INT */
71			   <3 0 &gpio0 11 0>,	/* A3 */
72			   <4 0 &gpio0 12 0>,	/* A4 */
73			   <5 0 &gpio0 13 0>,	/* A5 */
74			   <6 0 &gpio0 16 0>,	/* D0, also TX */
75			   <7 0 &gpio0 17 0>,	/* D1, also RX */
76			   <8 0 &gpio0 18 0>,	/* D2 */
77			   <9 0 &gpio0 19 0>,	/* D3 */
78			   <10 0 &gpio0 20 0>,	/* D4 */
79			   <11 0 &gpio0 21 0>,	/* D5 */
80			   <12 0 &gpio0 22 0>,	/* D6 */
81			   <13 0 &gpio0 23 0>,	/* D7 */
82			   <14 0 &gpio0 0 0>,	/* D8 */
83			   <15 0 &gpio0 1 0>,	/* D9 */
84			   <16 0 &gpio0 2 0>,	/* D10 */
85			   <17 0 &gpio0 3 0>,	/* D11, also MOSI */
86			   <18 0 &gpio0 4 0>,	/* D12, also MISO */
87			   <19 0 &gpio0 5 0>,	/* D13, also SCK */
88			   <20 0 &gpio0 12 0>,	/* D14, also SDA */
89			   <21 0 &gpio0 13 0>;	/* D15, also SCL */
90	};
91};
92
93&gpio0 {
94	status = "okay";
95};
96
97&uart0 {
98	status = "okay";
99	current-speed = <115200>;
100	pinctrl-0 = <&uart0_rx_default &uart0_tx_default>;
101	pinctrl-names = "default";
102};
103
104/* disabled (used by Flash ROM by default) */
105&spi0 {
106	reg = <0x10014000 0x1000 0x20400000 0xc00000>;
107	flash0: flash@0 {
108		compatible = "issi,is25lp128", "jedec,spi-nor";
109		status = "disabled";
110		size = <134217728>;
111		jedec-id = [96 60 18];
112		reg = <0>;
113		spi-max-frequency = <133000000>;
114	};
115};
116
117&spi1 {
118	status = "okay";
119	pinctrl-0 = <&spi1_cs0_default &spi1_cs2_default &spi1_cs3_default
120		     &spi1_mosi_default &spi1_miso_default &spi1_sck_default>;
121	pinctrl-names = "default";
122};
123
124&spi2 {
125	status = "okay";
126};
127
128&pwm0 {
129	status = "okay";
130};
131
132&pwm1 {
133	status = "okay";
134	pinctrl-0 = <&pwm1_1_default &pwm1_2_default &pwm1_3_default>;
135	pinctrl-names = "default";
136};
137
138&pwm2 {
139	status = "okay";
140	pinctrl-0 = <&pwm2_1_default &pwm2_2_default &pwm2_3_default>;
141	pinctrl-names = "default";
142};
143
144arduino_i2c: &i2c0 {
145	status = "okay";
146	clock-frequency = <100000>;
147	pinctrl-0 = <&i2c0_0_default &i2c0_1_default>;
148	pinctrl-names = "default";
149};
150