--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7628an_teltonika_rut9xx.dtsi"
+
+/ {
+ compatible = "teltonika,rut976", "mediatek,mt7628an-soc";
+ model = "Teltonika RUT976";
+
+ gpio-export {
+ gpio_dcd {
+ gpio-export,name = "dcd";
+ gpio-export,output = <0>;
+ gpios = <&gpio_hc595 14 GPIO_ACTIVE_HIGH>;
+ };
+
+ gpio_din2 {
+ gpio-export,name = "digital_input2";
+ gpio-export,input = <0>;
+ gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
+ };
+
+ gpio_output2 {
+ gpio-export,name = "digital_output2";
+ gpio-export,output = <0>;
+ gpios = <&gpio_hc595 8 GPIO_ACTIVE_HIGH>;
+ };
+
+ gpio_relay {
+ gpio-export,name = "relay";
+ gpio-export,output = <0>;
+ gpios = <&gpio_hc595 9 GPIO_ACTIVE_HIGH>;
+ };
+
+ gpio_rs485_rx_en {
+ gpio-export,name = "rs485_rx_enable";
+ gpio-export,output = <0>;
+ gpios = <&gpio_hc595 13 GPIO_ACTIVE_HIGH>;
+ };
+
+ gpio_rs485_tx_en {
+ gpio-export,name = "rs485_tx_enable";
+ gpio-export,output = <0>;
+ gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
+ };
+
+ gpio_isolated_input {
+ gpio-export,name = "isolated_input";
+ gpio-export,input = <0>;
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&spi0 {
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <10000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x40000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "config";
+ reg = <0x040000 0x010000>;
+ read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_config_0: macaddr@0 {
+ reg = <0x0 0x6>;
+ compatible = "mac-base";
+ #nvmem-cell-cells = <1>;
+ };
+ };
+ };
+
+ partition@50000 {
+ label = "factory";
+ reg = <0x050000 0x030000>;
+ read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ eeprom_factory_0: eeprom@0 {
+ reg = <0x20000 0x400>;
+ };
+ };
+ };
+
+ partition@80000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x080000 0x1ed0000>;
+ };
+
+ partition@1f50000 {
+ label = "event-log";
+ reg = <0x1f50000 0xb0000>;
+ };
+ };
+ };
+};
+
+&i2c {
+ status = "okay";
+ hwmon@4d {
+ compatible = "mcp3221";
+ reg = <0x4d>;
+ reference-voltage-microvolt = <3300000>;
+ };
+
+ hwmon@48 {
+ compatible = "ti,tla2021";
+ reg = <0x48>;
+ };
+};
+
+&uart1 {
+ linux,rs485-enabled-at-boot-time;
+ rs485-rts-delay = <0 0>;
+ rs485-rx-during-tx;
+ status = "okay";
+};
endef
TARGET_DEVICES += teltonika_rut9x6
+define Device/teltonika_rut976
+ DEVICE_VENDOR := Teltonika
+ DEVICE_MODEL := RUT976
+ SUPPORTED_TELTONIKA_DEVICES := teltonika,rut976
+ SUPPORTED_TELTONIKA_HW_MODS := 2c7c_6005 TLA2021 CH343 esim ala440
+ IMAGE_SIZE := 31552k
+ BLOCKSIZE := 64k
+ DEVICE_PACKAGES := uqmi kmod-mt76x2 kmod-usb2 kmod-usb-ohci \
+ kmod-usb-serial-option kmod-spi-gpio kmod-gpio-nxp-74hc164 kmod-i2c-mt7628 \
+ kmod-hwmon-mcp3021 kmod-scsi-core kmod-usb-storage kmod-usb-acm kmod-usb-net-cdc-ether
+ IMAGES += factory.bin
+ IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+ append-rootfs | pad-rootfs | check-size | append-teltonika-metadata
+ IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size | append-metadata
+endef
+TARGET_DEVICES += teltonika_rut976
+
define Device/totolink_a3
IMAGE_SIZE := 7936k
UIMAGE_NAME := za3