realtek: convert to nvmem-layout
[openwrt/staging/jow.git] / target / linux / realtek / dts-5.15 / 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_20: tps23861@20 {
55 compatible = "ti,tps23861";
56 reg = <0x20>;
57 shunt-resistor-micro-ohms = <255000>;
58 };
59
60 tps23861_28: tps23861@28 {
61 compatible = "ti,tps23861";
62 reg = <0x28>;
63 shunt-resistor-micro-ohms = <255000>;
64 };
65 };
66
67 watchdog {
68 compatible = "linux,wdt-gpio";
69 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
70 hw_algo = "toggle";
71 /* SGM706 specs: typical 1.6s, but minimum 1.0s. */
72 hw_margin_ms = <1000>;
73 };
74 };
75
76 &gpio0 {
77 watchdog-enable {
78 gpio-hog;
79 gpios = <14 GPIO_ACTIVE_LOW>;
80 output-low;
81 line-name = "watchdog-enable";
82 };
83 };
84
85 &spi0 {
86 status = "okay";
87
88 flash@0 {
89 compatible = "jedec,spi-nor";
90 reg = <0>;
91 spi-max-frequency = <10000000>;
92
93 partitions {
94 compatible = "fixed-partitions";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 partition@0 {
99 label = "u-boot";
100 reg = <0x0 0xe0000>;
101 read-only;
102 };
103 partition@e0000 {
104 label = "u-boot-env";
105 reg = <0xe0000 0x20000>;
106 };
107 partition@100000 {
108 compatible = "denx,uimage";
109 label = "firmware";
110 reg = <0x100000 0x1a00000>;
111 };
112 partition@1b00000 {
113 label = "usrappfs";
114 reg = <0x1b00000 0x400000>;
115 };
116 partition@1f00000 {
117 label = "para";
118 reg = <0x1f00000 0x100000>;
119 read-only;
120
121 nvmem-layout {
122 compatible = "fixed-layout";
123 #address-cells = <1>;
124 #size-cells = <1>;
125
126 factory_macaddr: macaddr@fdff4 {
127 reg = <0xfdff4 0x6>;
128 };
129 };
130 };
131 };
132 };
133 };
134
135 &ethernet0 {
136 nvmem-cells = <&factory_macaddr>;
137 nvmem-cell-names = "mac-address";
138
139 mdio: mdio-bus {
140 compatible = "realtek,rtl838x-mdio";
141 #address-cells = <1>;
142 #size-cells = <0>;
143
144 INTERNAL_PHY(8)
145 INTERNAL_PHY(9)
146 INTERNAL_PHY(10)
147 INTERNAL_PHY(11)
148 INTERNAL_PHY(12)
149 INTERNAL_PHY(13)
150 INTERNAL_PHY(14)
151 INTERNAL_PHY(15)
152
153 INTERNAL_PHY(24)
154 INTERNAL_PHY(26)
155 };
156 };
157
158 &switch0 {
159 ports {
160 #address-cells = <1>;
161 #size-cells = <0>;
162
163 SWITCH_PORT(15, 1, internal)
164 SWITCH_PORT(14, 2, internal)
165 SWITCH_PORT(13, 3, internal)
166 SWITCH_PORT(12, 4, internal)
167 SWITCH_PORT(11, 5, internal)
168 SWITCH_PORT(10, 6, internal)
169 SWITCH_PORT(9, 7, internal)
170 SWITCH_PORT(8, 8, internal)
171
172 SWITCH_SFP_PORT(24, 9, 1000base-x)
173 SWITCH_SFP_PORT(26, 10, 1000base-x)
174
175 port@28 {
176 ethernet = <&ethernet0>;
177 reg = <28>;
178 phy-mode = "internal";
179
180 fixed-link {
181 speed = <1000>;
182 full-duplex;
183 };
184 };
185 };
186 };