ramips: fix MTD EEPROM offset for TL-WR840N v5
[oweals/openwrt.git] / target / linux / ramips / dts / Newifi-D1.dts
1 /dts-v1/;
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "lenovo,newifi-d1", "mediatek,mt7621-soc";
10         model = "Newifi-D1";
11
12         aliases {
13                 led-boot = &led_blue;
14                 led-failsafe = &led_blue;
15                 led-running = &led_blue;
16                 led-upgrade = &led_blue;
17         };
18
19         memory@0 {
20                 device_type = "memory";
21                 reg = <0x0 0x10000000>;
22         };
23
24         chosen {
25                 bootargs = "console=ttyS0,115200";
26         };
27
28         gpio-leds {
29                 compatible = "gpio-leds";
30
31                 status-red {
32                         label = "newifi-d1:red:status";
33                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
34                         default-state = "off";
35                 };
36
37                 status-green {
38                         label = "newifi-d1:green:status";
39                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
40                         default-state = "off";
41                 };
42
43                 led_blue: status-blue {
44                         label = "newifi-d1:blue:status";
45                         gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
46                         default-state = "on";
47                 };
48         };
49
50         gpio-keys-polled {
51                 compatible = "gpio-keys-polled";
52                 poll-interval = <20>;
53
54                 reset {
55                         label = "reset";
56                         gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
57                         linux,code = <KEY_RESTART>;
58                 };
59         };
60
61         gpio_export {
62                 compatible = "gpio-export";
63                 #size-cells = <0>;
64
65                 usb2power {
66                         gpio-export,name = "usb2power";
67                         gpio-export,output = <1>;
68                         gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
69                 };
70
71                 usb3power {
72                         gpio-export,name = "usb3power";
73                         gpio-export,output = <1>;
74                         gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
75                 };
76         };
77 };
78
79 &sdhci {
80         status = "okay";
81 };
82
83 &spi0 {
84         status = "okay";
85
86         m25p80@0 {
87                 compatible = "jedec,spi-nor";
88                 reg = <0>;
89                 spi-max-frequency = <10000000>;
90                 m25p,chunked-io = <32>;
91
92                 partitions {
93                         compatible = "fixed-partitions";
94                         #address-cells = <1>;
95                         #size-cells = <1>;
96
97                         partition@0 {
98                                 label = "u-boot";
99                                 reg = <0x0 0x30000>;
100                                 read-only;
101                         };
102
103                         partition@30000 {
104                                 label = "u-boot-env";
105                                 reg = <0x30000 0x10000>;
106                                 read-only;
107                         };
108
109                         factory: partition@40000 {
110                                 label = "factory";
111                                 reg = <0x40000 0x10000>;
112                                 read-only;
113                         };
114
115                         partition@50000 {
116                                 label = "firmware";
117                                 reg = <0x50000 0x1fb0000>;
118                         };
119                 };
120         };
121 };
122
123 &pcie {
124         status = "okay";
125 };
126
127 &pcie0 {
128         mt76@0,0 {
129                 reg = <0x0000 0 0 0 0>;
130                 mediatek,mtd-eeprom = <&factory 0x8000>;
131                 ieee80211-freq-limit = <5000000 6000000>;
132         };
133 };
134
135 &pcie1 {
136         mt76@0,0 {
137                 reg = <0x0000 0 0 0 0>;
138                 mediatek,mtd-eeprom = <&factory 0x0000>;
139         };
140 };
141
142 &ethernet {
143         mtd-mac-address = <&factory 0xe000>;
144 };
145
146 &pinctrl {
147         state_default: pinctrl0 {
148                 gpio {
149                         ralink,group = "wdt", "rgmii2", "jtag", "uart2", "uart3", "i2c";
150                         ralink,function = "gpio";
151                 };
152         };
153 };