diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 0b17a0c47e2..d6124745da9 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -148,7 +148,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" ;; diff --git a/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts b/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts index 9bbe91beef0..e06da71d76f 100644 --- a/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts +++ b/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts @@ -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 = ; + function = LED_FUNCTION_PROGRAMMING; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; }; diff --git a/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi index dddc381fe8b..a3bc70e8cef 100644 --- a/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi +++ b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi @@ -10,10 +10,6 @@ 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 { @@ -44,12 +40,6 @@ function = LED_FUNCTION_STATUS; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; }; - - led_update_green: led-2 { - color = ; - 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 index 00000000000..2ec64983227 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400.dts @@ -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 = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 02b09b3fe15..c1acada2fad 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -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 @@ -1058,23 +1058,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 @@ -1379,6 +1367,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 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 650fef62a84..af5e4a8403d 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -72,6 +72,7 @@ ramips_setup_interfaces() comfast,cf-ew72-v2|\ cudy,m1800|\ dna,valokuitu-plus-ex400|\ + genexis,pulse-ex400|\ humax,e10|\ keenetic,kn-3510|\ meig,slt866|\ diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index b83223e7ddd..2c88d680518 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -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 ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/dna.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh 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 d699516ff6f..677000f6b1a 100644 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/dna.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh @@ -16,11 +16,16 @@ . /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 diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 17532f795b2..33f8ccd4ce7 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -156,8 +156,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" ] || \