From: Jonas Jelonek Date: Tue, 2 Sep 2025 07:38:51 +0000 (+0200) Subject: realtek: fix model for TP-Link TL-ST1008F v2.0 X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=b082f9f60e0009f44a43b0b046a0c8952f0c7761;p=openwrt%2Fstaging%2Fthess.git realtek: fix model for TP-Link TL-ST1008F v2.0 Fix the model name in DTS compatible, Makefiles and board scripts by using dash instead of comma or underscore. This aligns it with other examples in OpenWrt and makes in consistent in all places where the board model is used. 'tplink,tl-st1008f,v2' --> 'tplink,tl-st1008f-v2' 'tplink,tl-st1008f_v2' --> 'tplink,tl-st1008f-v2' Fixes: 39b9b491bb ("realtek: add support for TP-Link TL-ST1008F v2.0") Fixes: #19930 Signed-off-by: Jonas Jelonek Link: https://github.com/openwrt/openwrt/pull/19934 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index dd2456d9dc..0586e9e396 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -56,7 +56,7 @@ tplink,t1600g-28ts-v3) label_mac=$(get_mac_label) lan_mac="$label_mac" ;; -tplink,tl-st1008f,v2) +tplink,tl-st1008f-v2) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) [ -z "$lan_mac" ] || [ "$lan_mac" = "00:e0:4c:00:00:00" ] && lan_mac=$(macaddr_random) ;; diff --git a/target/linux/realtek/base-files/etc/uci-defaults/99_fwenv-store-ethaddr b/target/linux/realtek/base-files/etc/uci-defaults/99_fwenv-store-ethaddr index adb54da956..c268422389 100644 --- a/target/linux/realtek/base-files/etc/uci-defaults/99_fwenv-store-ethaddr +++ b/target/linux/realtek/base-files/etc/uci-defaults/99_fwenv-store-ethaddr @@ -10,7 +10,7 @@ BOARD_CFG=/etc/board.json [ "$(rootfs_type)" = "tmpfs" ] && exit 0 case "$(board_name)" in -tplink,tl-st1008f,v2) +tplink,tl-st1008f-v2) env_ethaddr=$(macaddr_canonicalize "$(fw_printenv -n ethaddr 2>/dev/null)") # This device ships with a dummy ethaddr because it's an unmanaged switch. diff --git a/target/linux/realtek/dts/rtl9303_tplink_tl-st1008f-v2.dts b/target/linux/realtek/dts/rtl9303_tplink_tl-st1008f-v2.dts new file mode 100644 index 0000000000..83f9998795 --- /dev/null +++ b/target/linux/realtek/dts/rtl9303_tplink_tl-st1008f-v2.dts @@ -0,0 +1,364 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rtl930x.dtsi" + +#include +#include +#include + +/ { + compatible = "tplink,tl-st1008f-v2", "realtek,rtl930x-soc"; + model = "TP-Link TL-ST1008F v2.0"; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x10000000>, /* first 256 MiB */ + <0x20000000 0x10000000>; /* remaining 256 MiB */ + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + m1 { + label = "M1"; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; + debounce-interval = <50>; + linux,code = ; + linux,input-type = ; + }; + + m2 { + label = "M2"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + debounce-interval = <50>; + linux,code = ; + linux,input-type = ; + }; + + m3 { + label = "M3"; + gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; + debounce-interval = <50>; + linux,code = ; + linux,input-type = ; + }; + }; + + led_set { + compatible = "realtek,rtl9300-leds"; + active-high; + + led_set0 = <0x0ba0 0x0a08 0x0a01>; + }; + + i2c_gpio { + compatible = "i2c-gpio"; + #address-cells = <1>; + #size-cells = <0>; + i2c-gpio,delay-us = <2>; + scl-gpios = <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio0 23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + + gpioexp0: i2c@38 { + reg = <0x38>; + compatible = "nxp,pca9534"; + gpio-controller; + #gpio-cells = <2>; + }; + }; + + sfp0: sfp-p1 { + compatible = "sff,sfp"; + i2c-bus = <&i2c0>; + mod-def0-gpio = <&gpio0 0 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpioexp0 0 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <2900>; + #thermal-sensor-cells = <0>; + }; + + sfp1: sfp-p2 { + compatible = "sff,sfp"; + i2c-bus = <&i2c1>; + mod-def0-gpio = <&gpio0 1 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpioexp0 1 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <1500>; + #thermal-sensor-cells = <0>; + }; + + sfp2: sfp-p3 { + compatible = "sff,sfp"; + i2c-bus = <&i2c2>; + mod-def0-gpio = <&gpio0 2 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpioexp0 2 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <1500>; + #thermal-sensor-cells = <0>; + }; + + sfp3: sfp-p4 { + compatible = "sff,sfp"; + i2c-bus = <&i2c3>; + mod-def0-gpio = <&gpio0 3 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpioexp0 3 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <2000>; + #thermal-sensor-cells = <0>; + }; + + sfp4: sfp-p5 { + compatible = "sff,sfp"; + i2c-bus = <&i2c4>; + mod-def0-gpio = <&gpio0 4 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpioexp0 4 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <2000>; + #thermal-sensor-cells = <0>; + }; + + sfp5: sfp-p6 { + compatible = "sff,sfp"; + i2c-bus = <&i2c5>; + mod-def0-gpio = <&gpio0 5 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpioexp0 5 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <1500>; + #thermal-sensor-cells = <0>; + }; + + sfp6: sfp-p7 { + compatible = "sff,sfp"; + i2c-bus = <&i2c6>; + mod-def0-gpio = <&gpio0 6 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpioexp0 6 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <1500>; + #thermal-sensor-cells = <0>; + }; + + sfp7: sfp-p8 { + compatible = "sff,sfp"; + i2c-bus = <&i2c7>; + mod-def0-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpioexp0 7 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <2900>; + #thermal-sensor-cells = <0>; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + hw_margin_ms = <1200>; + always-running; + }; +}; + +&i2c_mst1 { + status = "okay"; + + /* SDA0-7 correspond to GPIO9-16 */ + i2c0: i2c@0 { + reg = <0>; + }; + i2c1: i2c@1 { + reg = <1>; + }; + i2c2: i2c@2 { + reg = <2>; + }; + i2c3: i2c@3 { + reg = <3>; + }; + i2c4: i2c@4 { + reg = <4>; + }; + i2c5: i2c@5 { + reg = <5>; + }; + i2c6: i2c@6 { + reg = <6>; + }; + i2c7: i2c@7 { + reg = <7>; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <100000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0xe0000>; + read-only; + }; + + partition@e0000 { + label = "u-boot-env"; + reg = <0xe0000 0x10000>; + }; + + partition@f0000 { + label = "u-boot-env2"; + reg = <0xf0000 0x10000>; + read-only; + }; + + partition@100000 { + label = "jffs2-cfg"; + reg = <0x100000 0x100000>; + }; + + partition@200000 { + label = "jffs2-log"; + reg = <0x200000 0x100000>; + }; + + partition@300000 { + compatible = "openwrt,uimage", "denx,uimage"; + reg = <0x300000 0x1d00000>; + label = "firmware"; + openwrt,ih-magic = <0x93030000>; + }; + }; + }; +}; + +ðernet0 { + mdio: mdio-bus { + compatible = "realtek,rtl838x-mdio"; + regmap = <ðernet0>; + #address-cells = <1>; + #size-cells = <0>; + + INTERNAL_PHY_SDS(0, 2) + INTERNAL_PHY_SDS(8, 3) + INTERNAL_PHY_SDS(16, 4) + INTERNAL_PHY_SDS(20, 5) + INTERNAL_PHY_SDS(24, 6) + INTERNAL_PHY_SDS(25, 7) + INTERNAL_PHY_SDS(26, 8) + INTERNAL_PHY_SDS(27, 9) + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + phy-mode = "1000base-x"; + phy-handle = <&phy0>; + sfp = <&sfp0>; + managed = "in-band-status"; + led-set = <0>; + }; + + port@8 { + reg = <8>; + label = "lan2"; + phy-mode = "1000base-x"; + phy-handle = <&phy8>; + sfp = <&sfp1>; + managed = "in-band-status"; + led-set = <0>; + }; + + port@10 { + reg = <16>; + label = "lan3"; + phy-mode = "1000base-x"; + phy-handle = <&phy16>; + sfp = <&sfp2>; + managed = "in-band-status"; + led-set = <0>; + }; + + port@14 { + reg = <20>; + label = "lan4"; + phy-mode = "1000base-x"; + phy-handle = <&phy20>; + sfp = <&sfp3>; + managed = "in-band-status"; + led-set = <0>; + }; + + port@18 { + reg = <24>; + label = "lan5"; + phy-mode = "1000base-x"; + phy-handle = <&phy24>; + sfp = <&sfp4>; + managed = "in-band-status"; + led-set = <0>; + }; + + port@19 { + reg = <25>; + label = "lan6"; + phy-mode = "1000base-x"; + phy-handle = <&phy25>; + sfp = <&sfp5>; + managed = "in-band-status"; + led-set = <0>; + }; + + port@1a { + reg = <26>; + label = "lan7"; + phy-mode = "1000base-x"; + phy-handle = <&phy26>; + sfp = <&sfp6>; + managed = "in-band-status"; + led-set = <0>; + }; + + port@1b { + reg = <27>; + label = "lan8"; + phy-mode = "1000base-x"; + phy-handle = <&phy27>; + sfp = <&sfp7>; + managed = "in-band-status"; + led-set = <0>; + }; + + port@1c { + ethernet = <ðernet0>; + reg = <28>; + phy-mode = "internal"; + + fixed-link { + speed = <10000>; + full-duplex; + }; + }; + }; +}; + +&thermal_zones { + sfp-thermal { + polling-delay-passive = <10000>; + polling-delay = <10000>; + thermal-sensors = <&sfp0>, <&sfp1>, <&sfp2>, <&sfp3>, <&sfp4>, <&sfp5>, <&sfp6>, <&sfp7>; + trips { + sfp-crit { + temperature = <110000>; + hysteresis = <1000>; + type = "critical"; + }; + }; + }; +}; diff --git a/target/linux/realtek/dts/rtl9303_tplink_tl-st1008f_v2.dts b/target/linux/realtek/dts/rtl9303_tplink_tl-st1008f_v2.dts deleted file mode 100644 index 49d7b348d5..0000000000 --- a/target/linux/realtek/dts/rtl9303_tplink_tl-st1008f_v2.dts +++ /dev/null @@ -1,364 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "rtl930x.dtsi" - -#include -#include -#include - -/ { - compatible = "tplink,tl-st1008f,v2", "realtek,rtl930x-soc"; - model = "TP-Link TL-ST1008F v2.0"; - - memory@0 { - device_type = "memory"; - reg = <0x00000000 0x10000000>, /* first 256 MiB */ - <0x20000000 0x10000000>; /* remaining 256 MiB */ - }; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - keys { - compatible = "gpio-keys"; - - m1 { - label = "M1"; - gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; - debounce-interval = <50>; - linux,code = ; - linux,input-type = ; - }; - - m2 { - label = "M2"; - gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; - debounce-interval = <50>; - linux,code = ; - linux,input-type = ; - }; - - m3 { - label = "M3"; - gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; - debounce-interval = <50>; - linux,code = ; - linux,input-type = ; - }; - }; - - led_set { - compatible = "realtek,rtl9300-leds"; - active-high; - - led_set0 = <0x0ba0 0x0a08 0x0a01>; - }; - - i2c_gpio { - compatible = "i2c-gpio"; - #address-cells = <1>; - #size-cells = <0>; - i2c-gpio,delay-us = <2>; - scl-gpios = <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; - sda-gpios = <&gpio0 23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; - - gpioexp0: i2c@38 { - reg = <0x38>; - compatible = "nxp,pca9534"; - gpio-controller; - #gpio-cells = <2>; - }; - }; - - sfp0: sfp-p1 { - compatible = "sff,sfp"; - i2c-bus = <&i2c0>; - mod-def0-gpio = <&gpio0 0 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpioexp0 0 GPIO_ACTIVE_HIGH>; - maximum-power-milliwatt = <2900>; - #thermal-sensor-cells = <0>; - }; - - sfp1: sfp-p2 { - compatible = "sff,sfp"; - i2c-bus = <&i2c1>; - mod-def0-gpio = <&gpio0 1 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpioexp0 1 GPIO_ACTIVE_HIGH>; - maximum-power-milliwatt = <1500>; - #thermal-sensor-cells = <0>; - }; - - sfp2: sfp-p3 { - compatible = "sff,sfp"; - i2c-bus = <&i2c2>; - mod-def0-gpio = <&gpio0 2 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpioexp0 2 GPIO_ACTIVE_HIGH>; - maximum-power-milliwatt = <1500>; - #thermal-sensor-cells = <0>; - }; - - sfp3: sfp-p4 { - compatible = "sff,sfp"; - i2c-bus = <&i2c3>; - mod-def0-gpio = <&gpio0 3 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpioexp0 3 GPIO_ACTIVE_HIGH>; - maximum-power-milliwatt = <2000>; - #thermal-sensor-cells = <0>; - }; - - sfp4: sfp-p5 { - compatible = "sff,sfp"; - i2c-bus = <&i2c4>; - mod-def0-gpio = <&gpio0 4 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpioexp0 4 GPIO_ACTIVE_HIGH>; - maximum-power-milliwatt = <2000>; - #thermal-sensor-cells = <0>; - }; - - sfp5: sfp-p6 { - compatible = "sff,sfp"; - i2c-bus = <&i2c5>; - mod-def0-gpio = <&gpio0 5 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpioexp0 5 GPIO_ACTIVE_HIGH>; - maximum-power-milliwatt = <1500>; - #thermal-sensor-cells = <0>; - }; - - sfp6: sfp-p7 { - compatible = "sff,sfp"; - i2c-bus = <&i2c6>; - mod-def0-gpio = <&gpio0 6 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpioexp0 6 GPIO_ACTIVE_HIGH>; - maximum-power-milliwatt = <1500>; - #thermal-sensor-cells = <0>; - }; - - sfp7: sfp-p8 { - compatible = "sff,sfp"; - i2c-bus = <&i2c7>; - mod-def0-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>; - tx-disable-gpio = <&gpioexp0 7 GPIO_ACTIVE_HIGH>; - maximum-power-milliwatt = <2900>; - #thermal-sensor-cells = <0>; - }; - - watchdog { - compatible = "linux,wdt-gpio"; - gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; - hw_algo = "toggle"; - hw_margin_ms = <1200>; - always-running; - }; -}; - -&i2c_mst1 { - status = "okay"; - - /* SDA0-7 correspond to GPIO9-16 */ - i2c0: i2c@0 { - reg = <0>; - }; - i2c1: i2c@1 { - reg = <1>; - }; - i2c2: i2c@2 { - reg = <2>; - }; - i2c3: i2c@3 { - reg = <3>; - }; - i2c4: i2c@4 { - reg = <4>; - }; - i2c5: i2c@5 { - reg = <5>; - }; - i2c6: i2c@6 { - reg = <6>; - }; - i2c7: i2c@7 { - reg = <7>; - }; -}; - -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <100000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0xe0000>; - read-only; - }; - - partition@e0000 { - label = "u-boot-env"; - reg = <0xe0000 0x10000>; - }; - - partition@f0000 { - label = "u-boot-env2"; - reg = <0xf0000 0x10000>; - read-only; - }; - - partition@100000 { - label = "jffs2-cfg"; - reg = <0x100000 0x100000>; - }; - - partition@200000 { - label = "jffs2-log"; - reg = <0x200000 0x100000>; - }; - - partition@300000 { - compatible = "openwrt,uimage", "denx,uimage"; - reg = <0x300000 0x1d00000>; - label = "firmware"; - openwrt,ih-magic = <0x93030000>; - }; - }; - }; -}; - -ðernet0 { - mdio: mdio-bus { - compatible = "realtek,rtl838x-mdio"; - regmap = <ðernet0>; - #address-cells = <1>; - #size-cells = <0>; - - INTERNAL_PHY_SDS(0, 2) - INTERNAL_PHY_SDS(8, 3) - INTERNAL_PHY_SDS(16, 4) - INTERNAL_PHY_SDS(20, 5) - INTERNAL_PHY_SDS(24, 6) - INTERNAL_PHY_SDS(25, 7) - INTERNAL_PHY_SDS(26, 8) - INTERNAL_PHY_SDS(27, 9) - }; -}; - -&switch0 { - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - label = "lan1"; - phy-mode = "1000base-x"; - phy-handle = <&phy0>; - sfp = <&sfp0>; - managed = "in-band-status"; - led-set = <0>; - }; - - port@8 { - reg = <8>; - label = "lan2"; - phy-mode = "1000base-x"; - phy-handle = <&phy8>; - sfp = <&sfp1>; - managed = "in-band-status"; - led-set = <0>; - }; - - port@10 { - reg = <16>; - label = "lan3"; - phy-mode = "1000base-x"; - phy-handle = <&phy16>; - sfp = <&sfp2>; - managed = "in-band-status"; - led-set = <0>; - }; - - port@14 { - reg = <20>; - label = "lan4"; - phy-mode = "1000base-x"; - phy-handle = <&phy20>; - sfp = <&sfp3>; - managed = "in-band-status"; - led-set = <0>; - }; - - port@18 { - reg = <24>; - label = "lan5"; - phy-mode = "1000base-x"; - phy-handle = <&phy24>; - sfp = <&sfp4>; - managed = "in-band-status"; - led-set = <0>; - }; - - port@19 { - reg = <25>; - label = "lan6"; - phy-mode = "1000base-x"; - phy-handle = <&phy25>; - sfp = <&sfp5>; - managed = "in-band-status"; - led-set = <0>; - }; - - port@1a { - reg = <26>; - label = "lan7"; - phy-mode = "1000base-x"; - phy-handle = <&phy26>; - sfp = <&sfp6>; - managed = "in-band-status"; - led-set = <0>; - }; - - port@1b { - reg = <27>; - label = "lan8"; - phy-mode = "1000base-x"; - phy-handle = <&phy27>; - sfp = <&sfp7>; - managed = "in-band-status"; - led-set = <0>; - }; - - port@1c { - ethernet = <ðernet0>; - reg = <28>; - phy-mode = "internal"; - - fixed-link { - speed = <10000>; - full-duplex; - }; - }; - }; -}; - -&thermal_zones { - sfp-thermal { - polling-delay-passive = <10000>; - polling-delay = <10000>; - thermal-sensors = <&sfp0>, <&sfp1>, <&sfp2>, <&sfp3>, <&sfp4>, <&sfp5>, <&sfp6>, <&sfp7>; - trips { - sfp-crit { - temperature = <110000>; - hysteresis = <1000>; - type = "critical"; - }; - }; - }; -}; diff --git a/target/linux/realtek/image/rtl930x.mk b/target/linux/realtek/image/rtl930x.mk index 8f53855b5b..cf7333e3d4 100644 --- a/target/linux/realtek/image/rtl930x.mk +++ b/target/linux/realtek/image/rtl930x.mk @@ -40,17 +40,18 @@ define Device/plasmacloud_psx10 endef TARGET_DEVICES += plasmacloud_psx10 -define Device/tplink_tl-st1008f_v2 +define Device/tplink_tl-st1008f-v2 SOC := rtl9303 UIMAGE_MAGIC := 0x93030000 DEVICE_VENDOR := TP-Link DEVICE_MODEL := TL-ST1008F DEVICE_VARIANT := v2.0 DEVICE_PACKAGES := kmod-gpio-pca953x + SUPPORTED_DEVICES += tplink,tl-st1008f,v2 IMAGE_SIZE := 31808k $(Device/kernel-lzma) endef -TARGET_DEVICES += tplink_tl-st1008f_v2 +TARGET_DEVICES += tplink_tl-st1008f-v2 define Device/vimin_vm-s100-0800ms SOC := rtl9303