1
1

ramips: mt7621: add Teltonika RUTM30/RUTM31 support

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>
This commit is contained in:
Simonas Tamošaitis 2025-08-18 22:23:27 +03:00 committed by David Bauer
parent 2e7e9e827f
commit f970c4eefc
6 changed files with 196 additions and 0 deletions

View File

@ -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";
};
};
};

View 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)

View 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|\

View 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"

View File

@ -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

View 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"