ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7620a_dlink_dch-m225.dts
1 #include "mt7620a.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "dlink,dch-m225", "ralink,mt7620a-soc";
8 model = "D-Link DCH-M225";
9
10 aliases {
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 wps {
21 label = "wps";
22 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
23 linux,code = <KEY_RFKILL>;
24 };
25
26 reset {
27 label = "reset";
28 gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_RESTART>;
30 };
31 };
32
33 leds {
34 compatible = "gpio-leds";
35
36 led_power: power {
37 label = "green:power";
38 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
39 default-state = "on";
40 };
41
42 status {
43 label = "red:status";
44 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
45 };
46 };
47
48 sound {
49 compatible = "simple-audio-card";
50 simple-audio-card,name = "Audio-I2S";
51 simple-audio-card,format = "i2s";
52 simple-audio-card,bitclock-master = <&dailink0_master>;
53 simple-audio-card,frame-master = <&dailink0_master>;
54 simple-audio-card,widgets =
55 "Headphone", "Headphones";
56 simple-audio-card,routing =
57 "Headphones", "HP_L",
58 "Headphones", "HP_R";
59 simple-audio-card,mclk-fs = <256>;
60 simple-audio-card,hp-det-gpio = <&gpio0 14 GPIO_ACTIVE_LOW>;
61
62 simple-audio-card,cpu {
63 sound-dai = <&i2s>;
64 };
65
66 dailink0_master: simple-audio-card,codec {
67 sound-dai = <&codec>;
68 };
69 };
70 };
71
72 &gpio1 {
73 status = "okay";
74 };
75
76 &i2c {
77 status = "okay";
78
79 codec: wm8960@1a {
80 #sound-dai-cells = <0>;
81 compatible = "wlf,wm8960";
82 reg = <0x1a>;
83
84 wlf,shared-lrclk;
85 };
86 };
87
88 &i2s {
89 #sound-dai-cells = <0>;
90 status = "okay";
91 pinctrl-names = "default";
92 pinctrl-0 = <&mdio_refclk_pins>;
93 };
94
95 &spi0 {
96 status = "okay";
97
98 flash@0 {
99 compatible = "jedec,spi-nor";
100 reg = <0>;
101 spi-max-frequency = <80000000>;
102 m25p,fast-read;
103
104 partitions {
105 compatible = "fixed-partitions";
106 #address-cells = <1>;
107 #size-cells = <1>;
108
109 partition@0 {
110 label = "u-boot";
111 reg = <0x0 0x30000>;
112 read-only;
113 };
114
115 partition@30000 {
116 label = "u-boot-env";
117 reg = <0x30000 0x4000>;
118 read-only;
119 };
120
121 factory: partition@34000 {
122 compatible = "nvmem-cells";
123 label = "factory";
124 reg = <0x34000 0x4000>;
125 #address-cells = <1>;
126 #size-cells = <1>;
127 read-only;
128
129 eeprom_factory_0: eeprom@0 {
130 reg = <0x0 0x200>;
131 };
132
133 macaddr_factory_4: macaddr@4 {
134 reg = <0x4 0x6>;
135 };
136 };
137
138 nvram: partition@38000 {
139 label = "nvram";
140 reg = <0x38000 0x8000>;
141 read-only;
142 };
143
144 partition@40000 {
145 label = "devconf";
146 reg = <0x40000 0x10000>;
147 read-only;
148 };
149
150 partition@50000 {
151 label = "upgrade_rec";
152 reg = <0x50000 0x100000>;
153 read-only;
154 };
155
156 partition@150000 {
157 compatible = "seama";
158 label = "firmware";
159 reg = <0x150000 0x6b0000>;
160 };
161 };
162 };
163 };
164
165 &gdma {
166 status = "okay";
167 };
168
169 &state_default {
170 gpio {
171 groups = "wdt", "rgmii1";
172 function = "gpio";
173 };
174
175 gpio_i2s {
176 groups = "uartf";
177 function = "gpio i2s";
178 };
179 };
180
181 &ethernet {
182 nvmem-cells = <&macaddr_factory_4>;
183 nvmem-cell-names = "mac-address";
184 };
185
186 &wmac {
187 pinctrl-names = "default", "pa_gpio";
188 pinctrl-0 = <&pa_pins>;
189 pinctrl-1 = <&pa_gpio_pins>;
190 nvmem-cells = <&eeprom_factory_0>;
191 nvmem-cell-names = "eeprom";
192 };