ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7620a_xiaomi_miwifi-mini.dts
1 #include "mt7620a.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "xiaomi,miwifi-mini", "ralink,mt7620a-soc";
8 model = "Xiaomi MiWiFi Mini";
9
10 aliases {
11 led-boot = &led_blue;
12 led-failsafe = &led_blue;
13 led-running = &led_blue;
14 led-upgrade = &led_blue;
15 label-mac-device = &ethernet;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,115200";
20 };
21
22 leds {
23 compatible = "gpio-leds";
24
25 led_blue: blue {
26 label = "blue:status";
27 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
28 default-state = "on";
29 };
30
31 yellow {
32 label = "yellow:status";
33 gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
34 };
35
36 red {
37 label = "red:status";
38 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
39 };
40 };
41
42 keys {
43 compatible = "gpio-keys";
44
45 reset {
46 label = "reset";
47 gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
48 linux,code = <KEY_RESTART>;
49 };
50 };
51 };
52
53 &gpio1 {
54 status = "okay";
55 };
56
57 &spi0 {
58 status = "okay";
59
60 flash@0 {
61 compatible = "jedec,spi-nor";
62 reg = <0>;
63 spi-max-frequency = <10000000>;
64
65 partitions {
66 compatible = "fixed-partitions";
67 #address-cells = <1>;
68 #size-cells = <1>;
69
70 partition@0 {
71 label = "u-boot";
72 reg = <0x0 0x30000>;
73 };
74
75 partition@30000 {
76 label = "u-boot-env";
77 reg = <0x30000 0x10000>;
78 read-only;
79 };
80
81 factory: partition@40000 {
82 label = "factory";
83 reg = <0x40000 0x10000>;
84 read-only;
85 };
86
87 partition@50000 {
88 compatible = "denx,uimage";
89 label = "firmware";
90 reg = <0x50000 0xf80000>;
91 };
92
93 partition@fd0000 {
94 label = "crash";
95 reg = <0xfd0000 0x10000>;
96 };
97
98 partition@fe0000 {
99 label = "reserved";
100 reg = <0xfe0000 0x10000>;
101 read-only;
102 };
103
104 partition@ff0000 {
105 label = "Bdata";
106 reg = <0xff0000 0x10000>;
107 };
108 };
109 };
110 };
111
112 &ehci {
113 status = "okay";
114 };
115
116 &ohci {
117 status = "okay";
118 };
119
120 &ethernet {
121 pinctrl-names = "default";
122 pinctrl-0 = <&ephy_pins>;
123
124 nvmem-cells = <&macaddr_factory_28>;
125 nvmem-cell-names = "mac-address";
126
127 mediatek,portmap = "llllw";
128 };
129
130 &wmac {
131 ralink,mtd-eeprom = <&factory 0x0>;
132 pinctrl-names = "default";
133 pinctrl-0 = <&pa_pins>;
134 };
135
136 &pcie {
137 status = "okay";
138 };
139
140 &pcie0 {
141 mt76@0,0 {
142 reg = <0x0000 0 0 0 0>;
143 mediatek,mtd-eeprom = <&factory 0x8000>;
144 ieee80211-freq-limit = <5000000 6000000>;
145 };
146 };
147
148 &state_default {
149 gpio {
150 groups = "i2c", "rgmii1";
151 function = "gpio";
152 };
153 };
154
155 &factory {
156 compatible = "nvmem-cells";
157 #address-cells = <1>;
158 #size-cells = <1>;
159
160 macaddr_factory_28: macaddr@28 {
161 reg = <0x28 0x6>;
162 };
163 };