Hardware specification
----------------------
* RTL9301 SoC, 1 MIPS 34KEc core @ 800MHz
* 512MB DRAM
* 2MB NOR Flash
* 128MB NAND Flash
* 24 x 10/100/1000BASE-T ports with PoE+
* 4 x 10G SFP+ ports
* Power LED, Fault LED, PoE Max LED, LAN Mode LED, PoE Mode LED
* Reset button and LED Mode button on front panel
* LM63 Fan Controller
* UART (115200 8N1) via RJ45
* PSE: Nuvoton M0516LDE via I2C + 3x RTL8238B (not supported yet)
Installation using serial interface
-----------------------------------
1. Press "a" "c" "p" during message "Enter correct key to stop autoboot"
2. Start network "rtk network on"
3. Load image "tftpboot <TFTP IP>:openwrt-realtek-rtl930x_nand-linksys_lgs328mpc-v2-initramfs-kernel.bin"
4. Boot image "bootm"
5. Switch to first bootpartition "fw_setsys bootpartition 0"
6. Download sysupgrade "scp <IP>:openwrt-realtek-rtl930x_nand-linksys_lgs328mpc-v2-squashfs-sysupgrade.bin /tmp/."
7. Install sysupgrade "sysupgrade /tmp/openwrt-realtek-rtl930x_nand-linksys_lgs328mpc-v2-squashfs-sysupgrade.bin"
Installation using OEM webinterface
-----------------------------------
This is not possible because the OpenWrt NAND Flash layout is different
from the vendor layout. To be precise. Vendor uses:
- 64 MB vendor UBI root_data
- 32 MB vendor kernel+root 1 (~19 MB used)
- 32 MB vendor kernel+root 2 (~19 MB used)
OpenWrt uses:
- 64 MB vendor UBI (not touched)
- 10 MB OpenWrt kernel
- 22 MB Openwrt mtd-concat UBI
- 23 MB vendor kernel 2 (space reduced, vendor data unchanged)
- 09 MB OpenWrt mtd-concat UBI
Dual-boot with stock firmware using writable u-boot-env
-------------------------------------------------------
From stock to OpenWrt / primary image 1 (CLI as admin):
- > boot system image1
- > reboot
From OpenWrt to stock / boot image 2: (shell as root)
- # fw_setsys bootpartition 1
- # reboot
Debrick using serial interface
------------------------------
1. Press "a" "c" "p" during message "Enter correct key to stop autoboot"
2. Load vendor image with "upgrade runtime <TFTP IP>:LGS328xxxxx.imag"
3. switch to primary partition "setsys bootpartition 0"
4. safe config "savesys"
MAC Address Source
------------------
The MAC address for this device is coming from the u-boot-env ethaddr cell.
Further documentation
---------------------
See https://openwrt.org/toh/linksys/lgs352c
Signed-off-by: Jan-Henrik Bruhn <git@jhbruhn.de>
Link: https://github.com/openwrt/openwrt/pull/23466
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
edgecore,ecs4100-12ph|\
linksys,lgs310c|\
linksys,lgs328c|\
+ linksys,lgs328mpc-v2|\
linksys,lgs352c|\
netgear,gs108t-v3|\
netgear,gs110tpp-v1|\
echo 57000 > "$path_temp_hwmon/temp1_max_hyst"
}
+linksys_lgs328mpc_v2() {
+ # The U-Boot of this device does not set up the LM63 fan controller for us, so we do it ourselves:
+ # Let LM63 steer high/low speed full automatically, vendor defaults are 40C low->high and 31C high->low.
+ # For this, reduce PMW frequency as otherwise the fan won't start at low speeds.
+ # Temperature point 1 is set to 1C and a hysteresis of 9C gives 1C - 9C = -8C - most likely always on.
+ # Temperature point 2 is set to 40C and a hysteresis of 9C gives 40C - 9C = 31C.
+ # Other points must be monotonic for the kernel to accept auto mode.
+ local path_to_hwmon="$(find /sys/bus/i2c/devices/0-004c/hwmon/ -type d -maxdepth 1 -mindepth 1 -name 'hwmon*')"
+
+ [ -n "$path_to_hwmon" ] || return 0
+
+ # switch to manual mode, otherwise LUT is not writable
+ echo 1 > "$path_to_hwmon/pwm1_enable"
+ # Set PWM Frequency to 22Hz as otherwise the fan doesn't spin at low duty cycles.
+ echo 22 > "$path_to_hwmon/pwm1_freq"
+
+ echo 1000 > "$path_to_hwmon/pwm1_auto_point1_temp" # 1°C
+ echo 128 > "$path_to_hwmon/pwm1_auto_point1_pwm" # 50% fan speed
+ echo 40000 > "$path_to_hwmon/pwm1_auto_point2_temp" # 40°C
+ echo 255 > "$path_to_hwmon/pwm1_auto_point2_pwm" # 100% fan speed
+ echo 41000 > "$path_to_hwmon/pwm1_auto_point3_temp" # monotonically increasing entries so the driver accepts this LUT
+ echo 255 > "$path_to_hwmon/pwm1_auto_point3_pwm"
+ echo 42000 > "$path_to_hwmon/pwm1_auto_point4_temp"
+ echo 255 > "$path_to_hwmon/pwm1_auto_point4_pwm"
+ echo 43000 > "$path_to_hwmon/pwm1_auto_point5_temp"
+ echo 255 > "$path_to_hwmon/pwm1_auto_point5_pwm"
+ echo 44000 > "$path_to_hwmon/pwm1_auto_point6_temp"
+ echo 255 > "$path_to_hwmon/pwm1_auto_point6_pwm"
+ echo 45000 > "$path_to_hwmon/pwm1_auto_point7_temp"
+ echo 255 > "$path_to_hwmon/pwm1_auto_point7_pwm"
+ echo 46000 > "$path_to_hwmon/pwm1_auto_point8_temp"
+ echo 255 > "$path_to_hwmon/pwm1_auto_point8_pwm"
+
+ # set temperature hysteresis to 9K
+ echo 9000 > "$path_to_hwmon/pwm1_auto_point_temp_hyst"
+
+ # switch to automatic, LUT driven mode
+ echo 2 > "$path_to_hwmon/pwm1_enable"
+}
+
boot() {
case $(board_name) in
plasmacloud,esx28|\
d-link,dgs-1250-28x)
dlink_dgs_1250
;;
+ linksys,lgs328mpc-v2)
+ linksys_lgs328mpc_v2
+ ;;
esac
}
default_do_upgrade "$1"
;;
linksys,lgs328c|\
+ linksys,lgs328mpc-v2|\
linksys,lgs352c)
nand_do_upgrade "$1"
;;
--- /dev/null
+// SPDX-License-Identifier: (GPL-2.0-or-later or MIT)
+/dts-v1/;
+
+#include "rtl9301_linksys_lgs328x_nand_common.dtsi"
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+ compatible = "linksys,lgs328mpc-v2", "realtek,rtl9301-soc";
+ model = "Linksys LGS328MPC v2";
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_poe_mode: led-poe-mode {
+ function = "poe-mode";
+ color = <LED_COLOR_ID_GREEN>;
+ gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_poe_max: led-poe-max {
+ function = "poe-max";
+ color = <LED_COLOR_ID_AMBER>;
+ gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ led-mode {
+ label = "led-mode";
+ gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
+ linux,code = <BTN_0>;
+ debounce-interval = <60>;
+ };
+ };
+};
+
+&i2c_mst1 {
+ i2c1: i2c@1 {
+ reg = <1>;
+
+ lm63@4c {
+ compatible = "national,lm63";
+ reg = <0x4c>;
+ #thermal-sensor-cells = <1>;
+ };
+ };
+};
LINKSYS_MODEL := 60412040
endef
TARGET_DEVICES += linksys_lgs328c
+
+define Device/linksys_lgs328mpc-v2
+ $(Device/linksys_lgs328)
+ DEVICE_MODEL := LGS328MPC
+ DEVICE_VARIANT := v2
+ DEVICE_PACKAGES += kmod-hwmon-lm63
+ LINKSYS_MODEL := 60412060
+endef
+TARGET_DEVICES += linksys_lgs328mpc-v2