e727a9405ad75b966f2c9fe0e1167e774499033d
[openwrt/staging/hauke.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 compatible = "nvmem-cells";
118 label = "para";
119 reg = <0x1f00000 0x100000>;
120 #address-cells = <1>;
121 #size-cells = <1>;
122 read-only;
123
124 factory_macaddr: macaddr@fdff4 {
125 reg = <0xfdff4 0x6>;
126 };
127 };
128 };
129 };
130 };
131
132 &ethernet0 {
133 nvmem-cells = <&factory_macaddr>;
134 nvmem-cell-names = "mac-address";
135
136 mdio: mdio-bus {
137 compatible = "realtek,rtl838x-mdio";
138 #address-cells = <1>;
139 #size-cells = <0>;
140
141 INTERNAL_PHY(8)
142 INTERNAL_PHY(9)
143 INTERNAL_PHY(10)
144 INTERNAL_PHY(11)
145 INTERNAL_PHY(12)
146 INTERNAL_PHY(13)
147 INTERNAL_PHY(14)
148 INTERNAL_PHY(15)
149
150 INTERNAL_PHY(24)
151 INTERNAL_PHY(26)
152 };
153 };
154
155 &switch0 {
156 ports {
157 #address-cells = <1>;
158 #size-cells = <0>;
159
160 SWITCH_PORT(15, 1, internal)
161 SWITCH_PORT(14, 2, internal)
162 SWITCH_PORT(13, 3, internal)
163 SWITCH_PORT(12, 4, internal)
164 SWITCH_PORT(11, 5, internal)
165 SWITCH_PORT(10, 6, internal)
166 SWITCH_PORT(9, 7, internal)
167 SWITCH_PORT(8, 8, internal)
168
169 SWITCH_SFP_PORT(24, 9, 1000base-x)
170 SWITCH_SFP_PORT(26, 10, 1000base-x)
171
172 port@28 {
173 ethernet = <&ethernet0>;
174 reg = <28>;
175 phy-mode = "internal";
176
177 fixed-link {
178 speed = <1000>;
179 full-duplex;
180 };
181 };
182 };
183 };