From c4bfe68c83910e613f07350587a8709a16bd1ffa Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Fri, 8 Jan 2021 14:32:48 +0100 Subject: [PATCH] realtek: add support for ZyXEL GS1900-8HP v1 and v2 The ZyXEL GS1900-8HP is an 8 port gigabit switch with PoE+ support. There are two versions on the market (v1 & v2) which share similar specs (same flash size and flash layout, same RAM size, same PoE+ power envelope) but have a different case and board layout that they each share with other GS1900 siblings. The v1 seems to share its PCB and case with non-PoE GS1900-8; as such, adding support for the GS1900-8 would probably be trivial. The v2 seems to share its casing and platform with its already supported bigger brother, the GS1900-10HP - its board looks the same, except for two holes where the GS1900-10 has its SFP ports. Like their 10 port sibling, both devices have a dual firmware layout. Both GS1900-8HP boards have the same 70W PoE+ power budget. In order to manipulate the PoE+, one needs the rtl83xx-poe package [1]. After careful consideration it was decided to go with separate images for each version. Specifications (v1) ------------------- * SoC: Realtek RTL8380M 500 MHz MIPS 4KEc * Flash: Macronix MX25L12835F 16 MiB * RAM: Nanya NT5TU128M8HE-AC 128 MiB DDR2 SDRAM * Ethernet: 8x 10/100/1000 Mbit * PoE+: Broadcom BCM59111KMLG (IEEE 802.3at-2009 compliant, 2x) * UART: 1 serial header with populated standard pin connector on the left side of the PCB, towards the bottom. Pins are labeled: + VCC (3.3V) + TX + RX + GND Specifications (v2) ------------------- * SoC: Realtek RTL8380M 500 MHz MIPS 4KEc * Flash: Macronix MX25L12835F 16 MiB * RAM: Samsung K4B1G0846G 128 MiB DDR3 SDRAM * Ethernet: 8x 10/100/1000 Mbit * PoE+: Broadcom BCM59121B0KMLG (IEEE 802.3at-2009 compliant) * UART: 1 angled serial header with populated standard pin connector accessible from outside through the ventilation slits on the side. Pins from top to bottom are clearly marked on the PCB: + VCC (3.3V) + TX + RX + GND Serial connection parameters for both devices: 115200 8N1. Installation ------------ Instructions are identical to those for the GS1900-10HP and apply both to the GS1900-8HP v1 and v2 as well. * Configure your client with a static 192.168.1.x IP (e.g. 192.168.1.10). * Set up a TFTP server on your client and make it serve the initramfs image. * Connect serial, power up the switch, interrupt U-boot by hitting the space bar, and enable the network: > rtk network on * Since the GS1900-10HP is a dual-partition device, you want to keep the OEM firmware on the backup partition for the time being. OpenWrt can only boot off the first partition anyway (hardcoded in the DTS). To make sure we are manipulating the first partition, issue the following commands: > setsys bootpartition 0 > savesys * Download the image onto the device and boot from it: > tftpboot 0x84f00000 192.168.1.10:openwrt-realtek-generic-zyxel_gs1900-8hp-v{1,2}-initramfs-kernel.bin > bootm * Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it: > sysupgrade /tmp//tmp/openwrt-realtek-generic-zyxel_gs1900-8hp-v{1,2}-squashfs-sysupgrade.bin Signed-off-by: Stijn Segers [merge PoE case, keep device definitions separate, change all those hashes in the commit message to something else so they don't get removed when changing the commit ...] Signed-off-by: Adrian Schmutzler --- .../realtek/base-files/etc/board.d/02_network | 4 ++++ .../dts/rtl8380_zyxel_gs1900-8hp-v1.dts | 8 ++++++++ .../dts/rtl8380_zyxel_gs1900-8hp-v2.dts | 8 ++++++++ target/linux/realtek/image/Makefile | 20 +++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v1.dts create mode 100644 target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v2.dts 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 84fefa536d4..2568fd2e0e0 100755 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -55,6 +55,10 @@ netgear,gs110tpp-v1) zyxel,gs1900-10hp) ucidef_set_poe 77 "$lan_list" ;; +zyxel,gs1900-8hp-v1|\ +zyxel,gs1900-8hp-v2) + ucidef_set_poe 70 "$lan_list" + ;; esac board_config_flush diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v1.dts b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v1.dts new file mode 100644 index 00000000000..0d9b7c97c0d --- /dev/null +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v1.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rtl8380_zyxel_gs1900.dtsi" + +/ { + compatible = "zyxel,gs1900-8hp-v1", "realtek,rtl838x-soc"; + model = "ZyXEL GS1900-8HP v1 Switch"; +}; diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v2.dts b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v2.dts new file mode 100644 index 00000000000..cdc4aed6d19 --- /dev/null +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v2.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rtl8380_zyxel_gs1900.dtsi" + +/ { + compatible = "zyxel,gs1900-8hp-v2", "realtek,rtl838x-soc"; + model = "ZyXEL GS1900-8HP v2 Switch"; +}; diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile index 765e516a0a2..1251b47c933 100644 --- a/target/linux/realtek/image/Makefile +++ b/target/linux/realtek/image/Makefile @@ -73,4 +73,24 @@ define Device/zyxel_gs1900-10hp endef TARGET_DEVICES += zyxel_gs1900-10hp +define Device/zyxel_gs1900-8hp-v1 + SOC := rtl8380 + IMAGE_SIZE := 6976k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := GS1900-8HP + DEVICE_VARIANT := v1 + DEVICE_PACKAGES += lua-rs232 +endef +TARGET_DEVICES += zyxel_gs1900-8hp-v1 + +define Device/zyxel_gs1900-8hp-v2 + SOC := rtl8380 + IMAGE_SIZE := 6976k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := GS1900-8HP + DEVICE_VARIANT := v2 + DEVICE_PACKAGES += lua-rs232 +endef +TARGET_DEVICES += zyxel_gs1900-8hp-v2 + $(eval $(call BuildImage)) -- 2.30.2