]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: Add support for Genexis / Inteno Pulse EX400
authorAndreas Gnau <andreas.gnau@iopsys.eu>
Tue, 7 Jan 2025 22:55:12 +0000 (23:55 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 13 Mar 2025 20:33:46 +0000 (21:33 +0100)
Add support for Genexis Pulse EX400 / Inteno Pulse EX400. A branded
variant for the Finnish ISP DNA has already been added in fea2264d9fdd
(ramips: mt7621: Add DNA Valokuitu Plus EX400, 2023-07-31). This commit
adds support for the generic variants with Inteno and Genexis branding.
Inteno changed its name to Genexis and both brandings exist.

In terms of electronics, there is no difference between the DNA-branded
version and other brandings. LED markings on the case are different,
though. While the DNA-version has a "software-update" LED, the other
versions have a WPS LED. To reduce user confusion, create a separate
image.

Add the different device-tree with the different LED and rename things
to work the same way for both variants.

Specifications:
- Device: Genexis Pulse EX400 / Inteno Pulse EX400
- SoC: MT7621A
- Flash: 256 MB NAND
- RAM: 256 MB
- Ethernet: Built-in, 2 x 1 GbE
- Wifi: MT7603 2.4 GHz 2x2 MIMO, MT7615 5 GHz 4x4 MU-MIMO
- USB: 1x 2.0
- LEDs (GPIO): green/red status, green WPS
- LEDs (SX9512, unsupported): Broadband, Wi-Fi 2.4G, Wi-Fi 5G
- Buttons (GPIO): Reset
- Buttons (SX9512, unsupported): Wi-Fi 2.4G, Wi-Fi 5G, WPS

MAC addresses:
- LAN:     U-Boot 'ethaddr' (label)
- WAN:     label + 1
- 2.4 GHz: label + 6
- 5 GHz:   label + 7

Serial:
 There is a black block connector next to the red ethernet connector. It
 is accessible also through holes in the casing.

Pinout (TTL 3.3V)
 +---+---+
 |Tx |Rx |
 +---+---+
 |Vcc|Gnd|
 +---+---+

Firmware:
 The vendor firmware is a fork of OpenWrt (Reboot) with a kernel version
 4.4.93. The flash is arranged as below and there is a dual boot
 mechanism alternating between rootfs_0 and rootfs_1.

 +-------+------+------+-----------+-----------+
 |       | env1 | env2 | rootfs_0  |  rootfs_1 |
 |       +------+------+-----------+-----------+
 |       |         UBI volumes                 |
 +-------+-------------------------------------+
 |U-Boot |             UBI                     |
 +-------+-------------------------------------+
 |mtd0   |             mtd1                    |
 +-------+-------------------------------------+
 |                     NAND                    |
 +---------------------------------------------+

 In OpenWrt rootfs_0 will be used as a boot partition that will contain the
 kernel and the dtb. The squashfs rootfs and overlay are standard OpenWrt
 behaviour.

 +-------+------+------+-----------+--------+------------+
 |       | env1 | env2 | rootfs_0  | rootfs | rootfs_data|
 |       +------+------+-----------+--------+------------+
 |       |         UBI volumes                           |
 +-------+-----------------------------------------------+
 |U-Boot |             UBI                               |
 +-------+-----------------------------------------------+
 |mtd0   |             mtd1                              |
 +-------+-----------------------------------------------+
 |                     NAND                              |
 +-------------------------------------------------------+

U-boot:
 With proper serial access, booting can be halted to U-boot by pressing
 any key. TFTP and flash writes are available, but only the first one has
 been tested.

 NOTE: Recovery mode can be accessed by holding down the reset button while
 powering on the device. The led 'Update' will show a solid green light
 once ready. A web server will be running at 192.168.1.1:80 and it will
 allow flashing a firmware package. You can cycle between rootfs_0 and
 rootfs_1 by pressing the reset button once.

Root password:
 With the vendor web UI create a backup of your settings and download the
 archive to your computer. Within the archive in the file
 /etc/shadow replace the password hash for root with that of a password you
 know. Restore the configuration with the vendor web UI and you will have
 changed the root password.

SSH access:
 You might need to enable the SSH service for LAN interface as by default
 it's enabled for WAN only.

Installing OpenWrt:
 With the vendor web UI, or from the U-Boot recovery UI, install the
 OpenWrt factory image. Alternatively, ssh to the device and use
 sysupgrade -n from cli.

 Finalize by installing the OpenWrt sysupgrade image to get a fully
 functioning system.

Reverting to the vendor firmware:

 Boot with OpenWrt initramfs image
  - Remove volumes rootfs_0, rootfs and rootfs_data and create vendor
    volumes.

    ubirmvol /dev/ubi0 -n 2
    ubirmvol /dev/ubi0 -n 3
    ubirmvol /dev/ubi0 -n 4
    ubimkvol /dev/ubi0 -N rootfs_0 -S 990
    ubimkvol /dev/ubi0 -N rootfs_1 -S 990

    Power off and enter to the U-boot recovery to install the vendor
    firmware.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/17551
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/boot/uboot-envtools/files/ramips
target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts
target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi
target/linux/ramips/dts/mt7621_genexis_pulse-ex400.dts [new file with mode: 0644]
target/linux/ramips/image/mt7621.mk
target/linux/ramips/mt7621/base-files/etc/board.d/02_network
target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh [moved from target/linux/ramips/mt7621/base-files/lib/upgrade/dna.sh with 79% similarity]
target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh

index c1633e2cacbc3a2e7ba214643380cd1409450012..326524fba7727f3f0987c9b70a61ab2c37b1df8d 100644 (file)
@@ -149,7 +149,8 @@ xiaomi,mi-router-cr6608|\
 xiaomi,mi-router-cr6609)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
        ;;
-dna,valokuitu-plus-ex400)
+dna,valokuitu-plus-ex400|\
+genexis,pulse-ex400)
        ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
        ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
        ;;
index 9bbe91beef04a7ff8f000fe6cbb9d33021e86b69..e06da71d76fca4960b8e6282bd60aa240a1827ce 100644 (file)
@@ -5,4 +5,19 @@
 / {
        compatible = "dna,valokuitu-plus-ex400", "mediatek,mt7621-soc";
        model = "DNA Valokuitu Plus EX400";
+
+       aliases {
+               led-boot = &led_status_red;
+               led-failsafe = &led_status_red;
+               led-running = &led_status_green;
+               led-upgrade = &led_update_green;
+       };
+};
+
+&leds {
+               led_update_green: led-2 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_PROGRAMMING;
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+               };
 };
index dddc381fe8b8ae96501d79e73e6125edf167dc58..a3bc70e8cefed6612d79b6db728c9547d6a6dfb5 100644 (file)
        aliases {
                ethernet0 = &gmac0;
                label-mac-device = &gmac0;
-               led-boot = &led_status_red;
-               led-failsafe = &led_status_red;
-               led-running = &led_status_green;
-               led-upgrade = &led_update_green;
        };
 
        chosen {
@@ -30,7 +26,7 @@
                };
        };
 
-       leds {
+       leds: leds {
                compatible = "gpio-leds";
 
                led_status_green: led-0 {
                        function = LED_FUNCTION_STATUS;
                        gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
                };
-
-               led_update_green: led-2 {
-                       color = <LED_COLOR_ID_GREEN>;
-                       function = LED_FUNCTION_PROGRAMMING;
-                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
-               };
        };
 };
 
diff --git a/target/linux/ramips/dts/mt7621_genexis_pulse-ex400.dts b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400.dts
new file mode 100644 (file)
index 0000000..2ec6498
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_genexis_pulse-ex400-common.dtsi"
+
+/ {
+       compatible = "genexis,pulse-ex400", "mediatek,mt7621-soc";
+       model = "Genexis/Inteno Pulse EX400";
+
+       aliases {
+               led-boot = &led_status_red;
+               led-failsafe = &led_status_red;
+               led-running = &led_status_green;
+               led-upgrade = &led_status_red;
+       };
+};
+
+&leds {
+       led_wps_green: led-2 {
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_WPS;
+               gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+       };
+};
index 1f04dbdef69ae98ca1526dfd368ca6f2b83c0b2b..370b20a7832dc48c78bfbbe35a62b312bf0a852c 100755 (executable)
@@ -51,7 +51,7 @@ define Build/arcadyan-trx
        rm $@.hsqs $@.tail
 endef
 
-define Build/dna-header
+define Build/inteno-y3-header
        BC='$(STAGING_DIR_HOST)/bin/bc' ;\
        ubifsofs="1024" ;\
        ubifs="$$(stat -c%s $@)" ;\
@@ -91,7 +91,7 @@ define Build/dna-header
        mv $@.tmp $@
 endef
 
-define Build/dna-bootfs
+define Build/inteno-bootfs
        mkdir -p $@.ubifs-dir/boot
 
        # populate the boot fs with the dtb and the kernel image
@@ -1085,23 +1085,11 @@ define Device/d-team_pbr-m1
 endef
 TARGET_DEVICES += d-team_pbr-m1
 
+# Branded version of Genexis / Inteno EX400 (difference is one LED)
 define Device/dna_valokuitu-plus-ex400
-  $(Device/dsa-migration)
-  IMAGE_SIZE := 117m
-  PAGESIZE := 2048
-  MKUBIFS_OPTS := --min-io-size=$$(PAGESIZE) --leb-size=124KiB --max-leb-cnt=96 \
-       --log-lebs=2 --space-fixup --squash-uids
+  $(Device/genexis_pulse-ex400/common)
   DEVICE_VENDOR := DNA
   DEVICE_MODEL := Valokuitu Plus EX400
-  KERNEL := kernel-bin | lzma | uImage lzma
-  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
-  IMAGES += factory.bin
-  IMAGE/factory.bin := append-image-stage initramfs-kernel.bin | \
-       dna-bootfs | dna-header | append-md5sum-ascii-salted
-  IMAGE/sysupgrade.bin := append-kernel | dna-bootfs | \
-       sysupgrade-tar kernel=$$$$@ | check-size | append-metadata
-  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(2)
-  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3
 endef
 TARGET_DEVICES += dna_valokuitu-plus-ex400
 
@@ -1406,6 +1394,33 @@ define Device/gemtek_wvrtm-130acn
 endef
 TARGET_DEVICES += gemtek_wvrtm-130acn
 
+# Common definitions shared between genexis_pulse-ex400 and dna_valokuitu-plus-ex400
+define Device/genexis_pulse-ex400/common
+  $(Device/dsa-migration)
+  IMAGE_SIZE := 117m
+  PAGESIZE := 2048
+  MKUBIFS_OPTS := --min-io-size=$$(PAGESIZE) --leb-size=124KiB --max-leb-cnt=96 \
+    --log-lebs=2 --space-fixup --squash-uids
+  KERNEL := kernel-bin | lzma | uImage lzma
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
+  IMAGES += factory.bin
+  IMAGE/factory.bin := append-image-stage initramfs-kernel.bin | \
+       inteno-bootfs | inteno-y3-header | append-md5sum-ascii-salted
+  IMAGE/sysupgrade.bin := append-kernel | inteno-bootfs | \
+    sysupgrade-tar kernel=$$$$@ | check-size | append-metadata
+  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(2)
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3
+endef
+
+define Device/genexis_pulse-ex400
+  $(Device/genexis_pulse-ex400/common)
+  DEVICE_VENDOR := Genexis
+  DEVICE_MODEL := Pulse EX400
+  DEVICE_ALT0_VENDOR := Inteno
+  DEVICE_ALT0_MODEL := Pulse EX400
+endef
+TARGET_DEVICES += genexis_pulse-ex400
+
 define Device/glinet_gl-mt1300
   $(Device/dsa-migration)
   IMAGE_SIZE := 32448k
index dfb139db4eade2843dd1bb35dc2c831647d43591..2374d5f60a28be0fbbd81d0f2382f7b538f4a145 100644 (file)
@@ -73,6 +73,7 @@ ramips_setup_interfaces()
        cudy,m1300-v2|\
        cudy,m1800|\
        dna,valokuitu-plus-ex400|\
+       genexis,pulse-ex400|\
        humax,e10|\
        keenetic,kn-3510|\
        meig,slt866|\
index b83223e7ddd7571e385750444d7be1e8ebec5449..2c88d68051854a8c452e8f496718f5f1007fd804 100755 (executable)
@@ -32,7 +32,8 @@ boot() {
        samknows,whitebox-v8)
                fw_setenv bootcount 0
                ;;
-       dna,valokuitu-plus-ex400)
+       dna,valokuitu-plus-ex400|\
+       genexis,pulse-ex400)
                fw_setenv boot_cnt_primary 0
                fw_setenv boot_cnt_alt 0
                ;;
similarity index 79%
rename from target/linux/ramips/mt7621/base-files/lib/upgrade/dna.sh
rename to target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh
index d699516ff6f2d519100b5ca979518a28da82da14..677000f6b1aef7223e98aeb9ec000281af0722ed 100644 (file)
 . /lib/functions.sh
 . /lib/upgrade/nand.sh
 
-dna_do_upgrade () {
-       tar -xaf $1
+inteno_do_upgrade () {
+       local tar_file=$1
+       local cmd=cat
+       # WARNING: This fails if tar contains more than one 'sysupgrade-*' directory.
+       local board_dir="$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$')"
+       board_dir="${board_dir%/}"
+       tar -xaf "$tar_file"
 
        # get the size of the new bootfs
-       local _bootfs_size=$(wc -c < ./sysupgrade-dna_valokuitu-plus-ex400/kernel)
+       local _bootfs_size=$(wc -c < "$board_dir/kernel")
        [ -n "$_bootfs_size" -a "$_bootfs_size" -gt "0" ] || nand_do_upgrade_failed
 
        # remove existing rootfses and recreate rootfs_0
@@ -32,7 +37,7 @@ dna_do_upgrade () {
 
        # update the rootfs_0 contents
        local _kern_ubivol=$( nand_find_volume "ubi0" "rootfs_0" )
-       ubiupdatevol /dev/${_kern_ubivol} sysupgrade-dna_valokuitu-plus-ex400/kernel
+       ubiupdatevol "/dev/$_kern_ubivol" "$board_dir/kernel"
 
        fw_setenv root_vol rootfs_0
        fw_setenv boot_cnt_primary 0
index f2325c83254c8e2d3cc7653df722820917b2ab2c..fabaa6ccfb134abca99746e23dae43ba5d233420 100755 (executable)
@@ -157,8 +157,9 @@ platform_do_upgrade() {
        buffalo,wsr-2533dhpls)
                buffalo_do_upgrade "$1"
                ;;
-       dna,valokuitu-plus-ex400)
-               dna_do_upgrade "$1"
+       dna,valokuitu-plus-ex400|\
+       genexis,pulse-ex400)
+               inteno_do_upgrade "$1"
                ;;
        elecom,wrc-x1800gs)
                [ "$(fw_printenv -n bootmenu_delay)" != "0" ] || \