diff --git a/target/linux/ramips/dts/mt7621_teltonika_rutm11.dts b/target/linux/ramips/dts/mt7621_teltonika_rutm11.dts new file mode 100644 index 0000000000..c996d0db47 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_teltonika_rutm11.dts @@ -0,0 +1,247 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_teltonika_rutm-common.dtsi" + +/ { + compatible = "teltonika,rutm11", "mediatek,mt7621-soc"; + model = "Teltonika RUTM11"; + + 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 14 GPIO_ACTIVE_HIGH>; + }; + + gpio_modem_power { + gpio-export,name = "modem_power"; + gpio-export,output = <0>; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + + gpio_sim_select { + gpio-export,name = "sim_select"; + gpio-export,output = <0>; + gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + wan_sim1 { + function = "wan-sim1"; + color = ; + gpios = <&gpio 41 GPIO_ACTIVE_HIGH>; + }; + + wan_sim2 { + function = "wan-sim2"; + color = ; + gpios = <&gpio 43 GPIO_ACTIVE_HIGH>; + }; + + wan_eth { + function = "wan-eth"; + color = ; + gpios = <&gpio 45 GPIO_ACTIVE_HIGH>; + }; + + wan_wifi { + function = "wan-wifi"; + color = ; + gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; + }; + + wifi_2g { + function = LED_FUNCTION_WLAN_2GHZ; + color = ; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wifi_5g { + function = LED_FUNCTION_WLAN_5GHZ; + color = ; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + + 2G { + function = "2G"; + color = ; + gpios = <&gpio_hc595 8 GPIO_ACTIVE_HIGH>; + }; + + 3G { + function = "3G"; + color = ; + gpios = <&gpio_hc595 9 GPIO_ACTIVE_HIGH>; + }; + + 4G { + function = "4G"; + color = ; + gpios = <&gpio_hc595 10 GPIO_ACTIVE_HIGH>; + }; + + rssi1 { + function = "rssi-1"; + color = ; + gpios = <&gpio_hc595 11 GPIO_ACTIVE_HIGH>; + }; + + rssi2 { + function = "rssi-2"; + color = ; + gpios = <&gpio_hc595 12 GPIO_ACTIVE_HIGH>; + }; + + rssi3 { + function = "rssi-3"; + color = ; + gpios = <&gpio_hc595 13 GPIO_ACTIVE_HIGH>; + }; + + rssi4 { + function = "rssi-4"; + color = ; + gpios = <&gpio_hc595 14 GPIO_ACTIVE_HIGH>; + }; + + rssi5 { + function = "rssi-5"; + color = ; + gpios = <&gpio_hc595 15 GPIO_ACTIVE_HIGH>; + }; + + lan1-g { + function = LED_FUNCTION_LAN; + color = ; + function-enumerator = <1>; + gpios = <&gpio_hc595 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mt7530-0:00:1Gbps"; + }; + + lan1-y { + function = LED_FUNCTION_LAN; + color = ; + function-enumerator = <1>; + gpios = <&gpio_hc595 4 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mt7530-0:00:100Mbps"; + }; + + lan2-g { + function = LED_FUNCTION_LAN; + color = ; + function-enumerator = <2>; + gpios = <&gpio_hc595 1 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mt7530-0:01:1Gbps"; + }; + + lan2-y { + function = LED_FUNCTION_LAN; + color = ; + function-enumerator = <2>; + gpios = <&gpio_hc595 5 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mt7530-0:01:100Mbps"; + }; + + lan3-g { + function = LED_FUNCTION_LAN; + color = ; + function-enumerator = <3>; + gpios = <&gpio_hc595 2 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mt7530-0:02:1Gbps"; + }; + + lan3-y { + function = LED_FUNCTION_LAN; + color = ; + function-enumerator = <3>; + gpios = <&gpio_hc595 6 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mt7530-0:02:100Mbps"; + }; + + wan-g { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&gpio_hc595 3 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mt7530-0:04:1Gbps"; + }; + + wan-y { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&gpio_hc595 7 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mt7530-0:04:100Mbps"; + }; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + }; +}; + +&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>; + + 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"; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 323fd0bcc8..ce68c97cd7 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2900,6 +2900,13 @@ define Device/teltonika_rutm30 endef TARGET_DEVICES += teltonika_rutm30 +define Device/teltonika_rutm11 + $(Device/teltonika_rutm_common) + DEVICE_MODEL := RUTM11 + DEVICE_PACKAGES += kmod-usb-net-qmi-wwan kmod-usb-net-cdc-mbim +endef +TARGET_DEVICES += teltonika_rutm11 + define Device/thunder_timecloud $(Device/dsa-migration) $(Device/uimage-lzma-loader) 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 8aa9c7b8f4..9dd1ac121c 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 @@ -26,6 +26,7 @@ ramips_setup_interfaces() netgear,wax202|\ sim,simax1800t|\ sim,simax1800u|\ + teltonika,rutm11|\ tplink,mr600-v2-eu|\ xiaomi,mi-router-3-pro|\ xiaomi,mi-router-ac2100|\ diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches index 9ff446668a..3d9507377d 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches @@ -12,6 +12,7 @@ mikrotik,routerboard-760igs) telco-electronics,x1) ucidef_add_gpio_switch "modem_reset" "Modem Reset" "528" ;; +teltonika,rutm11|\ teltonika,rutm30|\ teltonika,rutm50) ucidef_add_gpio_switch "modem_power" "Modem power button" "modem_power" "1" 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 7275279551..1fa10b08d3 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -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,rutm11|\ teltonika,rutm30|\ teltonika,rutm50) #Bootloader expect successfull startup value after update, we need to write success value to bootconfig partition 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 4af3db4f3f..52617bc426 100644 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -230,6 +230,7 @@ platform_do_upgrade() { zyxel_mstc_upgrade_prepare nand_do_upgrade "$1" ;; + teltonika,rutm11|\ teltonika,rutm30|\ teltonika,rutm50) CI_UBIPART="$(cmdline_get_var ubi.mtd)"