ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/mkresin.git] / target / linux / ramips / dts / mt7621_storylink_sap-g3200u3.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "storylink,sap-g3200u3", "mediatek,mt7621-soc";
8 model = "STORYLiNK SAP-G3200U3";
9
10 leds {
11 compatible = "gpio-leds";
12
13 usb {
14 label = "green:usb";
15 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
16 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
17 linux,default-trigger = "usbport";
18 };
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29
30 rfkill {
31 label = "rfkill";
32 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_RFKILL>;
34 };
35 };
36 };
37
38 &spi0 {
39 status = "okay";
40
41 flash@0 {
42 compatible = "jedec,spi-nor";
43 reg = <0>;
44 spi-max-frequency = <10000000>;
45
46 partitions {
47 compatible = "fixed-partitions";
48 #address-cells = <1>;
49 #size-cells = <1>;
50
51 partition@0 {
52 label = "u-boot";
53 reg = <0x0 0x30000>;
54 read-only;
55 };
56
57 partition@30000 {
58 label = "u-boot-env";
59 reg = <0x30000 0x1000>;
60 read-only;
61 };
62
63 partition@31000 {
64 label = "config";
65 reg = <0x31000 0xf000>;
66 read-only;
67 };
68
69 factory: partition@40000 {
70 label = "factory";
71 reg = <0x40000 0x10000>;
72 read-only;
73 };
74
75 partition@50000 {
76 compatible = "denx,uimage";
77 label = "firmware";
78 reg = <0x50000 0x7b0000>;
79 };
80 };
81 };
82 };
83
84 &pcie {
85 status = "okay";
86 };
87
88 &pcie0 {
89 mt76@0,0 {
90 reg = <0x0000 0 0 0 0>;
91 mediatek,mtd-eeprom = <&factory 0x8000>;
92 ieee80211-freq-limit = <5000000 6000000>;
93 };
94 };
95
96 &pcie1 {
97 mt76@0,0 {
98 reg = <0x0000 0 0 0 0>;
99 mediatek,mtd-eeprom = <&factory 0x0000>;
100 ieee80211-freq-limit = <2400000 2500000>;
101 };
102 };
103
104 &gmac0 {
105 nvmem-cells = <&macaddr_factory_e006>;
106 nvmem-cell-names = "mac-address";
107 };
108
109 &switch0 {
110 ports {
111 port@0 {
112 status = "okay";
113 label = "lan1";
114 };
115
116 port@1 {
117 status = "okay";
118 label = "lan2";
119 };
120
121 port@2 {
122 status = "okay";
123 label = "lan3";
124 };
125
126 port@3 {
127 status = "okay";
128 label = "lan4";
129 };
130
131 port@4 {
132 status = "okay";
133 label = "wan";
134 nvmem-cells = <&macaddr_factory_e006>;
135 nvmem-cell-names = "mac-address";
136 mac-address-increment = <1>;
137 };
138 };
139 };
140
141 &state_default {
142 gpio {
143 groups = "uart3", "jtag";
144 function = "gpio";
145 };
146 };
147
148 &factory {
149 compatible = "nvmem-cells";
150 #address-cells = <1>;
151 #size-cells = <1>;
152
153 macaddr_factory_e006: macaddr@e006 {
154 reg = <0xe006 0x6>;
155 };
156 };