8eb309d8a848bca94f6b6d390dde5d2531d39995
[openwrt/staging/ansuel.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
70 &gpio0 {
71 watchdog-enable {
72 gpio-hog;
73 gpios = <14 GPIO_ACTIVE_LOW>;
74 output-low;
75 line-name = "watchdog-enable";
76 };
77 };
78
79 &spi0 {
80 status = "okay";
81
82 flash@0 {
83 compatible = "jedec,spi-nor";
84 reg = <0>;
85 spi-max-frequency = <10000000>;
86
87 partitions {
88 compatible = "fixed-partitions";
89 #address-cells = <1>;
90 #size-cells = <1>;
91
92 partition@0 {
93 label = "u-boot";
94 reg = <0x0 0xe0000>;
95 read-only;
96 };
97 partition@e0000 {
98 label = "u-boot-env";
99 reg = <0xe0000 0x20000>;
100 };
101 partition@100000 {
102 compatible = "denx,uimage";
103 label = "firmware";
104 reg = <0x100000 0x1a00000>;
105 };
106 partition@1b00000 {
107 label = "usrappfs";
108 reg = <0x1b00000 0x400000>;
109 };
110 partition@1f00000 {
111 compatible = "nvmem-cells";
112 label = "para";
113 reg = <0x1f00000 0x100000>;
114 #address-cells = <1>;
115 #size-cells = <1>;
116 read-only;
117
118 factory_macaddr: macaddr@fdff4 {
119 reg = <0xfdff4 0x6>;
120 };
121 };
122 };
123 };
124 };
125
126 &ethernet0 {
127 nvmem-cells = <&factory_macaddr>;
128 nvmem-cell-names = "mac-address";
129
130 mdio: mdio-bus {
131 compatible = "realtek,rtl838x-mdio";
132 #address-cells = <1>;
133 #size-cells = <0>;
134
135 INTERNAL_PHY(8)
136 INTERNAL_PHY(9)
137 INTERNAL_PHY(10)
138 INTERNAL_PHY(11)
139 INTERNAL_PHY(12)
140 INTERNAL_PHY(13)
141 INTERNAL_PHY(14)
142 INTERNAL_PHY(15)
143 };
144 };
145
146 &switch0 {
147 ports {
148 #address-cells = <1>;
149 #size-cells = <0>;
150
151 SWITCH_PORT(15, 1, internal)
152 SWITCH_PORT(14, 2, internal)
153 SWITCH_PORT(13, 3, internal)
154 SWITCH_PORT(12, 4, internal)
155 SWITCH_PORT(11, 5, internal)
156 SWITCH_PORT(10, 6, internal)
157 SWITCH_PORT(9, 7, internal)
158 SWITCH_PORT(8, 8, internal)
159
160 port@28 {
161 ethernet = <&ethernet0>;
162 reg = <28>;
163 phy-mode = "internal";
164
165 fixed-link {
166 speed = <1000>;
167 full-duplex;
168 };
169 };
170 };
171 };