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