1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2019 Stefan Roese <sr@denx.de>
4 */
5
6/dts-v1/;
7
8/include/ "mt7628a.dtsi"
9
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12
13/ {
14	compatible = "gardena,smart-gateway-mt7688", "ralink,mt7688a-soc",
15		     "ralink,mt7628a-soc";
16	model = "GARDENA smart Gateway (MT7688)";
17
18	memory@0 {
19		device_type = "memory";
20		reg = <0x0 0x8000000>;
21	};
22
23	gpio-keys {
24		compatible = "gpio-keys";
25
26		pinctrl-names = "default";
27		pinctrl-0 = <&pinmux_gpio_gpio>;	/* GPIO11 */
28
29		user_btn1 {
30			label = "USER_BTN1";
31			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
32			linux,code =<KEY_PROG1> ;
33		};
34	};
35
36	leds {
37		compatible = "gpio-leds";
38
39		pinctrl-names = "default";
40		pinctrl-0 = <&pinmux_pwm0_gpio>,	/* GPIO18 */
41			    <&pinmux_pwm1_gpio>,	/* GPIO19 */
42			    <&pinmux_sdmode_gpio>,	/* GPIO22..29 */
43			    <&pinmux_p0led_an_gpio>;	/* GPIO43 */
44		/*
45		 * <&pinmux_i2s_gpio> (covers GPIO0..3) is needed here as
46		 * well for GPIO3. But this is already claimed for uart1
47		 * (see below). So we can't include it in this LED node.
48		 */
49
50		power_blue {
51			label = "smartgw:power:blue";
52			gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
53			default-state = "off";
54		};
55
56		power_green {
57			label = "smartgw:power:green";
58			gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
59			default-state = "off";
60		};
61
62		power_red {
63			label = "smartgw:power:red";
64			gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
65			default-state = "off";
66		};
67
68		radio_blue {
69			label = "smartgw:radio:blue";
70			gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
71			default-state = "off";
72		};
73
74		radio_green {
75			label = "smartgw:radio:green";
76			gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
77			default-state = "off";
78		};
79
80		radio_red {
81			label = "smartgw:radio:red";
82			gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
83			default-state = "off";
84		};
85
86		internet_blue {
87			label = "smartgw:internet:blue";
88			gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
89			default-state = "off";
90		};
91
92		internet_green {
93			label = "smartgw:internet:green";
94			gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
95			default-state = "off";
96		};
97
98		internet_red {
99			label = "smartgw:internet:red";
100			gpios = <&gpio 28 GPIO_ACTIVE_HIGH>;
101			default-state = "off";
102		};
103
104		ethernet_link {
105			label = "smartgw:eth:link";
106			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
107			linux,default-trigger = "netdev";
108		};
109
110		ethernet_activity {
111			label = "smartgw:eth:act";
112			gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
113			linux,default-trigger = "netdev";
114		};
115	};
116
117	aliases {
118		serial0 = &uart0;
119	};
120};
121
122&i2c {
123	status = "okay";
124};
125
126&spi {
127	status = "okay";
128
129	pinctrl-names = "default";
130	pinctrl-0 = <&pinmux_spi_spi>, <&pinmux_spi_cs1_cs>;
131
132	flash@0 {
133		compatible = "jedec,spi-nor";
134		reg = <0>;
135		spi-max-frequency = <40000000>;
136
137		partitions {
138			compatible = "fixed-partitions";
139			#address-cells = <1>;
140			#size-cells = <1>;
141
142			partition@0 {
143				label = "uboot";
144				reg = <0x0 0xa0000>;
145				read-only;
146			};
147
148			partition@a0000 {
149				label = "uboot_env0";
150				reg = <0xa0000 0x10000>;
151			};
152
153			partition@b0000 {
154				label = "uboot_env1";
155				reg = <0xb0000 0x10000>;
156			};
157
158			factory: partition@c0000 {
159				label = "factory";
160				reg = <0xc0000 0x10000>;
161				read-only;
162			};
163		};
164	};
165
166	nand_flash@1 {
167		compatible = "spi-nand";
168		linux,mtd-name = "gd5f";
169		reg = <1>;
170		spi-max-frequency = <40000000>;
171	};
172};
173
174&uart1 {
175	status = "okay";
176
177	pinctrl-names = "default";
178	pinctrl-0 = <&pinmux_i2s_gpio>;		/* GPIO0..3 */
179
180	fifo-size = <8>;
181	tx-threshold = <8>;
182
183	rts-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
184	cts-gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
185};
186
187&uart2 {
188	status = "okay";
189
190	pinctrl-names = "default";
191	pinctrl-0 = <&pinmux_p2led_an_gpio>,	/* GPIO41 */
192		    <&pinmux_p3led_an_gpio>;	/* GPIO40 */
193
194	rts-gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
195	cts-gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
196};
197
198&watchdog {
199	status = "okay";
200};
201
202&wmac {
203	status = "okay";
204	mediatek,mtd-eeprom = <&factory 0x0000>;
205};
206