Add support for Teltonika RUT104 3G HSUPA router.
This has been supported since about 20 years in the upstream Linux
kernel after initial contribution by Paulius Zaleckas from Teltonika.
It has some historical significance because I think it was one of the
first Teltonika Linux-based 3G routers.
Installation from scratch is done using the UART:
- UART soldering instructions with picture are available on the
Link: (see bottom of committ message).
- First *diet down* your OpenWrt build as minimal as you can,
I really mean this, delete everything you don't need. There
is not much RAM to go around.
- Extract the "factory" firmare which is essentially just a tar.gz
archive:
tar xvfz openwrt-gemini-generic-teltonika_rut104-squashfs-factory.bin
From the RedBoot menu:
- Do NOT UNDER ANY CIRCUMSTANCE try to use the "upgrade firmare" (Z)
alternative!
- Extract the three files zImage, rd.gz and hddapp.tgz from the archive.
- Put these three files in the root directory of your TFTP server
(usually /var/lib/tftpboot)
- Hit 6 and set up the IP address for your device (e.g. 169.254.1.2 if
you're using local link).
- Hit Y to "Upgrade Kernel", enter TFTP and your hosts IP number and
type zImage. The kernel should upload and flash.
- Hit R to "Upgrade Ramdisk", enter TFTP and your hosts IP number and
type rd.gz. The "ramdisk" (i.e. the second part of the kernel)
should upload and flash.
- Hit A to "Upgrade Application", enter TFTP and your hosts IP number
and type hddapp.tgz. The "application" (i.e. the root filesystem)
should upload and flash.
This has a 1024KB Kernel partition, just extend the existing Make
functions to handle also this. The initramfs is 0x500000 instead
of 0x600000 for this one so add a parameter explicitly parameterizing
the initramfs size.
Mark non-default due to the small RAM and flash on this device.
I currently have no idea how to actually talk to the modem on this
thing but it is probably using the high-speed "modem UART" of the
Gemini. I'd be willing to help whoever wants to experiment with
it.
Link: https://dflund.se/~triad/krad/teltonika/
Link: https://github.com/openwrt/openwrt/pull/22045
Signed-off-by: Linus Walleij <linusw@kernel.org>
--- /dev/null
+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"
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
$(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
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
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
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
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
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
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
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:
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
--- /dev/null
+ // 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
--- /dev/null
+From 1cf93e2435f0d7a7e8c9fd0d4355e6a521f72fc1 Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linusw@kernel.org>
+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 <linusw@kernel.org>
+---
+ 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";
+- };
+ };
+ };
--- /dev/null
+From 0b6bed71689664080e1e9ec95aecf45279dde6ee Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linusw@kernel.org>
+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 <linusw@kernel.org>
+---
+ 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 {