6b5436899aa1db7a5ac71796fb09e38e88329694
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_samknows_whitebox-v8.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/input/input.h>
4 #include <dt-bindings/leds/common.h>
5 #include <dt-bindings/gpio/gpio.h>
6
7 / {
8 compatible = "samknows,whitebox-v8", "mediatek,mt7621-soc";
9 model = "SamKnows Whitebox 8";
10
11 aliases {
12 led-boot = &led_wps;
13 led-failsafe = &led_wps;
14 led-running = &led_wps;
15 led-upgrade = &led_wps;
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 led_wps: wps {
22 function = LED_FUNCTION_WPS;
23 color = <LED_COLOR_ID_GREEN>;
24 gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
25 };
26
27 usb {
28 function = LED_FUNCTION_USB;
29 color = <LED_COLOR_ID_GREEN>;
30 gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
31 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
32 linux,default-trigger = "usbport";
33 };
34 };
35
36 keys {
37 compatible = "gpio-keys";
38
39 wps {
40 label = "wps";
41 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
42 linux,code = <KEY_WPS_BUTTON>;
43 };
44
45 reset {
46 label = "reset";
47 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_RESTART>;
49 };
50 };
51 };
52
53 &spi0 {
54 status = "okay";
55
56 flash@0 {
57 compatible = "jedec,spi-nor";
58 reg = <0>;
59 spi-max-frequency = <10000000>;
60
61 partitions {
62 compatible = "fixed-partitions";
63 #address-cells = <1>;
64 #size-cells = <1>;
65
66 partition@0 {
67 label = "u-boot";
68 reg = <0x0 0x30000>;
69 read-only;
70 };
71
72 partition@30000 {
73 label = "u-boot-env";
74 reg = <0x30000 0x10000>;
75 };
76
77 factory: partition@40000 {
78 label = "factory";
79 reg = <0x40000 0x10000>;
80 read-only;
81
82 nvmem-layout {
83 compatible = "fixed-layout";
84 #address-cells = <1>;
85 #size-cells = <1>;
86
87 eeprom_factory_0: eeprom@0 {
88 reg = <0x0 0x400>;
89 };
90
91 eeprom_factory_8000: eeprom@8000 {
92 reg = <0x8000 0x200>;
93 };
94
95 macaddr_factory_e000: macaddr@e000 {
96 reg = <0xe000 0x6>;
97 };
98
99 macaddr_factory_e006: macaddr@e006 {
100 reg = <0xe006 0x6>;
101 };
102 };
103 };
104
105 partition@50000 {
106 compatible = "denx,uimage";
107 label = "firmware";
108 reg = <0x50000 0xfb0000>;
109 };
110 };
111 };
112 };
113
114 &pcie {
115 status = "okay";
116 };
117
118 &pcie0 {
119 mt76@0,0 {
120 reg = <0x0000 0 0 0 0>;
121 nvmem-cells = <&eeprom_factory_8000>;
122 nvmem-cell-names = "eeprom";
123 ieee80211-freq-limit = <5000000 6000000>;
124 };
125 };
126
127 &pcie1 {
128 mt76@0,0 {
129 reg = <0x0000 0 0 0 0>;
130 nvmem-cells = <&eeprom_factory_0>;
131 nvmem-cell-names = "eeprom";
132 };
133 };
134
135 &gmac0 {
136 nvmem-cells = <&macaddr_factory_e000>;
137 nvmem-cell-names = "mac-address";
138 };
139
140 &gmac1 {
141 status = "okay";
142 label = "wan";
143 phy-handle = <&ethphy4>;
144
145 nvmem-cells = <&macaddr_factory_e006>;
146 nvmem-cell-names = "mac-address";
147 };
148
149 &mdio {
150 ethphy4: ethernet-phy@4 {
151 reg = <4>;
152 };
153 };
154
155 &switch0 {
156 ports {
157 port@0 {
158 status = "okay";
159 label = "lan1";
160 };
161
162 port@1 {
163 status = "okay";
164 label = "lan2";
165 };
166
167 port@2 {
168 status = "okay";
169 label = "lan3";
170 };
171
172 port@3 {
173 status = "okay";
174 label = "lan4";
175 };
176 };
177 };
178
179 &state_default {
180 gpio {
181 groups = "sdhci";
182 function = "gpio";
183 };
184 };