ramips: clean and improve MAC address setup in 02_network
[oweals/openwrt.git] / target / linux / ramips / dts / mt7621_mikrotik_rbm11g.dts
1 /dts-v1/;
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9         compatible = "mikrotik,rbm11g", "mediatek,mt7621-soc";
10         model = "MikroTik RouterBOARD M11G";
11
12         aliases {
13                 led-boot = &led_usr;
14                 led-failsafe = &led_usr;
15                 led-running = &led_usr;
16                 led-upgrade = &led_usr;
17         };
18
19         chosen {
20                 bootargs = "console=ttyS0,115200";
21         };
22
23         leds {
24                 compatible = "gpio-leds";
25
26                 led_usr: usr {
27                         label = "rbm11g:green:usr";
28                         gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
29                 };
30
31                 rssi0 {
32                         label = "rbm11g:green:rssi0";
33                         gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
34                 };
35
36                 rssi1 {
37                         label = "rbm11g:green:rssi1";
38                         gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
39                 };
40
41                 rssi2 {
42                         label = "rbm11g:green:rssi2";
43                         gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
44                 };
45
46                 rssi3 {
47                         label = "rbm11g:green:rssi3";
48                         gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
49                 };
50
51                 rssi4 {
52                         label = "rbm11g:green:rssi4";
53                         gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
54                 };
55         };
56
57         keys {
58                 compatible = "gpio-keys-polled";
59                 poll-interval = <20>;
60                 res {
61                         label = "reset";
62                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
63                         linux,code = <KEY_RESTART>;
64                 };
65         };
66
67         pcie0_vcc_reg {
68                 compatible = "regulator-fixed";
69                 regulator-name = "pcie0_vcc";
70
71                 regulator-min-microvolt = <3300000>;
72                 regulator-max-microvolt = <3300000>;
73                 gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
74                 enable-active-high;
75                 regulator-boot-on;
76                 regulator-always-on;
77         };
78 };
79
80
81 &spi0 {
82         status = "okay";
83
84         w25q128@0 {
85                 compatible = "jedec,spi-nor";
86                 reg = <0>;
87                 // XXX empiric value to obtain actual 10MHz SCK at the chip
88                 spi-max-frequency = <3125000>;
89
90                 partitions {
91                         compatible = "fixed-partitions";
92                         #address-cells = <1>;
93                         #size-cells = <1>;
94
95                         partition@0 {
96                                 label = "RouterBoot";
97                                 reg = <0x0 0x40000>;
98                                 read-only;
99                                 compatible = "fixed-partitions";
100                                 #address-cells = <1>;
101                                 #size-cells = <1>;
102
103                                 partition@0 {
104                                         label = "bootloader1";
105                                         reg = <0x0 0xf000>;
106                                         read-only;
107                                 };
108
109                                 hard_config: partition@f000 {
110                                         label = "hard_config";
111                                         reg = <0xf000 0x1000>;
112                                         read-only;
113                                 };
114
115                                 partition@10000 {
116                                         label = "bootloader2";
117                                         reg = <0x10000 0xf000>;
118                                         read-only;
119                                 };
120
121                                 partition@20000 {
122                                         label = "soft_config";
123                                         reg = <0x20000 0x1000>;
124                                 };
125
126                                 partition@30000 {
127                                         label = "bios";
128                                         reg = <0x30000 0x1000>;
129                                         read-only;
130                                 };
131                         };
132
133                         partition@40000 {
134                                 compatible = "mikrotik,minor";
135                                 label = "firmware";
136                                 reg = <0x040000 0xFC0000>;
137                         };
138                 };
139         };
140 };
141
142 &ethernet {
143         mtd-mac-address = <&hard_config 0x0010>;
144         mtd-mac-address-increment = <1>;
145 };
146
147
148 &pinctrl {
149         state_default: pinctrl0 {
150                 gpio {
151                         ralink,group = "uart2", "wdt", "rgmii2";
152                         ralink,function = "gpio";
153                 };
154         };
155 };
156
157 &i2c {
158         status = "okay";
159 };
160
161 &pcie {
162         status = "okay";
163 };