xref: /linux/arch/riscv/boot/dts/canaan/sipeed_maix_go.dts (revision 55d0969c451159cff86949b38c39171cab962069)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2019-20 Sean Anderson <seanga2@gmail.com>
4 * Copyright (C) 2020 Western Digital Corporation or its affiliates.
5 */
6
7/dts-v1/;
8
9#include "k210.dtsi"
10
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/input/input.h>
13#include <dt-bindings/leds/common.h>
14
15/ {
16	model = "SiPeed MAIX GO";
17	compatible = "sipeed,maix-go", "canaan,kendryte-k210";
18
19	aliases {
20		serial0 = &uarths0;
21	};
22
23	chosen {
24		bootargs = "earlycon console=ttySIF0";
25		stdout-path = "serial0:115200n8";
26	};
27
28	gpio-leds {
29		compatible = "gpio-leds";
30
31		led0 {
32			color = <LED_COLOR_ID_GREEN>;
33			label = "green";
34			gpios = <&gpio1_0 4 GPIO_ACTIVE_LOW>;
35		};
36
37		led1 {
38			color = <LED_COLOR_ID_RED>;
39			label = "red";
40			gpios = <&gpio1_0 5 GPIO_ACTIVE_LOW>;
41		};
42
43		led2 {
44			color = <LED_COLOR_ID_BLUE>;
45			label = "blue";
46			gpios = <&gpio1_0 6 GPIO_ACTIVE_LOW>;
47		};
48	};
49
50	gpio-keys {
51		compatible = "gpio-keys";
52
53		key-up {
54			label = "UP";
55			linux,code = <BTN_1>;
56			gpios = <&gpio1_0 7 GPIO_ACTIVE_LOW>;
57		};
58
59		key-press {
60			label = "PRESS";
61			linux,code = <BTN_0>;
62			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
63		};
64
65		key-down {
66			label = "DOWN";
67			linux,code = <BTN_2>;
68			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
69		};
70	};
71};
72
73&fpioa {
74	pinctrl-0 = <&jtag_pinctrl>;
75	pinctrl-names = "default";
76
77	jtag_pinctrl: jtag-pinmux {
78		pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
79			 <K210_FPIOA(1, K210_PCF_JTAG_TDI)>,
80			 <K210_FPIOA(2, K210_PCF_JTAG_TMS)>,
81			 <K210_FPIOA(3, K210_PCF_JTAG_TDO)>;
82	};
83
84	uarths_pinctrl: uarths-pinmux {
85		pinmux = <K210_FPIOA(4, K210_PCF_UARTHS_RX)>,
86			 <K210_FPIOA(5, K210_PCF_UARTHS_TX)>;
87	};
88
89	gpio_pinctrl: gpio-pinmux {
90		pinmux = <K210_FPIOA(8, K210_PCF_GPIO0)>,
91			 <K210_FPIOA(9, K210_PCF_GPIO1)>,
92			 <K210_FPIOA(10, K210_PCF_GPIO2)>,
93			 <K210_FPIOA(11, K210_PCF_GPIO3)>,
94			 <K210_FPIOA(12, K210_PCF_GPIO4)>,
95			 <K210_FPIOA(13, K210_PCF_GPIO5)>,
96			 <K210_FPIOA(14, K210_PCF_GPIO6)>,
97			 <K210_FPIOA(15, K210_PCF_GPIO7)>;
98	};
99
100	gpiohs_pinctrl: gpiohs-pinmux {
101		pinmux = <K210_FPIOA(16, K210_PCF_GPIOHS0)>,
102			 <K210_FPIOA(17, K210_PCF_GPIOHS1)>,
103			 <K210_FPIOA(21, K210_PCF_GPIOHS5)>,
104			 <K210_FPIOA(22, K210_PCF_GPIOHS6)>,
105			 <K210_FPIOA(23, K210_PCF_GPIOHS7)>,
106			 <K210_FPIOA(24, K210_PCF_GPIOHS8)>,
107			 <K210_FPIOA(25, K210_PCF_GPIOHS9)>,
108			 <K210_FPIOA(32, K210_PCF_GPIOHS16)>,
109			 <K210_FPIOA(33, K210_PCF_GPIOHS17)>,
110			 <K210_FPIOA(34, K210_PCF_GPIOHS18)>,
111			 <K210_FPIOA(35, K210_PCF_GPIOHS19)>;
112	};
113
114	i2s0_pinctrl: i2s0-pinmux {
115		pinmux = <K210_FPIOA(18, K210_PCF_I2S0_SCLK)>,
116			 <K210_FPIOA(19, K210_PCF_I2S0_WS)>,
117			 <K210_FPIOA(20, K210_PCF_I2S0_IN_D0)>;
118	};
119
120	dvp_pinctrl: dvp-pinmux {
121		pinmux = <K210_FPIOA(40, K210_PCF_SCCB_SDA)>,
122			 <K210_FPIOA(41, K210_PCF_SCCB_SCLK)>,
123			 <K210_FPIOA(42, K210_PCF_DVP_RST)>,
124			 <K210_FPIOA(43, K210_PCF_DVP_VSYNC)>,
125			 <K210_FPIOA(44, K210_PCF_DVP_PWDN)>,
126			 <K210_FPIOA(45, K210_PCF_DVP_HSYNC)>,
127			 <K210_FPIOA(46, K210_PCF_DVP_XCLK)>,
128			 <K210_FPIOA(47, K210_PCF_DVP_PCLK)>;
129	};
130
131	spi0_pinctrl: spi0-pinmux {
132		pinmux = <K210_FPIOA(36, K210_PCF_GPIOHS20)>,  /* cs */
133			 <K210_FPIOA(37, K210_PCF_GPIOHS21)>,  /* rst */
134			 <K210_FPIOA(38, K210_PCF_GPIOHS22)>,  /* dc */
135			 <K210_FPIOA(39, K210_PCF_SPI0_SCLK)>; /* wr */
136	};
137
138	spi1_pinctrl: spi1-pinmux {
139		pinmux = <K210_FPIOA(26, K210_PCF_SPI1_D1)>,
140			 <K210_FPIOA(27, K210_PCF_SPI1_SCLK)>,
141			 <K210_FPIOA(28, K210_PCF_SPI1_D0)>,
142			 <K210_FPIOA(29, K210_PCF_GPIOHS13)>; /* cs */
143	};
144
145	i2c1_pinctrl: i2c1-pinmux {
146		pinmux = <K210_FPIOA(30, K210_PCF_I2C1_SCLK)>,
147			 <K210_FPIOA(31, K210_PCF_I2C1_SDA)>;
148	};
149};
150
151&uarths0 {
152	pinctrl-0 = <&uarths_pinctrl>;
153	pinctrl-names = "default";
154	status = "okay";
155};
156
157&gpio0 {
158	pinctrl-0 = <&gpiohs_pinctrl>;
159	pinctrl-names = "default";
160	status = "okay";
161};
162
163&gpio1 {
164	pinctrl-0 = <&gpio_pinctrl>;
165	pinctrl-names = "default";
166	status = "okay";
167};
168
169&i2s0 {
170	#sound-dai-cells = <1>;
171	pinctrl-0 = <&i2s0_pinctrl>;
172	pinctrl-names = "default";
173	status = "okay";
174};
175
176&i2c1 {
177	pinctrl-0 = <&i2c1_pinctrl>;
178	pinctrl-names = "default";
179	clock-frequency = <400000>;
180	status = "okay";
181};
182
183&spi0 {
184	pinctrl-0 = <&spi0_pinctrl>;
185	pinctrl-names = "default";
186	num-cs = <1>;
187	cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
188	status = "okay";
189
190	panel@0 {
191		compatible = "sitronix,st7789v";
192		reg = <0>;
193		reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
194		dc-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
195		spi-max-frequency = <15000000>;
196		status = "disabled";
197	};
198};
199
200&spi1 {
201	pinctrl-0 = <&spi1_pinctrl>;
202	pinctrl-names = "default";
203	num-cs = <1>;
204	cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
205	status = "okay";
206
207	mmc@0 {
208		compatible = "mmc-spi-slot";
209		reg = <0>;
210		voltage-ranges = <3300 3300>;
211		spi-max-frequency = <25000000>;
212		broken-cd;
213	};
214};
215
216&spi3 {
217	status = "okay";
218
219	flash@0 {
220		compatible = "jedec,spi-nor";
221		reg = <0>;
222		spi-max-frequency = <50000000>;
223		spi-tx-bus-width = <4>;
224		spi-rx-bus-width = <4>;
225		m25p,fast-read;
226		broken-flash-reset;
227	};
228};
229