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 67d6a29e7d..188f9ded20 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -76,7 +76,8 @@ realtek_setup_macs() plasmacloud,mcx3|\ plasmacloud,psx8|\ plasmacloud,psx10|\ - plasmacloud,psx28) + plasmacloud,psx28|\ + zyxel,gs1920-24hp-v2) lan_mac="$(get_mac_label)" ;; tplink,tl-st1008f-v2|\ diff --git a/target/linux/realtek/dts/rtl8391_zyxel_gs1920-24hp-v2.dts b/target/linux/realtek/dts/rtl8391_zyxel_gs1920-24hp-v2.dts new file mode 100644 index 0000000000..54e87df6d8 --- /dev/null +++ b/target/linux/realtek/dts/rtl8391_zyxel_gs1920-24hp-v2.dts @@ -0,0 +1,134 @@ +/dts-v1/; + +#include "rtl839x_zyxel_gs1920-24hp-common.dtsi" + +/ { + compatible = "zyxel,gs1920-24hp-v2", "realtek,rtl8391-soc"; + model = "Zyxel GS1920-24HPv2"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x10000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + cloud-amber { + gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; + color = ; + }; + + pwr-green { + gpios = <&gpio1 18 GPIO_ACTIVE_LOW>; + function = LED_FUNCTION_POWER; + color = ; + default-state = "on"; + }; + + pwr-amber { + gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + function = LED_FUNCTION_POWER; + color = ; + }; + + poe-max { + gpios = <&gpio1 35 GPIO_ACTIVE_HIGH>; + color = ; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + restore { + label = "restore"; + gpios = <&gpio1 32 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; + + /delete-node/ i2c-gpio-0; + /delete-node/ i2c-gpio-1; + + i2c-gpio-shared { + compatible = "i2c-gpio-shared"; + scl-gpios = <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + #address-cells = <1>; + #size-cells = <0>; + + i2c0: i2c@0 { + sda-gpios = <&gpio1 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <2>; + }; + + i2c1: i2c@1 { + sda-gpios = <&gpio1 10 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <2>; + }; + }; +}; + +&i2c2 { + scl-gpios = <&gpio1 9 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +&i2c3 { + scl-gpios = <&gpio1 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +&i2c4 { + lm96000: lm96000@2e { + compatible = "national,lm85"; + reg = <0x2e>; + }; +}; + +&flash_partitions { + partition@20000 { + label = "reserved"; + reg = <0x20000 0x1e0000>; + read-only; + }; + + partition@200000 { + reg = <0x200000 0x1e00000>; + label = "factory"; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "loader"; + reg = <0x0 0x10000>; + }; + + partition@10000 { + label = "firmware"; + reg = <0x10000 0x1d00000>; + compatible = "openwrt,uimage", "denx,uimage"; + }; + }; +}; + +&mdio_bus0 { + /* External phy RTL8214FC #1 */ + EXTERNAL_SFP_PHY_FULL(24, 0) + EXTERNAL_SFP_PHY_FULL(25, 1) + EXTERNAL_SFP_PHY_FULL(26, 2) + EXTERNAL_SFP_PHY_FULL(27, 3) +}; + +&switch0 { + ports { + SWITCH_PORT_SDS(24, 25, 6, qsgmii) + SWITCH_PORT_SDS(25, 26, 6, qsgmii) + SWITCH_PORT_SDS(26, 27, 6, qsgmii) + SWITCH_PORT_SDS(27, 28, 6, qsgmii) + }; +}; diff --git a/target/linux/realtek/image/rtl839x.mk b/target/linux/realtek/image/rtl839x.mk index 6afa80b49d..a40a2300c2 100644 --- a/target/linux/realtek/image/rtl839x.mk +++ b/target/linux/realtek/image/rtl839x.mk @@ -129,3 +129,12 @@ define Device/zyxel_gs1920-24hp-v1 DEVICE_VARIANT := v1 endef TARGET_DEVICES += zyxel_gs1920-24hp-v1 + +define Device/zyxel_gs1920-24hp-v2 + $(Device/zyxel_gs1920-24hp) + SOC := rtl8391 + FLASH_ADDR := 0xb4210000 + IMAGE_SIZE := 30720k + DEVICE_VARIANT := v2 +endef +TARGET_DEVICES += zyxel_gs1920-24hp-v2