ramips: Use dts alias based status led
[oweals/openwrt.git] / target / linux / ramips / dts / NA930.dts
1 /dts-v1/;
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "sercomm,na930", "ralink,mt7620a-soc";
10         model = "Sercomm NA930";
11
12         aliases {
13                 led-status = &led_power;
14         };
15
16         chosen {
17                 bootargs = "console=ttyS1,57600";
18         };
19
20         nand {
21                 #address-cells = <1>;
22                 #size-cells = <1>;
23                 compatible = "mtk,mt7620-nand";
24
25                 partition@0 {
26                         label = "u-boot";
27                         reg = <0x0 0x20000>;
28                         read-only;
29                 };
30
31                 partition@200000 {
32                         label = "factory";
33                         reg = <0x200000 0x40000>;
34                         read-only;
35                 };
36
37                 partition@240000 {
38                         label = "Config";
39                         reg = <0x240000 0x400000>;
40                         read-only;
41                 };
42
43                 partition@640000 {
44                         label = "firmware";
45                         reg = <0x640000 0x1400000>;
46                 };
47         };
48
49         gpio-keys-polled {
50                 compatible = "gpio-keys-polled";
51                 #address-cells = <1>;
52                 #size-cells = <0>;
53                 poll-interval = <20>;
54
55                 reset {
56                         label = "reset";
57                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
58                         linux,code = <KEY_RESTART>;
59                 };
60
61                 zwave {
62                         label = "zwave";
63                         gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
64                         linux,code = <BTN_0>;
65                 };
66
67                 wps {
68                         label = "wps";
69                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
70                         linux,code = <KEY_WPS_BUTTON>;
71                 };
72         };
73
74         gpio-leds {
75                 compatible = "gpio-leds";
76
77                 zwave {
78                         label = "na930:blue:zwave";
79                         gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
80                 };
81
82                 status {
83                         label = "na930:blue:status";
84                         gpios = <&gpio2 26 GPIO_ACTIVE_LOW>;
85                 };
86
87                 service {
88                         label = "na930:blue:service";
89                         gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
90                 };
91
92                 led_power: power {
93                         label = "na930:blue:power";
94                         gpios = <&gpio2 29 GPIO_ACTIVE_LOW>;
95                 };
96         };
97
98         gpio_export {
99                 compatible = "gpio-export";
100                 #size-cells = <0>;
101
102                 telit {
103                         gpio-export,name = "telit";
104                         gpio-export,output = <1>;
105                         gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
106                 };
107         };
108 };
109
110 &pinctrl {
111         state_default: pinctrl0 {
112                 gpio {
113                         ralink,group = "i2c", "rgmii2", "spi", "ephy";
114                         ralink,function = "gpio";
115                 };
116
117                 uartf_gpio {
118                         ralink,group = "uartf";
119                         ralink,function = "gpio uartf";
120                 };
121         };
122 };
123
124 &uart {
125         status = "okay";
126 };
127
128 &gpio1 {
129         status = "okay";
130 };
131
132 &gpio2 {
133         status = "okay";
134 };
135
136 &ethernet {
137         status = "okay";
138         pinctrl-names = "default";
139         pinctrl-0 = <&rgmii1_pins &mdio_pins>;
140         mediatek,portmap = "llllw";
141
142         port@4 {
143                 status = "okay";
144                 phy-handle = <&phy4>;
145                 phy-mode = "rgmii";
146         };
147
148         port@5 {
149                 status = "okay";
150                 phy-handle = <&phy5>;
151                 phy-mode = "rgmii";
152         };
153
154         mdio-bus {
155                 status = "okay";
156
157                 phy4: ethernet-phy@4 {
158                         reg = <4>;
159                         phy-mode = "rgmii";
160                 };
161
162                 phy5: ethernet-phy@5 {
163                         reg = <5>;
164                         phy-mode = "rgmii";
165                 };
166         };
167 };
168
169 &gsw {
170         mediatek,port4 = "gmac";
171 };
172
173 &ehci {
174         status = "okay";
175 };
176
177 &ohci {
178         status = "okay";
179 };