ramips: clean and improve MAC address setup in 02_network
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_dlink_dir-510l.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7620a.dtsi"
5
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/gpio/gpio.h>
8
9 / {
10         compatible = "dlink,dir-510l", "ralink,mt7620a-soc";
11         model = "D-Link DIR-510L";
12
13         aliases {
14                 led-boot = &led_status;
15                 led-failsafe = &led_status;
16                 led-running = &led_status;
17                 led-upgrade = &led_status;
18         };
19
20         chosen {
21                 bootargs = "console=ttyS1,57600";
22         };
23
24         keys {
25                 compatible = "gpio-keys-polled";
26                 poll-interval = <20>;
27
28                 reset {
29                         label = "reset";
30                         gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
31                         linux,code = <KEY_RESTART>;
32                 };
33
34                 wps {
35                         label = "wps";
36                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
37                         linux,code = <KEY_WPS_BUTTON>;
38                 };
39         };
40
41         leds {
42                 compatible = "gpio-leds";
43
44                 led_status: status {
45                         label = "dir-510l:green:status";
46                         gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
47                 };
48
49                 status-red {
50                         label = "dir-510l:red:status";
51                         gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
52                 };
53
54         };
55 };
56
57 &ethernet {
58         mediatek,portmap = "llllw";
59 };
60
61 &uart {
62         status = "okay";
63 };
64
65 &gpio0 {
66         status = "okay";
67 };
68
69 &spi0 {
70         status = "okay";
71
72         flash@0 {
73                 compatible = "jedec,spi-nor";
74                 reg = <0>;
75                 spi-max-frequency = <50000000>;
76
77                 partitions {
78                         compatible = "fixed-partitions";
79                         #address-cells = <1>;
80                         #size-cells = <1>;
81
82                         partition@0 {
83                                 label = "jboot";
84                                 reg = <0x0 0x10000>;
85                                 read-only;
86                         };
87
88                         partition@10000 {
89                                 label = "recovery";
90                                 reg = <0x10000 0x200000>;
91                                 read-only;
92                         };
93
94                         partition@210000 {
95                                 compatible = "amit,jimage";
96                                 label = "firmware";
97                                 reg = <0x210000 0xde0000>;
98                         };
99
100                         config: partition@ff0000 {
101                                 label = "config";
102                                 reg = <0xff0000 0x10000>;
103                                 read-only;
104                         };
105                 };
106         };
107 };
108
109 &ehci {
110         status = "okay";
111 };
112
113 &ohci {
114         status = "okay";
115 };
116
117 &pcie {
118         status = "okay";
119 };
120
121 &pcie0 {
122         mt76x0e@0,0 {
123                 reg = <0x0000 0 0 0 0>;
124                 mtd-mac-address = <&config 0xe490>;
125                 mtd-mac-address-increment = <(2)>;
126                 mediatek,mtd-eeprom = <&config 0xe05d>;
127         };
128 };
129
130 &gsw {
131         mediatek,port4 = "ephy";
132 };
133
134 &pinctrl {
135         state_default: pinctrl0 {
136                 default {
137                         ralink,group = "i2c", "uartf";
138                         ralink,function = "gpio";
139                 };
140         };
141 };
142