ramips: convert mt76 PCIe NIC EEPROM to NVMEM format for legacy SoCs
[openwrt/staging/xback.git] / target / linux / ramips / dts / mt7620a_dlink_dir-510l.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/mtd/partitions/uimage.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";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 wps {
34 label = "wps";
35 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_status: status {
44 label = "green:status";
45 gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
46 };
47
48 status-red {
49 label = "red:status";
50 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
51 };
52 };
53 };
54
55 &ethernet {
56 mediatek,portmap = "llllw";
57 };
58
59 &uart {
60 status = "okay";
61 };
62
63 &spi0 {
64 status = "okay";
65
66 flash@0 {
67 compatible = "jedec,spi-nor";
68 reg = <0>;
69 spi-max-frequency = <50000000>;
70
71 partitions {
72 compatible = "fixed-partitions";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 partition@0 {
77 label = "jboot";
78 reg = <0x0 0x10000>;
79 read-only;
80 };
81
82 partition@10000 {
83 label = "recovery";
84 reg = <0x10000 0x200000>;
85 read-only;
86 };
87
88 partition@210000 {
89 compatible = "openwrt,uimage", "denx,uimage";
90 openwrt,ih-magic = <IH_MAGIC_OKLI>;
91 openwrt,offset = <0x10000>;
92 label = "firmware";
93 reg = <0x210000 0xde0000>;
94 };
95
96 config: partition@ff0000 {
97 compatible = "nvmem-cells";
98 label = "config";
99 reg = <0xff0000 0x10000>;
100 #address-cells = <1>;
101 #size-cells = <1>;
102 read-only;
103
104 eeprom_config_e05d: eeprom@e05d {
105 reg = <0xe05d 0x200>;
106 };
107
108 macaddr_config_e490: macaddr@e490 {
109 reg = <0xe490 0x6>;
110 };
111 };
112 };
113 };
114 };
115
116 &ehci {
117 status = "okay";
118 };
119
120 &ohci {
121 status = "okay";
122 };
123
124 &pcie {
125 status = "okay";
126 };
127
128 &pcie0 {
129 mt76x0e@0,0 {
130 reg = <0x0000 0 0 0 0>;
131 nvmem-cells = <&eeprom_config_e05d>, <&macaddr_config_e490>;
132 nvmem-cell-names = "eeprom", "mac-address";
133 mac-address-increment = <(2)>;
134 };
135 };
136
137 &state_default {
138 default {
139 groups = "i2c", "uartf";
140 function = "gpio";
141 };
142 };