diff --git a/target/linux/realtek/dts/rtl9303_horaco_zx-swtgw2c8f.dts b/target/linux/realtek/dts/rtl9303_horaco_zx-swtgw2c8f.dts index dc5ced899a9..da9288fa9ac 100644 --- a/target/linux/realtek/dts/rtl9303_horaco_zx-swtgw2c8f.dts +++ b/target/linux/realtek/dts/rtl9303_horaco_zx-swtgw2c8f.dts @@ -1,275 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later -#include "rtl930x.dtsi" - -#include -#include -#include +#include "rtl9303_horaco_zx-swtgw2c8f.dtsi" / { compatible = "horaco,zx-swtgw2c8f", "realtek,rtl9303-soc"; model = "Horaco ZX-SWTGW2C8F"; - - aliases { - label-mac-device = ðernet0; - led-boot = &led_sys; - led-failsafe = &led_sys; - led-running = &led_sys; - led-upgrade = &led_sys; - }; - - chosen { - bootargs = "console=ttyS0,115200 earlyprintk"; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - - led_set { - compatible = "realtek,rtl9300-leds"; - realtek,led-mode = ; - - led_set0 = ; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; - pinctrl-0 = <&pinmux_disable_sys_led>; - - led_sys: sys { - color = ; - function = LED_FUNCTION_STATUS; - gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; - }; - }; - - keys { - compatible = "gpio-keys"; - - mode { - label = "reset"; - gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - sfp0: sfp-p1 { - compatible = "sff,sfp"; - i2c-bus = <&i2c_hw0>; - mod-def0-gpio = <&gpio1 1 GPIO_ACTIVE_LOW>; - los-gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>; - tx-disable-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; - #thermal-sensor-cells = <0>; - }; - - sfp1: sfp-p2 { - compatible = "sff,sfp"; - i2c-bus = <&i2c_hw1>; - mod-def0-gpio = <&gpio1 4 GPIO_ACTIVE_LOW>; - los-gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>; - tx-disable-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; - #thermal-sensor-cells = <0>; - }; - - sfp2: sfp-p3 { - compatible = "sff,sfp"; - i2c-bus = <&i2c_hw2>; - mod-def0-gpio = <&gpio1 7 GPIO_ACTIVE_LOW>; - los-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>; - tx-disable-gpio = <&gpio1 6 GPIO_ACTIVE_HIGH>; - #thermal-sensor-cells = <0>; - }; - - sfp3: sfp-p4 { - compatible = "sff,sfp"; - i2c-bus = <&i2c_hw3>; - mod-def0-gpio = <&gpio1 10 GPIO_ACTIVE_LOW>; - los-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>; - tx-disable-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>; - #thermal-sensor-cells = <0>; - }; - - sfp4: sfp-p5 { - compatible = "sff,sfp"; - i2c-bus = <&i2c_hw4>; - mod-def0-gpio = <&gpio1 13 GPIO_ACTIVE_LOW>; - los-gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>; - tx-disable-gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; - #thermal-sensor-cells = <0>; - }; - - sfp5: sfp-p6 { - compatible = "sff,sfp"; - i2c-bus = <&i2c_hw5>; - mod-def0-gpio = <&gpio1 22 GPIO_ACTIVE_LOW>; - los-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>; - tx-disable-gpio = <&gpio1 21 GPIO_ACTIVE_HIGH>; - #thermal-sensor-cells = <0>; - }; - - sfp6: sfp-p7 { - compatible = "sff,sfp"; - i2c-bus = <&i2c_hw6>; - mod-def0-gpio = <&gpio1 25 GPIO_ACTIVE_LOW>; - los-gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>; - tx-disable-gpio = <&gpio1 24 GPIO_ACTIVE_HIGH>; - #thermal-sensor-cells = <0>; - }; - - sfp7: sfp-p8 { - compatible = "sff,sfp"; - i2c-bus = <&i2c_hw7>; - mod-def0-gpio = <&gpio1 28 GPIO_ACTIVE_LOW>; - los-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>; - tx-disable-gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>; - #thermal-sensor-cells = <0>; - }; -}; - -&mdio_aux { - pinctrl-names = "default"; - pinctrl-0 = <&pinmux_gpio_mdio_en>; - status = "okay"; - - gpio1: gpio@0 { - compatible = "realtek,rtl8231"; - reg = <0>; - - gpio-controller; - #gpio-cells = <2>; - gpio-ranges = <&gpio1 0 0 37>; - }; - -}; - -&i2c_mst1 { - status = "okay"; - - i2c_hw0: i2c@0 { reg = <0>; }; - i2c_hw1: i2c@1 { reg = <1>; }; - i2c_hw2: i2c@2 { reg = <2>; }; - i2c_hw3: i2c@3 { reg = <3>; }; - i2c_hw4: i2c@4 { reg = <4>; }; - i2c_hw5: i2c@5 { reg = <5>; }; - i2c_hw6: i2c@6 { reg = <6>; }; - i2c_hw7: i2c@7 { reg = <7>; }; -}; - -&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_SFP(24, 5, 6, 0, 4) - SWITCH_PORT_SFP(25, 6, 7, 0, 5) - SWITCH_PORT_SFP(26, 7, 8, 0, 6) - SWITCH_PORT_SFP(27, 8, 9, 0, 7) - - port@1c { - reg = <28>; - ethernet = <ðernet0>; - phy-mode = "internal"; - fixed-link { - speed = <1000>; - full-duplex; - }; - }; - }; -}; - -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <50000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "loader"; - reg = <0x0 0xe0000>; - read-only; - }; - - partition@e0000 { - label = "bdinfo"; - reg = <0xe0000 0x10000>; - read-only; - - nvmem-layout { - compatible = "u-boot,env"; - - macaddr_ubootenv_ethaddr: ethaddr { - #nvmem-cell-cells = <1>; - }; - }; - }; - - partition@f0000 { - label = "sysinfo"; - reg = <0xf0000 0x10000>; - read-only; - }; - - partition@100000 { - label = "jffs2-cfg"; - reg = <0x100000 0x100000>; - read-only; - }; - - partition@200000 { - label = "jffs2-log"; - reg = <0x200000 0x100000>; - read-only; - }; - - /* stock is "runtime" */ - partition@300000 { - label = "firmware"; - reg = <0x300000 0xc00000>; - compatible = "openwrt,uimage", "denx,uimage"; - openwrt,ih-magic = <0x83800000>; - }; - - partition@f00000 { - label = "oeminfo"; - reg = <0xf00000 0x100000>; - read-only; - }; - }; - }; -}; - -ðernet0 { - nvmem-cells = <&macaddr_ubootenv_ethaddr 0>; - nvmem-cell-names = "mac-address"; -}; - -&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_horaco_zx-swtgw2c8f.dtsi b/target/linux/realtek/dts/rtl9303_horaco_zx-swtgw2c8f.dtsi new file mode 100644 index 00000000000..a6951a9b327 --- /dev/null +++ b/target/linux/realtek/dts/rtl9303_horaco_zx-swtgw2c8f.dtsi @@ -0,0 +1,272 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rtl930x.dtsi" + +#include +#include +#include + +/ { + aliases { + label-mac-device = ðernet0; + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + chosen { + bootargs = "console=ttyS0,115200 earlyprintk"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + led_set: led_set { + compatible = "realtek,rtl9300-leds"; + realtek,led-mode = ; + + led_set0 = ; + }; + + leds: leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&pinmux_disable_sys_led>; + + led_sys: sys { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + mode { + label = "reset"; + gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + sfp0: sfp-p1 { + compatible = "sff,sfp"; + i2c-bus = <&i2c_hw0>; + mod-def0-gpio = <&gpio1 1 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; + #thermal-sensor-cells = <0>; + }; + + sfp1: sfp-p2 { + compatible = "sff,sfp"; + i2c-bus = <&i2c_hw1>; + mod-def0-gpio = <&gpio1 4 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; + #thermal-sensor-cells = <0>; + }; + + sfp2: sfp-p3 { + compatible = "sff,sfp"; + i2c-bus = <&i2c_hw2>; + mod-def0-gpio = <&gpio1 7 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 6 GPIO_ACTIVE_HIGH>; + #thermal-sensor-cells = <0>; + }; + + sfp3: sfp-p4 { + compatible = "sff,sfp"; + i2c-bus = <&i2c_hw3>; + mod-def0-gpio = <&gpio1 10 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>; + #thermal-sensor-cells = <0>; + }; + + sfp4: sfp-p5 { + compatible = "sff,sfp"; + i2c-bus = <&i2c_hw4>; + mod-def0-gpio = <&gpio1 13 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; + #thermal-sensor-cells = <0>; + }; + + sfp5: sfp-p6 { + compatible = "sff,sfp"; + i2c-bus = <&i2c_hw5>; + mod-def0-gpio = <&gpio1 22 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 21 GPIO_ACTIVE_HIGH>; + #thermal-sensor-cells = <0>; + }; + + sfp6: sfp-p7 { + compatible = "sff,sfp"; + i2c-bus = <&i2c_hw6>; + mod-def0-gpio = <&gpio1 25 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 24 GPIO_ACTIVE_HIGH>; + #thermal-sensor-cells = <0>; + }; + + sfp7: sfp-p8 { + compatible = "sff,sfp"; + i2c-bus = <&i2c_hw7>; + mod-def0-gpio = <&gpio1 28 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>; + #thermal-sensor-cells = <0>; + }; +}; + +&mdio_aux { + pinctrl-names = "default"; + pinctrl-0 = <&pinmux_gpio_mdio_en>; + status = "okay"; + + gpio1: gpio@0 { + compatible = "realtek,rtl8231"; + reg = <0>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&gpio1 0 0 37>; + }; + +}; + +&i2c_mst1 { + status = "okay"; + + i2c_hw0: i2c@0 { reg = <0>; }; + i2c_hw1: i2c@1 { reg = <1>; }; + i2c_hw2: i2c@2 { reg = <2>; }; + i2c_hw3: i2c@3 { reg = <3>; }; + i2c_hw4: i2c@4 { reg = <4>; }; + i2c_hw5: i2c@5 { reg = <5>; }; + i2c_hw6: i2c@6 { reg = <6>; }; + i2c_hw7: i2c@7 { reg = <7>; }; +}; + +&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_SFP(24, 5, 6, 0, 4) + SWITCH_PORT_SFP(25, 6, 7, 0, 5) + SWITCH_PORT_SFP(26, 7, 8, 0, 6) + SWITCH_PORT_SFP(27, 8, 9, 0, 7) + + port@1c { + reg = <28>; + ethernet = <ðernet0>; + phy-mode = "internal"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "loader"; + reg = <0x0 0xe0000>; + read-only; + }; + + partition@e0000 { + label = "bdinfo"; + reg = <0xe0000 0x10000>; + read-only; + + nvmem-layout { + compatible = "u-boot,env"; + + macaddr_ubootenv_ethaddr: ethaddr { + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@f0000 { + label = "sysinfo"; + reg = <0xf0000 0x10000>; + read-only; + }; + + partition@100000 { + label = "jffs2-cfg"; + reg = <0x100000 0x100000>; + read-only; + }; + + partition@200000 { + label = "jffs2-log"; + reg = <0x200000 0x100000>; + read-only; + }; + + /* stock is "runtime" */ + partition@300000 { + label = "firmware"; + reg = <0x300000 0xc00000>; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = <0x83800000>; + }; + + partition@f00000 { + label = "oeminfo"; + reg = <0xf00000 0x100000>; + read-only; + }; + }; + }; +}; + +ðernet0 { + nvmem-cells = <&macaddr_ubootenv_ethaddr 0>; + nvmem-cell-names = "mac-address"; +}; + +&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"; + }; + }; + }; +};