ramips: mt7620a: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7620a_lava_lr-25g001.dts
1 #include "mt7620a.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/mtd/partitions/uimage.h>
6
7 / {
8 compatible = "lava,lr-25g001", "ralink,mt7620a-soc";
9 model = "LAVA LR-25G001";
10
11 aliases {
12 led-boot = &led_status;
13 led-failsafe = &led_status;
14 led-running = &led_status;
15 led-upgrade = &led_status;
16 };
17
18 keys {
19 compatible = "gpio-keys";
20
21 wps {
22 label = "wps";
23 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
24 linux,code = <KEY_WPS_BUTTON>;
25 };
26
27 reset {
28 label = "reset";
29 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32 };
33
34 leds {
35 compatible = "gpio-leds";
36
37 led_status: status {
38 label = "green:status";
39 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
40 };
41
42 wifi2g {
43 label = "green:wifi2g";
44 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
45 linux,default-trigger = "phy1tpt";
46 };
47
48 wifi5g {
49 label = "green:wifi5g";
50 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
51 linux,default-trigger = "phy0tpt";
52 };
53 };
54
55 gpio_export {
56 compatible = "gpio-export";
57 #size-cells = <0>;
58
59 usbpower {
60 gpio-export,name = "usbpower";
61 gpio-export,output = <1>;
62 gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
63 };
64 };
65 };
66
67 &spi0 {
68 status = "okay";
69
70 flash@0 {
71 compatible = "jedec,spi-nor";
72 reg = <0>;
73 spi-max-frequency = <10000000>;
74
75 partitions {
76 compatible = "fixed-partitions";
77 #address-cells = <1>;
78 #size-cells = <1>;
79
80 partition@0 {
81 label = "jboot";
82 reg = <0x0 0x10000>;
83 read-only;
84 };
85
86 partition@10000 {
87 compatible = "openwrt,uimage", "denx,uimage";
88 openwrt,ih-magic = <IH_MAGIC_OKLI>;
89 openwrt,offset = <0x10000>;
90 label = "firmware";
91 reg = <0x10000 0xfe0000>;
92 };
93
94 config: partition@ff0000 {
95 label = "config";
96 reg = <0xff0000 0x10000>;
97 read-only;
98
99 nvmem-layout {
100 compatible = "fixed-layout";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 eeprom_config_e08a: eeprom@e08a {
105 reg = <0xe08a 0x200>;
106 };
107
108 macaddr_config_e07e: macaddr@e07e {
109 reg = <0xe07e 0x6>;
110 };
111 };
112 };
113 };
114 };
115 };
116
117 &ehci {
118 status = "okay";
119 };
120
121 &ohci {
122 status = "okay";
123 };
124
125 &ethernet {
126 pinctrl-names = "default";
127 pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
128
129 port@5 {
130 status = "okay";
131 phy-mode = "rgmii";
132 mediatek,fixed-link = <1000 1 1 1>;
133 };
134
135 mdio-bus {
136 status = "okay";
137
138 ethernet-phy@0 {
139 reg = <0>;
140 phy-mode = "rgmii";
141 qca,ar8327-initvals = <
142 0x04 0x87300000 /* PORT0 PAD MODE CTRL */
143 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
144 0x7c 0x0000007e /* PORT0_STATUS */
145 0x80 0x00001200 /* PORT1_STATUS */
146 0x84 0x00001200 /* PORT2_STATUS */
147 0x88 0x00001200 /* PORT3_STATUS */
148 0x8c 0x00001200 /* PORT4_STATUS */
149 0x90 0x00001200 /* PORT5_STATUS */
150 0x94 0x00000000 /* PORT6_STATUS */
151 >;
152 };
153 };
154 };
155
156 &gsw {
157 mediatek,ephy-base = /bits/ 8 <8>;
158 };
159
160 &pcie {
161 status = "okay";
162 };
163
164 &pcie0 {
165 mt76x0e@0,0 {
166 reg = <0x0000 0 0 0 0>;
167 nvmem-cells = <&eeprom_config_e08a>, <&macaddr_config_e07e>;
168 nvmem-cell-names = "eeprom", "mac-address";
169 mac-address-increment = <2>;
170 };
171 };
172
173 &state_default {
174 gpio {
175 groups = "uartf", "i2c";
176 function = "gpio";
177 };
178 };