diff --git a/target/linux/gemini/image/ImageInfo-teltonika_rut104 b/target/linux/gemini/image/ImageInfo-teltonika_rut104 new file mode 100644 index 0000000000..26a43f2339 --- /dev/null +++ b/target/linux/gemini/image/ImageInfo-teltonika_rut104 @@ -0,0 +1,18 @@ +UpgradeImages="zImage rd.gz hddapp.tgz" +Procduction="SL3512" +BOOT_VER="1.0.5" +FIRMWARE_VER="firmware-openwrt-DATESTR" +INTERNAL_FIRMWARE_VER="firmware-openwrt-DATESTR" +CONFIGURATION_VER="firmware-openwrt" +DESCRIPTION="Teltonika RUT104" +TSS="enabled" +DIRECT_MODE="disabled" +DEFAULT_LAN_IPADDR="192.168.1.1" +DEFAULT_LAN_NETMASK="255.255.255.0" +DEFAULT_LAN_BOOTPROTO="none" +DEFAULT_WAN_BOOTPROTO="dhcp" +DEFAULT_WAN_ENABLED="yes" +DEFAULT_WLAN_DEVICENAME="eth0" +VER_zImage="DATESTR" +VER_Ramdisk="DATESTR" +VER_hddapp="DATESTR" diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile index 49d42ac26a..e6ba8a1f55 100644 --- a/target/linux/gemini/image/Makefile +++ b/target/linux/gemini/image/Makefile @@ -112,8 +112,8 @@ define CreateStorlinkFactoryfile dd if=$(IMAGE_ROOTFS) >> $@-ramdisk $(STAGING_DIR_HOST)/bin/padjffs2 $(IMAGE_ROOTFS) -c 128 >> $@-ramdisk # Now rd.gz is too big so split off rd.gz and the tail into "hddapp.gz" - dd if=$@-ramdisk of=$@.tmp/rd.gz bs=1 count=6144k conv=sync - dd if=$@-ramdisk of=$@.tmp/hddapp.tgz bs=1 skip=6144k count=6144k conv=sync + dd if=$@-ramdisk of=$@.tmp/rd.gz bs=1 count=$(4) conv=sync + dd if=$@-ramdisk of=$@.tmp/hddapp.tgz bs=1 skip=$(4) count=$(5) conv=sync rm -f $@-ramdisk # Taglabel cp ./ImageInfo-$(1) $@.tmp/ImageInfo @@ -137,18 +137,27 @@ define CreateStorlinkSysupgradefile $(STAGING_DIR_HOST)/bin/padjffs2 $(IMAGE_ROOTFS) -c 128 >> $@ endef -# 2048k "Kern" partition +# 1024k "Kern" partition, 5120k "Ramdisk" partition +define Build/storlink-1024k-factory-image + $(call CreateStorlinkFactoryfile,$(1),1024k,1048064,5120k,1664k) +endef + +define Build/storlink-1024k-sysupgrade-image + $(call CreateStorlinkSysupgradefile,$(1),1024k) +endef + +# 2048k "Kern" partition, 6144k "Ramdisk" partition define Build/storlink-2048k-factory-image - $(call CreateStorlinkFactoryfile,$(1),2048k,2096640) + $(call CreateStorlinkFactoryfile,$(1),2048k,2096640,6144k,6144k) endef define Build/storlink-2048k-sysupgrade-image $(call CreateStorlinkSysupgradefile,$(1),2048k) endef -# 3072k "Kern" partition +# 3072k "Kern" partition, 6144k "Ramdisk" partition define Build/storlink-3072k-factory-image - $(call CreateStorlinkFactoryfile,$(1),3072k,3145216) + $(call CreateStorlinkFactoryfile,$(1),3072k,3145216,6144k,6144k) endef define Build/storlink-3072k-sysupgrade-image @@ -228,7 +237,6 @@ define Device/storlink-reference COMPILE/copy-kernel-$(1).bin := copy-kernel.bin IMAGES := factory.bin sysupgrade.bin FILESYSTEMS := squashfs - DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) endef define Device/itian_sq201 @@ -239,7 +247,8 @@ define Device/itian_sq201 IMAGE/factory.bin := storlink-2048k-factory-image $(1) IMAGE/sysupgrade.bin := storlink-2048k-sysupgrade-image $(1) |\ append-metadata - DEVICE_PACKAGES += kmod-rt61-pci kmod-usb2-pci kmod-dsa-vsc73xx-spi + DEVICE_PACKAGES += $(GEMINI_NAS_PACKAGES) kmod-rt61-pci \ + kmod-usb2-pci kmod-dsa-vsc73xx-spi endef TARGET_DEVICES += itian_sq201 @@ -251,6 +260,7 @@ define Device/raidsonic_ib-4210-b IMAGE/factory.bin := storlink-3072k-factory-image $(1) IMAGE/sysupgrade.bin := storlink-3072k-sysupgrade-image $(1) |\ append-metadata + DEVICE_PACKAGES += $(GEMINI_NAS_PACKAGES) endef TARGET_DEVICES += raidsonic_ib-4210-b @@ -262,6 +272,7 @@ define Device/raidsonic_ib-4220-b IMAGE/factory.bin := storlink-3072k-factory-image $(1) IMAGE/sysupgrade.bin := storlink-3072k-sysupgrade-image $(1) |\ append-metadata + DEVICE_PACKAGES += $(GEMINI_NAS_PACKAGES) endef TARGET_DEVICES += raidsonic_ib-4220-b @@ -273,10 +284,24 @@ define Device/storlink_sl93512r IMAGE/factory.bin := storlink-3072k-factory-image $(1) IMAGE/sysupgrade.bin := storlink-3072k-sysupgrade-image $(1) |\ append-metadata - DEVICE_PACKAGES += kmod-dsa-vsc73xx-spi + DEVICE_PACKAGES += $(GEMINI_NAS_PACKAGES) kmod-dsa-vsc73xx-spi endef TARGET_DEVICES += storlink_sl93512r +define Device/teltonika_rut104 + $(Device/storlink-reference) + # Only 32 MB of RAM and 8MB flash so not building by default + DEFAULT := n + DEVICE_VENDOR := Teltonika + DEVICE_MODEL := RUT104 + DEVICE_DTS := gemini-rut1xx + IMAGE/factory.bin := storlink-1024k-factory-image $(1) + IMAGE/sysupgrade.bin := storlink-1024k-sysupgrade-image $(1) |\ + append-metadata + DEVICE_PACKAGES += kmod-phy-micrel kmod-ath5k +endef +TARGET_DEVICES += teltonika_rut104 + define Device/verbatim_s08v1901_d1 $(Device/storlink-reference) DEVICE_VENDOR := Verbatim @@ -285,6 +310,7 @@ define Device/verbatim_s08v1901_d1 IMAGE/factory.bin := storlink-3072k-factory-image $(1) IMAGE/sysupgrade.bin := storlink-3072k-sysupgrade-image $(1) |\ append-metadata + DEVICE_PACKAGES += $(GEMINI_NAS_PACKAGES) endef TARGET_DEVICES += verbatim_s08v1901_d1 diff --git a/target/linux/gemini/image/copy-kernel/Makefile b/target/linux/gemini/image/copy-kernel/Makefile index befac6912a..c819f1fd1f 100644 --- a/target/linux/gemini/image/copy-kernel/Makefile +++ b/target/linux/gemini/image/copy-kernel/Makefile @@ -16,7 +16,7 @@ BIN_FLAGS := -O binary -S SRC_DIR := $(CURDIR)/ OUT_DIR := $(if $(O),$(if $(patsubst %/,,$(O)),$(O)/,$(O)),$(SRC_DIR)) -all: $(OUT_DIR)copy-kernel-2048k.bin $(OUT_DIR)copy-kernel-3072k.bin +all: $(OUT_DIR)copy-kernel-1024k.bin $(OUT_DIR)copy-kernel-2048k.bin $(OUT_DIR)copy-kernel-3072k.bin # Don't build dependencies, this may die if $(CC) isn't gcc dep: @@ -35,5 +35,6 @@ $(OUT_DIR)%.bin: $(OUT_DIR)%.o mrproper: clean clean: + rm -f $(OUT_DIR)copy-kernel-1024k.bin $(OUT_DIR)copy-kernel-1024k.o rm -f $(OUT_DIR)copy-kernel-2048k.bin $(OUT_DIR)copy-kernel-2048k.o rm -f $(OUT_DIR)copy-kernel-3072k.bin $(OUT_DIR)copy-kernel-3072k.o diff --git a/target/linux/gemini/image/copy-kernel/copy-kernel-1024k.S b/target/linux/gemini/image/copy-kernel/copy-kernel-1024k.S new file mode 100644 index 0000000000..cde68de49c --- /dev/null +++ b/target/linux/gemini/image/copy-kernel/copy-kernel-1024k.S @@ -0,0 +1,45 @@ + // Arm assembly to copy the Gemini kernel on Storlink reference + // designs and derived devices with the same flash layout and + // boot loader. + // + // This will execute at 0x01600000 + // + // Copies the kernel from two fragments (originally zImage + // and initramdisk) to 0x00400000 making space for a kernel + // image of up to 8 MB except for these 512 bytes used for + // this bootstrap. + // + // 0x01600200 .. 0x016fffff -> 0x00400000 .. 0x004ffdff + // 0x00800000 .. 0x00cfffff -> 0x004ffe00 .. 0x009ffdff + + // Memory used for this bootstrap + .equ BOOT_HEADROOM, 0x200 + + .global _start // Stand-alone assembly code +_start: + mov r1, #0x01600000 + mov r2, #0x00400000 + mov r3, #0x00100000 + add r1, r1, #BOOT_HEADROOM + sub r3, r3, #BOOT_HEADROOM +copyloop1: + ldr r0, [r1] + str r0, [r2] + add r1, r1, #4 + add r2, r2, #4 + sub r3, r3, #4 + cmp r3, #0 + bne copyloop1 + mov r1, #0x00800000 + mov r3, #0x00500000 +copyloop2: + ldr r0, [r1] + str r0, [r2] + add r1, r1, #4 + add r2, r2, #4 + sub r3, r3, #4 + cmp r3, #0 + bne copyloop2 + mov r0, #0x00400000 + // Let's go + mov pc, r0 diff --git a/target/linux/gemini/patches-6.12/0004-ARM-dts-gemini-Correct-the-RUT1xx.patch b/target/linux/gemini/patches-6.12/0004-ARM-dts-gemini-Correct-the-RUT1xx.patch new file mode 100644 index 0000000000..f958437c59 --- /dev/null +++ b/target/linux/gemini/patches-6.12/0004-ARM-dts-gemini-Correct-the-RUT1xx.patch @@ -0,0 +1,60 @@ +From 1cf93e2435f0d7a7e8c9fd0d4355e6a521f72fc1 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Sat, 14 Feb 2026 00:12:51 +0100 +Subject: [PATCH 1/2] ARM: dts: gemini: Correct the RUT1xx + +Fix two problems with the RUT1xx device tree: +- The memory is 32MB not 128MB +- The console is 19200 BPS +- Activate the PCI +- Disable the unused USB ports + +Signed-off-by: Linus Walleij +--- + arch/arm/boot/dts/gemini/gemini-rut1xx.dts | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +--- a/arch/arm/boot/dts/gemini/gemini-rut1xx.dts ++++ b/arch/arm/boot/dts/gemini/gemini-rut1xx.dts +@@ -14,13 +14,13 @@ + #address-cells = <1>; + #size-cells = <1>; + +- memory@0 { /* 128 MB */ ++ memory@0 { /* 32 MB */ + device_type = "memory"; +- reg = <0x00000000 0x8000000>; ++ reg = <0x00000000 0x2000000>; + }; + + chosen { +- bootargs = "console=ttyS0,115200n8"; ++ bootargs = "console=ttyS0,19200n8"; + stdout-path = &uart0; + }; + +@@ -113,6 +113,10 @@ + pinctrl-0 = <&gpio1_default_pins>; + }; + ++ pci@50000000 { ++ status = "okay"; ++ }; ++ + ethernet@60000000 { + status = "okay"; + +@@ -124,13 +128,5 @@ + /* Not used in this platform */ + }; + }; +- +- usb@68000000 { +- status = "okay"; +- }; +- +- usb@69000000 { +- status = "okay"; +- }; + }; + }; diff --git a/target/linux/gemini/patches-6.12/308-gemini-augment-RUT1xx-DTS-with-botched-partitions.patch b/target/linux/gemini/patches-6.12/308-gemini-augment-RUT1xx-DTS-with-botched-partitions.patch new file mode 100644 index 0000000000..9a6b749f7c --- /dev/null +++ b/target/linux/gemini/patches-6.12/308-gemini-augment-RUT1xx-DTS-with-botched-partitions.patch @@ -0,0 +1,58 @@ +From 0b6bed71689664080e1e9ec95aecf45279dde6ee Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Sat, 14 Feb 2026 00:21:13 +0100 +Subject: [PATCH 2/2] gemini: augment RUT1xx DTS with botched partitions + +Same botched partitions as the Raidsonic IB-4220-B. + +Signed-off-by: Linus Walleij +--- + arch/arm/boot/dts/gemini/gemini-rut1xx.dts | 37 +++++++++++++++++++++- + 1 file changed, 36 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/gemini/gemini-rut1xx.dts ++++ b/arch/arm/boot/dts/gemini/gemini-rut1xx.dts +@@ -74,7 +74,42 @@ + status = "okay"; + /* 8MB of flash */ + reg = <0x30000000 0x00800000>; +- /* TODO: add flash partitions here */ ++ /* ++ * Override the RedBoot partition table with fixed partitions ++ * in order to create a coherent "firmware" partition so that ++ * we can have optimal flash usage with OpenWrt in a big ++ * MTD-splitted "firmware" partition. ++ */ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ partition@0 { ++ label = "BOOT"; ++ reg = <0x00000000 0x00020000>; ++ read-only; ++ }; ++ partition@1 { ++ compatible = "openwrt,executable-prolog"; ++ label = "firmware"; ++ reg = <0x00020000 0x007a0000>; ++ }; ++ partition@2 { ++ label = "VCTL"; ++ reg = <0x007c0000 0x00010000>; ++ read-only; ++ }; ++ partition@3 { ++ label = "cfg"; ++ reg = <0x007d0000 0x00020000>; ++ read-only; ++ }; ++ partition@4 { ++ label = "FIS directory"; ++ reg = <0x007f0000 0x00010000>; ++ read-only; ++ }; ++ }; + }; + + syscon: syscon@40000000 {