ramips: convert mt76 PCIe NIC EEPROM to NVMEM format for legacy SoCs
[openwrt/staging/xback.git] / target / linux / ramips / dts / mt7620a_buffalo_whr-1166d.dts
1 #include "mt7620a.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "buffalo,whr-1166d", "ralink,mt7620a-soc";
8 model = "Buffalo WHR-1166D";
9
10 aliases {
11 led-boot = &led_power_green;
12 led-failsafe = &led_power_green;
13 led-running = &led_power_green;
14 led-upgrade = &led_power_green;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 power {
21 label = "red:power";
22 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
23 };
24
25 wifi {
26 label = "green:wifi";
27 gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
28 };
29
30 led_power_green: power2 {
31 label = "green:power";
32 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
33 };
34
35 wifi2 {
36 label = "orange:wifi";
37 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
38 };
39
40 internet {
41 label = "green:internet";
42 gpios = <&gpio2 17 GPIO_ACTIVE_LOW>;
43 };
44
45 router {
46 label = "orange:router";
47 gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;
48 };
49
50 router2 {
51 label = "green:router";
52 gpios = <&gpio2 19 GPIO_ACTIVE_LOW>;
53 };
54 };
55
56 keys {
57 compatible = "gpio-keys";
58
59 reset {
60 label = "reset";
61 gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
62 linux,code = <KEY_RESTART>;
63 };
64
65 aoss {
66 label = "aoss";
67 gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
68 linux,code = <KEY_WPS_BUTTON>;
69 };
70
71 ap {
72 label = "ap";
73 gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
74 linux,code = <BTN_0>;
75 linux,input-type = <EV_SW>;
76 };
77
78 bridge {
79 label = "bridge";
80 gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
81 linux,code = <BTN_0>;
82 linux,input-type = <EV_SW>;
83 };
84 };
85 };
86
87 &gpio2 {
88 status = "okay";
89 };
90
91 &spi0 {
92 status = "okay";
93
94 flash@0 {
95 compatible = "jedec,spi-nor";
96 reg = <0>;
97 spi-max-frequency = <10000000>;
98
99 partitions {
100 compatible = "fixed-partitions";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 partition@0 {
105 label = "u-boot";
106 reg = <0x0 0x30000>;
107 read-only;
108 };
109
110 partition@30000 {
111 label = "u-boot-env";
112 reg = <0x30000 0x10000>;
113 read-only;
114 };
115
116 factory: partition@40000 {
117 compatible = "nvmem-cells";
118 label = "factory";
119 reg = <0x40000 0x10000>;
120 #address-cells = <1>;
121 #size-cells = <1>;
122 read-only;
123
124 eeprom_factory_0: eeprom@0 {
125 reg = <0x0 0x200>;
126 };
127
128 eeprom_factory_8000: eeprom@8000 {
129 reg = <0x8000 0x200>;
130 };
131
132 macaddr_factory_4: macaddr@4 {
133 reg = <0x4 0x6>;
134 };
135 };
136
137 partition@50000 {
138 compatible = "denx,uimage";
139 label = "firmware";
140 reg = <0x50000 0xfb0000>;
141 };
142 };
143 };
144 };
145
146 &state_default {
147 gpio {
148 groups = "i2c", "uartf", "wled", "nd_sd";
149 function = "gpio";
150 };
151 };
152
153 &ethernet {
154 pinctrl-names = "default";
155 pinctrl-0 = <&rgmii1_pins &mdio_pins>;
156
157 nvmem-cells = <&macaddr_factory_4>;
158 nvmem-cell-names = "mac-address";
159
160 port@5 {
161 status = "okay";
162 phy-handle = <&phy5>;
163 phy-mode = "rgmii";
164 };
165
166 mdio-bus {
167 status = "okay";
168
169 phy5: ethernet-phy@5 {
170 reg = <5>;
171 phy-mode = "rgmii-rxid";
172 };
173 };
174 };
175
176 &wmac {
177 nvmem-cells = <&eeprom_factory_0>;
178 nvmem-cell-names = "eeprom";
179 };
180
181 &pcie {
182 status = "okay";
183 };
184
185 &pcie0 {
186 wifi@0,0 {
187 compatible = "pci0,0";
188 reg = <0x0000 0 0 0 0>;
189 nvmem-cells = <&eeprom_factory_8000>;
190 nvmem-cell-names = "eeprom";
191 ieee80211-freq-limit = <5000000 6000000>;
192 };
193 };