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