The TP-Link TL-ST1008F is an 8-port multi-gig switch with 8x SFP+ ports which support 1G/2.5G/10G speeds. Out of the box it is an unmanaged switch but with RTL9303 and sufficient RAM + Flash it easily can run as a managed Linux switch.
Hardware: - Realtek RTL9303 Switch SoC - Winbond 25Q256JVFQ (32MB flash) - Samsung K4B4G1646E-BYMA (512MB DDR3 SDRAM) - TCA9534 GPIO extender to control the port LEDs - 8x SFP+ 1/2.5/10G slot - Serial: 3V3 logic, 115200 8N1 - 5-pin JTAG - physical tri-state switch (used by stock firmware for port speed config) - 24-LED port speed matrix - robust full-metal case
Power is supplied via a 12V 2A standard barrel connector. There are THT holes on the PCB for serial console next to the flash chip and JTAG pads. Serial uses 3V3 logic and standard 115200-8N1 config. Pinout is labeled on the PCB.
All ports/connectors and LEDs are on the back, only Power LED is on the front.
Hints before flashing ----------------------
* It is recommended to backup the stock flash contents before proceeding. Backup can be done from U-Boot (with memory display), from OpenWrt initramfs or probably with SPI flash programmer. There is no stock recovery functionality. * Use a small image for RAM boot or first flash. Since you need to use ymodem, this is really slow and takes time. * This does not keep the dual-partition layout for firmware to have more space available for a single OpenWrt installation.
Initial flashing ----------------------
The stock U-boot has broken networking thus no TFTP available. Serial transfer only.
1. Open device and connect serial as per layout and settings (recommended to use picocom, ymodem not working with minicom) 2. Connect power to device and press Esc when prompted to enter the U-Boot console. 3. Boot initramfs * in the U-Boot console: loady 0x82000000 (load OpenWrt image via ymodem) CTRL-A CTRL-S <initramfs.bin> (specify initramfs image for picocom to upload) bootm 0x82000000 (boot initramfs from RAM) (Just to be on the safe side, backup your flash now while RAM-booted) 4. Connect network to your device 5. Upload the sysupgrade image (e.g. with scp) 6. Do sysupgrade
There's no need to adjust the bootcmd in U-Boot. Networking is running fine once the realtek driver initialized everything in OpenWrt. No functional difference with running 'rtk network on' within U-Boot before. Running this even fails and returns with an error.
Return to stock ------------------
This only works if you did a backup of the flash before flashing OpenWrt. Stock dump then can be flashed from within U-Boot or OpenWrt. There is no vendor firmware image because this is an unmanaged switch!
CAUTION: Make sure to not overwrite the U-Boot partition(s). If you do not have a flash programmer, you may not be able to debrick your device then.
Co-authored-by: Balázs Triszka <balika011@gmail.com> Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> (commit: 39b9b49)
The Zyxel XGS1210-12 Switch is a 10 + 2 port multi-GBit switch with 8 x 1000BaseT, 2 x 10/100/1000/2500BaseT Ethernet ports and 2 SFP+ module slot.
Hardware: - RTL9302B SoC - Macronix MX25L12833F (16MB flash) - Nanja NT5CC64M16GP-1 (128MB DDR3 SDRAM) - RTL8231 GPIO extender to control the port LEDs - RTL8218D 8x Gigabit PHY - RTL8226 2x 10m/100m/1/2.5 Gigabit PHY - SFP+ 2x 10GBit slot
Power is supplied via a 12V 1.5A standard barrel connector. At the right side behind the grid is UART serial connector. A Serial header can be connected to from the outside of the switch trough the airvents with a standard 2.54mm header. Pins are from top to bottom Vcc(3.3V), TX, RX and GND. Serial connection is via 115200 baud, 8N1.
A reset button is accessble through a hole in the front panel
At the time of this commit, all ethernet ports work under OpenWrt, including the various NBaseT modes, SFP+ slots are supported with i2c bus.
Installation -------------- * Connect serial as per the layout above. Connection parameters: 115200 8N1. * Navigate to 'Management' in the OEM web interface and click on 'Firmware upgrade' to the left. * Upload the OpenWrt initramfs image, and wait till the switch reboots. * Connect to the device through serial and change the U-boot boot command. > fw_setenv bootcmd 'rtk network on; boota' * Reboot, scp the sysupgrade image to /tmp, verify the checksum and flash it: > sysupgrade openwrt-realtek-rtl930x-Zyxel_xgs1210-12-squashfs-sysupgrade.bin * Upon reboot, you have a functional OpenWrt installation. Leave the bootcmd value as is - without 'rtk network on' the switch will fail to initialise the network.
Debug ------------ * Connect serial as per the layout above. Connection parameters: 115200 8N1. * A tftp server is requiered, tftpd-hpa works well. * Power the device, at U-Boot start rapidly hit Esc key to stop autoboot * Enable network: > rtk network on * Change ip address (default is 192.168.1.1): > setenv ipaddr 192.168.1.6 * Download initramfs: > tftpboot 0x84f00000 192.168.1.111:openwrt-realtek-rtl930x-Zyxel_xgs1210-12-initramfs-kernel.bin * Boot loaded file: > bootm 0x84f00000
This prodecudre also apply to the sock firmware with the file XGS1210-12_V2.00(ABTY.1)C0.bix.
More information can be found on the page of XGS1250-12 as they share the same base.
Signed-off-by: Nicolas BERTRAND <nicolasbertrand89@gmail.com> [fixed white space error] Signed-off-by: Paul Spooren <mail@aparcar.org> (commit: 6af9476)
Disassembly: At the bottom, under the LEDs, there are 2 screws hidden by rubber feet. After removing the screws, pry the gray plastic part around (it is secured with latches) and remove it.
Serial Interface: The serial interface can be connected to the 5 pin dots located on the right between the operating mode switch and the antenna. Pins (from antenna to operating mode switch): VCC TX RX NC GND Settings: 115200, 8N1
Flashing via OEM recovery software: 1. Download the OEM recovery software from the manufacturer's website 2. Download the firmware image (for OpenWRT it is *-squashfs-factory.bin), rename it to KN-1112_recovery.bin 3. Replace the file in the fw folder OEM recovery software with the file from step 2. 4. Run the OEM recovery software and follow the instructions.
Flashing via TFTP: 1. Connect your PC and router to port 1-3, configure PC interface using IP 192.168.1.2, mask 255.255.255.252 2. Serve the firmware image (for OpenWRT it is *-squashfs-factory.bin) renamed to KN-1112_recovery.bin via TFTP 3. Power up the router while pressing Reset button on the back 4. Release Restart button when Power LED starts blinking
To revert back to OEM firmware: The return to the OEM firmware is carried out by using the methods described above with the help of the appropriate firmware image.
When using OEM bootloader, the firmware image size cannot exceed the size of one OEM «Firmware_x» partition or Kernel + rootFS size.
The MT7628 programing guide shows that the correct DTOC unit is 1048576 clocks instead of 65536 clocks. This value is also used by linux upstream mtk-sd driver. Correct the DTOC register and also round up its value.
The High-Speed SD mode stability issue should have been fixed. Increase the MMC max-frequency to improve the IO speed. We can still use the sysfs to limit the clock frequency, e.g.
Specifications: SoC: MediaTek MT7981B RAM: 1024MiB Flash: SPI-NAND 128 MiB Switch: 1 WAN, 4 LAN (Gigabit) USB: two M.2 slots for 5G modems via USB 3.0 hub, external USB 3.0 port Buttons: Reset, Mesh Power: DC 12V 1A WiFi: MT7976CN UART: 115200n8 UART Layout: VCC-RX-TX-GND
Installation: 1. Power down the router and hold in the Reset button. 2. While holding in the button power up the router again. 3. Hold the button in for 10 seconds and then release. 4. Use your browser to go to 192.168.1.1 5. If you see a GUI that is for flashing firmware then you have the V2 model. If there is no GUI and the router continues to boot up normally you have the V1 model. 6. Now use the V2 sysugrade file.
Note: Recovery GUI it can be used to recover from an incorrect firmware flash.
Based on patches adding support for this device by Yannick Chabanois (openmptcprouter) and Dairyman (ofmodemsandmen)
libs/slang2 is getting picked up from the packages feed, if the slang2 is compiled first and then if you try to compile perf, it fails due to unmet dependency.
Fixes: Package perf is missing dependencies for the following libraries: libslang.so.2
Release notes: https://cmake.org/cmake/help/latest/release/3.31.html No need refresh patch
Signed-off-by: Jack Sun <sunjiazheng321521@gmail.com> Link: https://github.com/openwrt/openwrt/pull/17814 Signed-off-by: Nick Hainke <vincent@systemli.org> (commit: 2f85dc2)
realtek: add new i2c-gpio-shared driver for shared SCL lines
Some Realtek switches have been designed with I2C busses that share a single SCL line. The clock line is used for 2 or more busses. This cannot be used with the standard i2c-gpio driver that relies on distinct SDA and SCL pairs.
Provide a derived i2c-gpio-shared driver that can be used instead. This driver can handle up to 4 busses with only a single clock line.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/18737 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: acd7ecc)
Currently only RTL83xx devices are known with shared SCL pins. So activate the driver only for those targets.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/18737 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 5b8155d)
realtek: switch LGS310C devicetree to new i2s-gpio-shared driver
From now on both SFP ports can be used without manual intervention.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/18737 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: c131870)
Changelog can be found in NEWS.md in relevant tags.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com> Link: https://github.com/openwrt/openwrt/pull/19145 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 0bca244)
iproute2: point KERNEL_INCLUDE to toolchain headers
Glibc since 2.41 tries to include linux/sched/types.h from sched.h, and pointing KERNEL_INCLUDE to the kernel headers makes it use linux/sched/types.h from the kernel headers instead of the installed one.
This then breaks the configure (test) compile for setns() and the test:
mips-openwrt-linux-gnu-gcc -I/fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi -o config.HaAJYe/setnstest config.HaAJYe/setnstest.c In file included from /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/sched/types.h:5, from /fork.openwrt/staging_dir/toolchain-mips_24kc_gcc-14.3.0_glibc/include/bits/sched.h:63, from /fork.openwrt/staging_dir/toolchain-mips_24kc_gcc-14.3.0_glibc/include/sched.h:43, from config.HaAJYe/setnstest.c:2: /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders" [-Wcpp] 10 | #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders" | ^~~~~~~ In file included from /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/posix_types.h:5, from /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/types.h:14: /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/stddef.h:5:10: fatal error: linux/compiler_types.h: No such file or directory 5 | #include <linux/compiler_types.h> | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
Fix this by pointing KERNEL_INCLUDE to the toolchain headers, which include the installed kernel headers.
Tested with musl, glibc, and SDK.
Fixes: 60738feded ("iproute2: Fix KERNEL_INCLUDE in SDK") Reported-by: Signed-off-by: Konstantin Demin <rockdrilla@gmail.com> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> (commit: d015a39)
ramips: PCIe driver improvements for mt7620 and mt7628
This patchset fixes some PCIe bridge register access issues and reworks the initialization procedure. It may bring some stability improvements. To match the driver changes, the memory remap range was extended and a PCIe reset pinctrl was added to mt7628an.dtsi.