ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / rt3052_buffalo_whr-g300n.dts
1 #include "rt3050.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "buffalo,whr-g300n", "ralink,rt3052-soc";
8 model = "Buffalo WHR-G300N";
9
10 aliases {
11 led-boot = &led_diag;
12 led-failsafe = &led_diag;
13 led-upgrade = &led_diag;
14 };
15
16 flash@1f000000 {
17 compatible = "cfi-flash";
18 reg = <0x1f000000 0x800000>;
19 bank-width = <2>;
20 device-width = <2>;
21
22 partitions {
23 compatible = "fixed-partitions";
24 #address-cells = <1>;
25 #size-cells = <1>;
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0 0x30000>;
30 read-only;
31 };
32
33 partition@30000 {
34 label = "u-boot-env";
35 reg = <0x30000 0x10000>;
36 read-only;
37 };
38
39 factory: partition@40000 {
40 label = "factory";
41 reg = <0x40000 0x10000>;
42 read-only;
43 };
44
45 partition@50000 {
46 compatible = "denx,uimage";
47 label = "firmware";
48 reg = <0x50000 0x3a0000>;
49 };
50
51 partition@3f0000 {
52 label = "user";
53 reg = <0x3f0000 0x10000>;
54 read-only;
55 };
56 };
57 };
58
59 leds {
60 compatible = "gpio-leds";
61
62 led_diag: diag {
63 label = "red:diag";
64 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
65 };
66
67 router {
68 label = "green:router";
69 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
70 };
71
72 security {
73 label = "amber:security";
74 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
75 };
76 };
77
78 keys {
79 compatible = "gpio-keys-polled";
80 poll-interval = <20>;
81
82 reset {
83 label = "reset";
84 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
85 linux,code = <KEY_RESTART>;
86 };
87
88 aoss {
89 label = "aoss";
90 gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
91 linux,code = <KEY_WPS_BUTTON>;
92 };
93
94 router-off {
95 label = "router-off";
96 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
97 linux,code = <BTN_2>;
98 };
99
100 router-on {
101 label = "router-on";
102 gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
103 linux,code = <BTN_3>;
104 };
105 };
106 };
107
108 &state_default {
109 gpio {
110 groups = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
111 function = "gpio";
112 };
113 };
114
115 &ethernet {
116 nvmem-cells = <&macaddr_factory_4>;
117 nvmem-cell-names = "mac-address";
118 };
119
120 &esw {
121 mediatek,portmap = <0x2f>;
122 };
123
124 &wmac {
125 ralink,mtd-eeprom = <&factory 0x0>;
126 };
127
128 &factory {
129 compatible = "nvmem-cells";
130 #address-cells = <1>;
131 #size-cells = <1>;
132
133 macaddr_factory_4: macaddr@4 {
134 reg = <0x4 0x6>;
135 };
136 };