Skip to content

Commit f8c39b2

Browse files
committed
realtek: add support for XikeStor SKS7300-4X4T
The XikeStor SKS7300-4X4T is a 10GbE switch with 4x copper ports and 4x SFP slots. It has a built-in console port and is powered by a RTL9303 SoC. Specifications: --------------- * Soc: RTL9303 * Flash: 32 MiB SPI flash * RAM: 512 MiB * Ethernet: 8x 10/100/1000/2500/5000/10000 Mbps * Buttons: 1x Reset * UART: CISCO console ports on the front, 115200, 8n1 * controllable fan, integrated temperature sensor Not yet enabled: ---------------- * Fan control: it's controlled via simple i2c registers, but no driver has been written yet. Installation: ------------- This device uses an obfuscated bootloader and an obfuscated image. As such, the installation can only be performed using the console ports. 1. Set the switch to boot from the first image. 2. Attach console cable and hold Ctrl+C while powering on the switch 3. After a few seconds, a very basic U-Boot menu appears. Wait for the user input to appear, then press "z" to get to the message "Please input auth code". 4. Type "jiangks" as the password, the RTL9300 prompt appears. 5. Load the OpenWrt initramfs image via TFTP: > setenv serverip 192.168.0.1 > setenv ipaddr 192.168.0.2 > tftpboot 0x83000000 openwrt.bin > bootm 0x83000000 6. Once OpenWrt has booted, use the "sysupgrade" image to perform the actual installation. 7. Reboot the switch and enjoy OpenWrt. Recovery/return to stock: ------------------------- Flash an OEM firmware upgrade file via sysupgrade. Signed-off-by: Andreas Böhler <dev@aboehler.at>
1 parent d8ec6a0 commit f8c39b2

2 files changed

Lines changed: 317 additions & 0 deletions

File tree

Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
#include "rtl930x.dtsi"
4+
5+
#include <dt-bindings/input/input.h>
6+
#include <dt-bindings/gpio/gpio.h>
7+
8+
/ {
9+
compatible = "xikestor,sks7300-4x4t", "realtek,rtl9303-soc";
10+
model = "XikeStor SKS7300-4X4T";
11+
12+
aliases {
13+
label-mac-device = &ethernet0;
14+
led-boot = &led_sys;
15+
led-failsafe = &led_sys;
16+
led-running = &led_sys;
17+
led-upgrade = &led_sys;
18+
};
19+
20+
memory@0 {
21+
device_type = "memory";
22+
reg = <0x00000000 0x10000000>, /* first 256 MiB */
23+
<0x20000000 0x10000000>; /* remaining 256 MiB */
24+
};
25+
26+
chosen {
27+
stdout-path = "serial0:115200n8";
28+
/* Silencing the kernel is required since otherwise the watchdog
29+
would time out! */
30+
bootargs = "quiet";
31+
};
32+
33+
watchdog {
34+
compatible = "linux,wdt-gpio";
35+
gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
36+
hw_algo = "toggle";
37+
hw_margin_ms = <1200>;
38+
always-running;
39+
};
40+
41+
keys {
42+
compatible = "gpio-keys";
43+
44+
button-reset {
45+
label = "reset";
46+
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
47+
linux,code = <KEY_RESTART>;
48+
};
49+
};
50+
51+
leds {
52+
compatible = "gpio-leds";
53+
54+
pinctrl-names = "default";
55+
pinctrl-0 = <&pinmux_enable_led_sync>, <&pinmux_disable_sys_led>;
56+
57+
led_sys: led-0 {
58+
label = "green:system";
59+
gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
60+
linux,default-trigger = "heartbeat";
61+
};
62+
};
63+
64+
led_set {
65+
compatible = "realtek,rtl9300-leds";
66+
active-low;
67+
68+
/* [Amber] [Green] */
69+
led_set0 = <(RTL93XX_LED_SET_5G | RTL93XX_LED_SET_2P5G | RTL93XX_LED_SET_1G |
70+
RTL93XX_LED_SET_100M | RTL93XX_LED_SET_10M | RTL93XX_LED_SET_LINK |
71+
RTL93XX_LED_SET_ACT)
72+
(RTL93XX_LED_SET_10G | RTL93XX_LED_SET_LINK | RTL93XX_LED_SET_ACT)>;
73+
};
74+
75+
i2c_gpio {
76+
compatible = "i2c-gpio";
77+
#address-cells = <1>;
78+
#size-cells = <0>;
79+
i2c-gpio,delay-us = <2>;
80+
scl-gpios = <&gpio0 9 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
81+
sda-gpios = <&gpio0 10 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
82+
83+
temperature_sensor: temperature-sensor@48 {
84+
compatible = "national,lm75";
85+
reg = <0x48>;
86+
#thermal-sensor-cells = <0>;
87+
};
88+
};
89+
90+
sfp0: sfp-p1 {
91+
compatible = "sff,sfp";
92+
i2c-bus = <&i2c2>;
93+
los-gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
94+
mod-def0-gpio = <&gpio1 1 GPIO_ACTIVE_LOW>;
95+
tx-disable-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
96+
maximum-power-milliwatt = <1500>;
97+
#thermal-sensor-cells = <0>;
98+
};
99+
100+
sfp1: sfp-p2 {
101+
compatible = "sff,sfp";
102+
i2c-bus = <&i2c3>;
103+
los-gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
104+
mod-def0-gpio = <&gpio1 4 GPIO_ACTIVE_LOW>;
105+
tx-disable-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
106+
maximum-power-milliwatt = <1500>;
107+
#thermal-sensor-cells = <0>;
108+
};
109+
110+
sfp2: sfp-p3 {
111+
compatible = "sff,sfp";
112+
i2c-bus = <&i2c4>;
113+
los-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
114+
mod-def0-gpio = <&gpio1 7 GPIO_ACTIVE_LOW>;
115+
tx-disable-gpio = <&gpio1 6 GPIO_ACTIVE_HIGH>;
116+
maximum-power-milliwatt = <1500>;
117+
#thermal-sensor-cells = <0>;
118+
};
119+
120+
sfp3: sfp-p4 {
121+
compatible = "sff,sfp";
122+
i2c-bus = <&i2c6>;
123+
los-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
124+
mod-def0-gpio = <&gpio1 10 GPIO_ACTIVE_LOW>;
125+
tx-disable-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
126+
maximum-power-milliwatt = <1500>;
127+
#thermal-sensor-cells = <0>;
128+
};
129+
};
130+
131+
&i2c_mst1 {
132+
status = "okay";
133+
134+
i2c2: i2c@2 {
135+
reg = <2>;
136+
};
137+
i2c3: i2c@3 {
138+
reg = <3>;
139+
};
140+
i2c4: i2c@4 {
141+
reg = <4>;
142+
};
143+
i2c6: i2c@6 {
144+
reg = <6>;
145+
};
146+
};
147+
148+
&mdio_aux {
149+
status = "okay";
150+
151+
gpio1: gpio@0 {
152+
compatible = "realtek,rtl8231";
153+
reg = <0>;
154+
155+
gpio-controller;
156+
#gpio-cells = <2>;
157+
gpio-ranges = <&gpio1 0 0 37>;
158+
159+
led-controller {
160+
compatible = "realtek,rtl8231-leds";
161+
status = "disabled";
162+
};
163+
};
164+
};
165+
166+
&spi0 {
167+
status = "okay";
168+
169+
flash@0 {
170+
compatible = "jedec,spi-nor";
171+
reg = <0>;
172+
spi-max-frequency = <10000000>;
173+
174+
partitions {
175+
compatible = "fixed-partitions";
176+
#address-cells = <1>;
177+
#size-cells = <1>;
178+
179+
partition@0 {
180+
label = "u-boot";
181+
reg = <0x0 0x0a0000>;
182+
read-only;
183+
};
184+
185+
partition@0a0000 {
186+
label = "u-boot-env";
187+
reg = <0x0a0000 0x10000>;
188+
189+
nvmem-layout {
190+
compatible = "u-boot,env";
191+
192+
macaddr_ubootenv_ethaddr: ethaddr {
193+
#nvmem-cell-cells = <1>;
194+
};
195+
};
196+
};
197+
198+
partition@1b0000 {
199+
label = "reserve";
200+
reg = <0x1b0000 0x80000>;
201+
read-only;
202+
};
203+
204+
partition@130000 {
205+
label = "config";
206+
reg = <0x130000 0x350000>;
207+
read-only;
208+
};
209+
210+
partition@480000 {
211+
label = "firmware";
212+
reg = <0x480000 0x01b80000>;
213+
214+
compatible = "fixed-partitions";
215+
#address-cells = <1>;
216+
#size-cells = <1>;
217+
218+
partition@0 {
219+
label = "kernel";
220+
reg = <0x0 0x800000>;
221+
};
222+
223+
partition@800000 {
224+
label = "rootfs";
225+
reg = <0x800000 0x1380000>;
226+
};
227+
};
228+
};
229+
};
230+
};
231+
232+
&ethernet0 {
233+
nvmem-cells = <&macaddr_ubootenv_ethaddr 0>;
234+
nvmem-cell-names = "mac-address";
235+
};
236+
237+
&mdio_bus0 {
238+
PHY_C45(24, 0)
239+
};
240+
241+
&mdio_bus1 {
242+
PHY_C45(25, 0)
243+
};
244+
245+
&mdio_bus2 {
246+
PHY_C45(26, 0)
247+
PHY_C45(27, 1)
248+
};
249+
250+
&switch0 {
251+
ethernet-ports {
252+
#address-cells = <1>;
253+
#size-cells = <0>;
254+
255+
SWITCH_PORT_SFP(0, 1, 2, 0, 0)
256+
SWITCH_PORT_SFP(8, 2, 3, 0, 1)
257+
SWITCH_PORT_SFP(16, 3, 4, 0, 2)
258+
SWITCH_PORT_SFP(20, 4, 5, 0, 3)
259+
260+
SWITCH_PORT_SDS(24, 8, 6, usxgmii)
261+
SWITCH_PORT_SDS(25, 7, 7, usxgmii)
262+
SWITCH_PORT_SDS(26, 6, 8, usxgmii)
263+
SWITCH_PORT_SDS(27, 5, 9, usxgmii)
264+
265+
port@28 {
266+
ethernet = <&ethernet0>;
267+
reg = <28>;
268+
phy-mode = "internal";
269+
fixed-link {
270+
speed = <1000>;
271+
full-duplex;
272+
};
273+
};
274+
};
275+
};
276+
277+
278+
&thermal_zones {
279+
sys-thermal {
280+
polling-delay-passive = <1000>;
281+
polling-delay = <1000>;
282+
thermal-sensors = <&temperature_sensor>;
283+
trips {
284+
sys-crit {
285+
temperature = <70000>;
286+
hysteresis = <2000>;
287+
type = "critical";
288+
};
289+
};
290+
};
291+
};

target/linux/realtek/image/rtl930x.mk

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,32 @@ define Device/vimin_vm-s100-0800ms
9494
endef
9595
TARGET_DEVICES += vimin_vm-s100-0800ms
9696

97+
define Device/xikestor_sks7300-4x4t
98+
SOC := rtl9303
99+
DEVICE_VENDOR := XikeStor
100+
DEVICE_MODEL := SKS7300-4X4T
101+
DEVICE_PACKAGES := kmod-hwmon-lm75
102+
IMAGE_SIZE := 28160k
103+
KERNEL := \
104+
kernel-bin | \
105+
append-dtb | \
106+
lzma
107+
KERNEL_INITRAMFS := \
108+
kernel-bin | \
109+
append-dtb | \
110+
lzma |\
111+
xikestor-sks7300-img
112+
IMAGE/sysupgrade.bin := \
113+
append-kernel | \
114+
xikestor-sks7300-img | \
115+
pad-to 8192k | \
116+
append-rootfs | \
117+
pad-rootfs | \
118+
check-size | \
119+
append-metadata
120+
endef
121+
TARGET_DEVICES += xikestor_sks7300-4x4t
122+
97123
define Device/xikestor_sks8300-8t
98124
SOC := rtl9303
99125
UIMAGE_MAGIC := 0x93000000

0 commit comments

Comments
 (0)