realtek: tl-sg2xxx: read MAC address from nvmem-cells
[openwrt/openwrt.git] / target / linux / realtek / dts-5.10 / rtl8380_tplink_sg2xxx.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #include "rtl838x.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9 aliases {
10 led-boot = &led_power;
11 led-failsafe = &led_power;
12 led-running = &led_power;
13 led-upgrade = &led_power;
14 label-mac-device = &ethernet0;
15 };
16
17 memory@0 {
18 device_type = "memory";
19 reg = <0x0 0x10000000>;
20 };
21
22 keys {
23 compatible = "gpio-keys";
24
25 reset {
26 label = "reset";
27 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_RESTART>;
29 };
30 };
31
32 gpio-restart {
33 compatible = "gpio-restart";
34 gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 led_power: led-0 {
41 label = "green:power";
42 gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
43 };
44 };
45
46 i2c1: i2c-gpio-1 {
47 compatible = "i2c-gpio";
48 scl-gpios = <&gpio0 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
49 sda-gpios = <&gpio0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
50 i2c-gpio,delay-us = <2>;
51 #address-cells = <1>;
52 #size-cells = <0>;
53
54 tps23861@28 {
55 compatible = "ti,tps23861";
56 reg = <0x28>;
57 shunt-resistor-micro-ohms = <255000>;
58 };
59 };
60
61 watchdog {
62 compatible = "linux,wdt-gpio";
63 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
64 hw_algo = "toggle";
65 /* SGM706 specs: typical 1.6s, but minimum 1.0s. */
66 hw_margin_ms = <1000>;
67 };
68
69 virtual_flash {
70 compatible = "mtd-concat";
71
72 devices = <&syspart &usrpart>;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 compatible = "denx,uimage";
81 label = "firmware";
82 reg = <0x0 0x1a00000>;
83 };
84 };
85 };
86 };
87
88 &gpio0 {
89 watchdog-enable {
90 gpio-hog;
91 gpios = <14 GPIO_ACTIVE_LOW>;
92 output-low;
93 line-name = "watchdog-enable";
94 };
95 };
96
97 &spi0 {
98 status = "okay";
99
100 flash@0 {
101 compatible = "jedec,spi-nor";
102 reg = <0>;
103 spi-max-frequency = <10000000>;
104
105 partitions {
106 compatible = "fixed-partitions";
107 #address-cells = <1>;
108 #size-cells = <1>;
109
110 partition@0 {
111 label = "u-boot";
112 reg = <0x0 0xe0000>;
113 read-only;
114 };
115 partition@e0000 {
116 label = "u-boot-env";
117 reg = <0xe0000 0x20000>;
118 };
119 syspart: partition@100000 {
120 label = "sys";
121 reg = <0x100000 0x600000>;
122 };
123 usrpart: partition@700000 {
124 label = "usrimg1";
125 reg = <0x700000 0x1400000>;
126 };
127 partition@1b00000 {
128 label = "usrappfs";
129 reg = <0x1b00000 0x400000>;
130 };
131 partition@1f00000 {
132 compatible = "nvmem-cells";
133 label = "para";
134 reg = <0x1f00000 0x100000>;
135 #address-cells = <1>;
136 #size-cells = <1>;
137 read-only;
138
139 factory_macaddr: macaddr@fdff4 {
140 reg = <0xfdff4 0x6>;
141 };
142 };
143 };
144 };
145 };
146
147 &ethernet0 {
148 nvmem-cells = <&factory_macaddr>;
149 nvmem-cell-names = "mac-address";
150
151 mdio: mdio-bus {
152 compatible = "realtek,rtl838x-mdio";
153 #address-cells = <1>;
154 #size-cells = <0>;
155
156 INTERNAL_PHY(8)
157 INTERNAL_PHY(9)
158 INTERNAL_PHY(10)
159 INTERNAL_PHY(11)
160 INTERNAL_PHY(12)
161 INTERNAL_PHY(13)
162 INTERNAL_PHY(14)
163 INTERNAL_PHY(15)
164 };
165 };
166
167 &switch0 {
168 ports {
169 #address-cells = <1>;
170 #size-cells = <0>;
171
172 SWITCH_PORT(15, 1, internal)
173 SWITCH_PORT(14, 2, internal)
174 SWITCH_PORT(13, 3, internal)
175 SWITCH_PORT(12, 4, internal)
176 SWITCH_PORT(11, 5, internal)
177 SWITCH_PORT(10, 6, internal)
178 SWITCH_PORT(9, 7, internal)
179 SWITCH_PORT(8, 8, internal)
180
181 port@28 {
182 ethernet = <&ethernet0>;
183 reg = <28>;
184 phy-mode = "internal";
185
186 fixed-link {
187 speed = <1000>;
188 full-duplex;
189 };
190 };
191 };
192 };