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>
Link: https://github.com/openwrt/openwrt/pull/23305
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Andreas Böhler 2026-05-11 21:24:16 +02:00 committed by Robert Marko
parent c0dccbfb82
commit 6ee3f80efb
3 changed files with 320 additions and 1 deletions

View File

@ -0,0 +1,292 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "rtl930x.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "xikestor,sks7300-4x4t", "realtek,rtl9303-soc";
model = "XikeStor SKS7300-4X4T";
aliases {
label-mac-device = &ethernet0;
led-boot = &led_sys;
led-failsafe = &led_sys;
led-running = &led_sys;
led-upgrade = &led_sys;
};
memory@0 {
device_type = "memory";
reg = <0x00000000 0x10000000>, /* first 256 MiB */
<0x20000000 0x10000000>; /* remaining 256 MiB */
};
chosen {
stdout-path = "serial0:115200n8";
/* Silencing the kernel is required since otherwise the watchdog
would time out! */
bootargs = "quiet";
};
watchdog {
compatible = "linux,wdt-gpio";
gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
hw_algo = "toggle";
hw_margin_ms = <1200>;
always-running;
};
keys {
compatible = "gpio-keys";
button-reset {
label = "reset";
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinmux_enable_led_sync>, <&pinmux_disable_sys_led>;
led_sys: led-0 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
};
};
led_set {
compatible = "realtek,rtl9300-leds";
active-low;
/* [Amber] [Green] */
led_set0 = <(RTL93XX_LED_SET_5G | RTL93XX_LED_SET_2P5G | RTL93XX_LED_SET_1G |
RTL93XX_LED_SET_100M | RTL93XX_LED_SET_10M | RTL93XX_LED_SET_LINK |
RTL93XX_LED_SET_ACT)
(RTL93XX_LED_SET_10G | RTL93XX_LED_SET_LINK | RTL93XX_LED_SET_ACT)>;
};
i2c_gpio {
compatible = "i2c-gpio";
#address-cells = <1>;
#size-cells = <0>;
i2c-gpio,delay-us = <2>;
scl-gpios = <&gpio0 9 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
sda-gpios = <&gpio0 10 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
temperature_sensor: temperature-sensor@48 {
compatible = "national,lm75";
reg = <0x48>;
#thermal-sensor-cells = <0>;
};
};
sfp0: sfp-p1 {
compatible = "sff,sfp";
i2c-bus = <&i2c2>;
los-gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
mod-def0-gpio = <&gpio1 1 GPIO_ACTIVE_LOW>;
tx-disable-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
maximum-power-milliwatt = <1500>;
#thermal-sensor-cells = <0>;
};
sfp1: sfp-p2 {
compatible = "sff,sfp";
i2c-bus = <&i2c3>;
los-gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
mod-def0-gpio = <&gpio1 4 GPIO_ACTIVE_LOW>;
tx-disable-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
maximum-power-milliwatt = <1500>;
#thermal-sensor-cells = <0>;
};
sfp2: sfp-p3 {
compatible = "sff,sfp";
i2c-bus = <&i2c4>;
los-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
mod-def0-gpio = <&gpio1 7 GPIO_ACTIVE_LOW>;
tx-disable-gpio = <&gpio1 6 GPIO_ACTIVE_HIGH>;
maximum-power-milliwatt = <1500>;
#thermal-sensor-cells = <0>;
};
sfp3: sfp-p4 {
compatible = "sff,sfp";
i2c-bus = <&i2c6>;
los-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
mod-def0-gpio = <&gpio1 10 GPIO_ACTIVE_LOW>;
tx-disable-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
maximum-power-milliwatt = <1500>;
#thermal-sensor-cells = <0>;
};
};
&i2c_mst1 {
status = "okay";
i2c2: i2c@2 {
reg = <2>;
};
i2c3: i2c@3 {
reg = <3>;
};
i2c4: i2c@4 {
reg = <4>;
};
i2c6: i2c@6 {
reg = <6>;
};
};
&mdio_aux {
status = "okay";
gpio1: gpio@0 {
compatible = "realtek,rtl8231";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&gpio1 0 0 37>;
led-controller {
compatible = "realtek,rtl8231-leds";
status = "disabled";
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0xa0000>;
read-only;
};
partition@a0000 {
label = "u-boot-env";
reg = <0xa0000 0x10000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_ubootenv_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
};
partition@b0000 {
label = "reserve";
reg = <0xb0000 0x80000>;
read-only;
};
partition@130000 {
label = "config";
reg = <0x130000 0x350000>;
read-only;
};
partition@480000 {
label = "firmware";
reg = <0x480000 0x1b80000>;
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "kernel";
reg = <0x0 0x800000>;
};
partition@800000 {
label = "rootfs";
reg = <0x800000 0x1380000>;
};
};
};
};
};
&ethernet0 {
nvmem-cells = <&macaddr_ubootenv_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&mdio_bus0 {
PHY_C45(24, 0)
};
&mdio_bus1 {
PHY_C45(25, 0)
};
&mdio_bus2 {
PHY_C45(26, 0)
PHY_C45(27, 1)
};
&switch0 {
ethernet-ports {
#address-cells = <1>;
#size-cells = <0>;
SWITCH_PORT_SFP(0, 1, 2, 0, 0)
SWITCH_PORT_SFP(8, 2, 3, 0, 1)
SWITCH_PORT_SFP(16, 3, 4, 0, 2)
SWITCH_PORT_SFP(20, 4, 5, 0, 3)
SWITCH_PORT_SDS(24, 8, 6, usxgmii)
SWITCH_PORT_SDS(25, 7, 7, usxgmii)
SWITCH_PORT_SDS(26, 6, 8, usxgmii)
SWITCH_PORT_SDS(27, 5, 9, usxgmii)
port@28 {
ethernet = <&ethernet0>;
reg = <28>;
phy-mode = "internal";
fixed-link {
speed = <1000>;
full-duplex;
};
};
};
};
&thermal_zones {
sys-thermal {
polling-delay-passive = <1000>;
polling-delay = <1000>;
thermal-sensors = <&temperature_sensor>;
trips {
sys-crit {
temperature = <70000>;
hysteresis = <2000>;
type = "critical";
};
};
};
};

View File

@ -94,6 +94,33 @@ define Device/vimin_vm-s100-0800ms
endef
TARGET_DEVICES += vimin_vm-s100-0800ms
define Device/xikestor_sks7300-4x4t
SOC := rtl9303
DEVICE_VENDOR := XikeStor
DEVICE_MODEL := SKS7300-4X4T
DEVICE_PACKAGES := kmod-hwmon-lm75
KERNEL_SIZE:= 8192k
IMAGE_SIZE := 28160k
KERNEL := \
kernel-bin | \
append-dtb | \
lzma | \
xikestor-sks7300-img
KERNEL_INITRAMFS := \
kernel-bin | \
append-dtb | \
lzma | \
xikestor-sks7300-img
IMAGE/sysupgrade.bin := \
append-kernel | \
pad-to 8192k | \
append-rootfs | \
pad-rootfs | \
check-size | \
append-metadata
endef
TARGET_DEVICES += xikestor_sks7300-4x4t
define Device/xikestor_sks8300-8t
SOC := rtl9303
UIMAGE_MAGIC := 0x93000000

View File

@ -83,7 +83,7 @@ CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_REALTEK_OTTO=y
CONFIG_GPIO_REGMAP=y
CONFIG_GPIO_WATCHDOG=y
CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y
# CONFIG_GPIO_WATCHDOG_ARCH_INITCALL is not set
CONFIG_GRO_CELLS=y
CONFIG_HARDWARE_WATCHPOINTS=y
CONFIG_HAS_DMA=y