]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: mt7621: add Teltonika RUTM30/RUTM31 support
authorSimonas Tamošaitis <simsasss@gmail.com>
Mon, 18 Aug 2025 19:23:27 +0000 (22:23 +0300)
committerDavid Bauer <mail@david-bauer.net>
Tue, 19 May 2026 22:02:31 +0000 (00:02 +0200)
Specifications:
- MediaTek MT7621AT SoC
- 256 MB RAM
- 16MB SPI NOR Flash
- 256MB NAND (split in half for firmware fallback)
- 2x 10/100/1000 Mbps Ethernet, with passive PoE support on LAN
- WLAN      : MediaTek dual-band WiFi 5
  - 2.4 GHz : b/g/n, MIMO 2x2
  - 5 GHz   : n/ac, MIMO 2x2
- Quectel RG520N-EB 5G R16 modem (RUTM30) or RG500U-EB 5G (RUTM31)
- 1x Digital input
- 1x Digital output
- 2x SIM slot (can be swapped via AT commands)
- eSIM
- TPM

GPIO:
- 1 button (Reset)
- 3 LEDs (power, 2 RGB)
- 3 Modem control (power button, reset, eSIM switch)
- 1 Digital input
- 1 Digital output
- 1 TPM enable

Installation
------------
Notice: update OEM firmware to 7.19 or later, earlier versions will
fail to flash openwrt factory firmware.

1. Check from which partition the device is currently running from

  $ cat /proc/bootconfig/chosen

  In case this output reads rutos-b, install a software update from
  Teltonika first. After upgrade completion, check this file now reads
  rutos-a before continuing.

2. Download the *-squashfs-factory.bin firmware image
3. Flash firmware image via WEB interface

To revert back to OEM firmware:
https://wiki.teltonika-networks.com/view/Bootloader_menu

Mobile connection:
- RG520N-EB:
    Use "ModemManager" to establish mobile data connection.
- RG500U-EB:
    echo -ne 'AT+QNETDEVCTL=1,3,1\r\n' > /dev/ttyUSB2
    Create DHCP interface with usb0 device.

Signed-off-by: Simonas Tamošaitis <simsasss@gmail.com>
target/linux/ramips/dts/mt7621_teltonika_rutm30.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/board.d/03_gpio_switches
target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh

diff --git a/target/linux/ramips/dts/mt7621_teltonika_rutm30.dts b/target/linux/ramips/dts/mt7621_teltonika_rutm30.dts
new file mode 100644 (file)
index 0000000..4d9167d
--- /dev/null
@@ -0,0 +1,183 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_teltonika_rutm-common.dtsi"
+
+/ {
+       compatible = "teltonika,rutm30", "mediatek,mt7621-soc";
+       model = "Teltonika RUTM30/RUTM31";
+
+       gpio_spi {
+               compatible = "spi-gpio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               sck-gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
+               mosi-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+               num-chipselects = <1>;
+
+               gpio_hc595: gpio_hc595@0 {
+                       compatible = "fairchild,74hc595";
+                       reg = <0>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       registers-number = <2>;
+                       spi-max-frequency = <10000000>;
+                       enable-gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-export {
+               compatible = "gpio-export";
+
+               gpio_modem_reset {
+                       gpio-export,name = "modem_reset";
+                       gpio-export,output = <0>;
+                       gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
+               };
+
+               gpio_modem_power {
+                       gpio-export,name = "modem_power";
+                       gpio-export,output = <0>;
+                       gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
+               };
+
+               gpio_esim_select {
+                       gpio-export,name = "esim_select";
+                       gpio-export,output = <0>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
+               };
+
+               gpio_tpm_enable {
+                       gpio-export,name = "tpm_enable";
+                       gpio-export,output = <1>;
+                       gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               gsm_red {
+                       function = LED_FUNCTION_MOBILE;
+                       color = <LED_COLOR_ID_RED>;
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+               };
+
+               gsm_green {
+                       function = LED_FUNCTION_MOBILE;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+               };
+
+               gsm_blue {
+                       function = LED_FUNCTION_MOBILE;
+                       color = <LED_COLOR_ID_BLUE>;
+                       gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
+               };
+
+               rssi_red {
+                       label = "red:rssi";
+                       color = <LED_COLOR_ID_RED>;
+                       gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
+               };
+
+               rssi_green {
+                       label = "green:rssi";
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&gpio 48 GPIO_ACTIVE_LOW>;
+               };
+
+               rssi_blue {
+                       label = "blue:rssi";
+                       color = <LED_COLOR_ID_BLUE>;
+                       gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
+               };
+
+               lan-g {
+                       function = LED_FUNCTION_LAN;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "mt7530-0:01:1Gbps";
+               };
+
+               lan-y {
+                       function = LED_FUNCTION_LAN;
+                       color = <LED_COLOR_ID_AMBER>;
+                       gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "mt7530-0:01:100Mbps";
+               };
+
+               wan-g {
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&gpio 41 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "mt7530-0:00:1Gbps";
+               };
+
+               wan-y {
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_AMBER>;
+                       gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "mt7530-0:00:100Mbps";
+               };
+       };
+};
+
+&switch0 {
+       ports {
+               port@1 {
+                       status = "okay";
+                       label = "lan";
+               };
+       };
+};
+
+&i2c {
+       status = "okay";
+
+       tpm: tpm@2e {
+               compatible = "infineon,slb9673";
+               reg = <0x2e>;
+               status = "okay";
+       };
+};
+
+&gmac1 {
+       phy-handle = <&ethphy0>;
+};
+
+&ethphy0 {
+       /delete-property/ interrupts;
+};
+
+&pcie {
+       status = "okay";
+};
+
+&pcie0 {
+       wifi@0,0 {
+               compatible = "mediatek,mt76";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&eeprom_factory_0>;
+               nvmem-cell-names = "eeprom";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               led {
+                       status = "disabled";
+               };
+
+               band@0 {
+                       reg = <0>;
+                       nvmem-cells = <&macaddr_config_0 2>;
+                       nvmem-cell-names = "mac-address";
+               };
+
+               band@1 {
+                       reg = <1>;
+                       nvmem-cells = <&macaddr_config_0 3>;
+                       nvmem-cell-names = "mac-address";
+               };
+       };
+};
index a5d6d0404d2ac637ad31339223d7e86a883aa199..323fd0bcc87b719f6df2c7f065a2f9a7ca8039e4 100644 (file)
@@ -2891,6 +2891,15 @@ define Device/teltonika_rutm50
 endef
 TARGET_DEVICES += teltonika_rutm50
 
+define Device/teltonika_rutm30
+  $(Device/teltonika_rutm_common)
+  DEVICE_MODEL := RUTM30
+  DEVICE_ALT0_VENDOR := Teltonika
+  DEVICE_ALT0_MODEL := RUTM31
+  DEVICE_PACKAGES += kmod-usb-net-qmi-wwan kmod-usb-net-cdc-ncm
+endef
+TARGET_DEVICES += teltonika_rutm30
+
 define Device/thunder_timecloud
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
index 4ec75e702b06ed6cc11972b233dcd3258aca0449..8aa9c7b8f4dff31ab5d59f5830b08c88328e9196 100644 (file)
@@ -87,6 +87,7 @@ ramips_setup_interfaces()
        maginon,mc-1200ac|\
        meig,slt866|\
        openfi,5pro|\
+       teltonika,rutm30|\
        wavlink,ws-wn572hp3-4g|\
        winstars,ws-wn583a6|\
        yuncore,ax820|\
index 4c1f3835b4b92fab546d69d81779ff9db934e0ca..9ff446668a20efd6ad068bc5440782bcfec11d6b 100644 (file)
@@ -12,6 +12,7 @@ mikrotik,routerboard-760igs)
 telco-electronics,x1)
        ucidef_add_gpio_switch "modem_reset" "Modem Reset" "528"
        ;;
+teltonika,rutm30|\
 teltonika,rutm50)
        ucidef_add_gpio_switch "modem_power" "Modem power button" "modem_power" "1"
        ucidef_add_gpio_switch "modem_reset" "Modem reset" "modem_reset" "0"
index 00830ee876d9187594843ad258890120e9b84a0a..727527955183120a845e5ee7d8203048e751586d 100755 (executable)
@@ -49,6 +49,7 @@ boot() {
                [ $(printf %d $(fw_printenv -n Image1Stable)) -gt 0 ] || fw_setenv Image1Stable 1
                [ $(printf %d $(fw_printenv -n Image1Try)) -gt 0 ] && fw_setenv Image1Try 0
                ;;
+       teltonika,rutm30|\
        teltonika,rutm50)
                #Bootloader expect successfull startup value after update, we need to write success value to bootconfig partition
                #otherwise bootloader will fallback to previous root partition
index 0439c494daba19f34551cd03fa892e19532fe80b..4af3db4f3fabc5f234c8f4b588e2bc80c8b3cc51 100644 (file)
@@ -230,6 +230,7 @@ platform_do_upgrade() {
                zyxel_mstc_upgrade_prepare
                nand_do_upgrade "$1"
                ;;
+       teltonika,rutm30|\
        teltonika,rutm50)
                CI_UBIPART="$(cmdline_get_var ubi.mtd)"
                nand_do_upgrade "$1"