ramips: Use dts alias based status led
[openwrt/openwrt.git] / target / linux / ramips / dts / Newifi-D2.dts
1 /dts-v1/;
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "d-team,newifi-d2", "mediatek,mt7621-soc";
10 model = "Newifi-D2";
11
12 aliases {
13 led-status = &led_power_blue;
14 };
15
16 memory@0 {
17 device_type = "memory";
18 reg = <0x0 0x1c000000>, <0x20000000 0x4000000>;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 gpio-leds {
26 compatible = "gpio-leds";
27
28 power-amber {
29 label = "newifi-d2:amber:power";
30 gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
31 };
32
33 led_power_blue: power-blue {
34 label = "newifi-d2:blue:power";
35 gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
36 };
37
38 internet-amber {
39 label = "newifi-d2:amber:internet";
40 gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
41 };
42
43 internet-blue {
44 label = "newifi-d2:blue:internet";
45 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
46 };
47
48 wlan2g {
49 label = "newifi-d2:blue:wlan2g";
50 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
51 };
52
53 wlan5g {
54 label = "newifi-d2:blue:wlan5g";
55 gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
56 };
57
58 usb {
59 label = "newifi-d2:blue:usb";
60 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
61 };
62 };
63
64 gpio-keys-polled {
65 compatible = "gpio-keys-polled";
66 #address-cells = <1>;
67 #size-cells = <0>;
68 poll-interval = <20>;
69
70 reset {
71 label = "reset";
72 gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
73 linux,code = <KEY_RESTART>;
74 };
75
76 wps {
77 label = "wps";
78 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
79 linux,code = <KEY_WPS_BUTTON>;
80 };
81 };
82
83 gpio_export {
84 compatible = "gpio-export";
85 #size-cells = <0>;
86
87 power_usb3 {
88 gpio-export,name = "power_usb3";
89 gpio-export,output = <1>;
90 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
91 };
92 };
93 };
94
95 &spi0 {
96 status = "okay";
97
98 m25p80@0 {
99 #address-cells = <1>;
100 #size-cells = <1>;
101 compatible = "jedec,spi-nor";
102 reg = <0>;
103 spi-max-frequency = <10000000>;
104 m25p,chunked-io = <32>;
105
106 partition@0 {
107 label = "u-boot";
108 reg = <0x0 0x30000>;
109 read-only;
110 };
111
112 partition@30000 {
113 label = "u-boot-env";
114 reg = <0x30000 0x10000>;
115 read-only;
116 };
117
118 factory: partition@40000 {
119 label = "factory";
120 reg = <0x40000 0x10000>;
121 read-only;
122 };
123
124 partition@50000 {
125 label = "firmware";
126 reg = <0x50000 0x1fb0000>;
127 };
128 };
129 };
130
131 &pcie {
132 status = "okay";
133
134 pcie0 {
135 mt76@0,0 {
136 reg = <0x0000 0 0 0 0>;
137 device_type = "pci";
138 mediatek,mtd-eeprom = <&factory 0x8000>;
139 ieee80211-freq-limit = <5000000 6000000>;
140 };
141 };
142
143 pcie1 {
144 mt76@1,0 {
145 reg = <0x0000 0 0 0 0>;
146 device_type = "pci";
147 mediatek,mtd-eeprom = <&factory 0x0000>;
148 };
149 };
150 };
151
152 &ethernet {
153 mtd-mac-address = <&factory 0xe000>;
154 };
155
156 &pinctrl {
157 state_default: pinctrl0 {
158 gpio {
159 ralink,group = "i2c", "jtag", "uart2", "uart3";
160 ralink,function = "gpio";
161 };
162 };
163 };