[openwrt/openwrt] ramips: add support for MeiG SLT866 4G CPE

LEDE Commits lede-commits at lists.infradead.org
Sun Nov 12 16:58:27 PST 2023


dangole pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/b38b5c42997e527f91e653a4b6d77a5717d3cd14

commit b38b5c42997e527f91e653a4b6d77a5717d3cd14
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Tue Oct 24 18:05:28 2023 +0100

    ramips: add support for MeiG SLT866 4G CPE
    
    Hardware:
     - SoC: Mediatek MT7621 (MT7621AT)
     - Flash: 32 MiB SPI-NOR (Macronix MX25L25635E)
     - RAM: 128 MiB
     - Ethernet: Built-in, 2 x 1GbE
     - 3G/4G Modem: MEIG SLM828 (currently only supported with ModemManager)
     - SLIC: Si32185 (unsupported)
     - Power: 12V via barrel connector
     - Wifi 2.4GHz: Mediatek MT7603BE 802.11b/g/b
     - Wifi 5GHz: Mediatek MT7613BE 802.11ac/n/a
     - LEDs: 8x (7 controllable)
     - Buttons: 2x (RESET, WPS)
    
    Installing OpenWrt:
     - sysupgrade image is compatible with vendor firmware.
    
    Recovery:
     - Connect to any of the Ethernet ports, configure local IP:
       10.10.10.3/24 (or 192.168.10.19/24, depending on OEM)
     - Provide firmware file named 'mt7621.img' on TFTP server.
     - Hold down both, RESET and WPS, then power on the board.
     - Watch network traffic using tcpdump or wireshark in realtime to
       observe progress of device requesting firmware. Once download has
       completed, release both buttons and wait until firmware comes up.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
    (cherry picked from commit bc335f296740ac386e1ef09a49f1844419b0ccf9)
---
 target/linux/ramips/dts/mt7621_meig_slt866.dts     | 245 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  11 +
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   4 +
 .../mt7621/base-files/etc/board.d/02_network       |   3 +-
 4 files changed, 262 insertions(+), 1 deletion(-)

diff --git a/target/linux/ramips/dts/mt7621_meig_slt866.dts b/target/linux/ramips/dts/mt7621_meig_slt866.dts
new file mode 100644
index 0000000000..19d2f0f6fc
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_meig_slt866.dts
@@ -0,0 +1,245 @@
+#include "mt7621.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	compatible = "meig,slt866", "mediatek,mt7621-soc";
+	model = "MeiG SLT866";
+
+	aliases {
+		led-boot = &led_internet;
+		led-failsafe = &led_internet;
+		led-upgrade = &led_internet;
+		label-mac-device = &gmac1;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		signal4 {
+			label = "blue:signal4";
+			gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+		};
+
+		lanwan {
+			label = "blue:lanwan";
+			gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_internet: internet {
+			label = "blue:internet";
+			gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+		};
+
+		wifi {
+			label = "blue:wifi";
+			gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		signal3 {
+			label = "blue:signal3";
+			gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
+		};
+
+		signal2 {
+			label = "blue:signal2";
+			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
+		};
+
+		signal1 {
+			label = "blue:signal1";
+			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	regulator-pa-5g {
+		compatible = "regulator-fixed";
+		regulator-name = "pa-5g";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio 7 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "jtag", "uart2", "uart3", "wdt";
+		function = "gpio";
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		reg = <0>;
+		compatible = "jedec,spi-nor";
+		spi-max-frequency = <20000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "Bootloader";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "Config";
+				reg = <0x30000 0x10000>;
+			};
+
+			partition at 40000 {
+				label = "Factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+				compatible = "nvmem-cells";
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory_0: eeprom at 0 {
+						reg = <0x0 0x200>;
+					};
+
+					eeprom_factory_8000: eeprom at 8000 {
+						reg = <0x8000 0x4da8>;
+					};
+				};
+			};
+
+			partition at 50000 {
+				label = "firmware";
+				compatible = "denx,uimage";
+				reg = <0x50000 0xf90000>;
+			};
+
+			partition at fe0000 {
+				label = "m_custom";
+				reg = <0xfe0000 0x20000>;
+				read-only;
+				compatible = "nvmem-cells";
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					macaddr_custom_0: macaddr at 0 {
+						reg = <0x0 0xc>;
+						compatible = "mac-base";
+						#nvmem-cell-cells = <1>;
+					};
+
+					macaddr_custom_40: macaddr at 40 {
+						reg = <0x40 0xc>;
+						compatible = "mac-base";
+						#nvmem-cell-cells = <1>;
+					};
+
+					macaddr_custom_100: macaddr at 100 {
+						reg = <0x100 0xc>;
+						compatible = "mac-base";
+						#nvmem-cell-cells = <1>;
+					};
+
+					macaddr_custom_140: macaddr at 140 {
+						reg = <0x140 0xc>;
+						compatible = "mac-base";
+						#nvmem-cell-cells = <1>;
+					};
+				};
+			};
+
+			partition at 1000000 {
+				label = "fota_bak";
+				reg = <0x1000000 0x1000000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&ethernet {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mdio_pins>;
+};
+
+&gmac0 {
+	nvmem-cells = <&macaddr_custom_40 0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_custom_0 0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy at 4 {
+		reg = <4>;
+	};
+};
+
+&switch0 {
+	ports {
+		port at 3 {
+			status = "okay";
+			label = "lan";
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	mt76 at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&eeprom_factory_0>, <&macaddr_custom_100 0>;
+		nvmem-cell-names = "eeprom", "mac-address";
+	};
+};
+
+&pcie1 {
+	mt76 at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		ieee80211-freq-limit = <5000000 6000000>;
+		nvmem-cells = <&eeprom_factory_8000>, <&macaddr_custom_140 0>;
+		nvmem-cell-names = "eeprom", "mac-address";
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index a5e3828c39..8a194d6bc1 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1552,6 +1552,17 @@ define Device/mediatek_mt7621-eval-board
 endef
 TARGET_DEVICES += mediatek_mt7621-eval-board
 
+define Device/meig_slt866
+  $(Device/dsa-migration)
+  IMAGE_SIZE := 15104k
+  DEVICE_VENDOR := MeiG
+  DEVICE_MODEL := SLT866
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \
+	kmod-usb-net-qmi-wwan kmod-usb-serial-option kmod-usb3 \
+	kmod-usb-net-rndis
+endef
+TARGET_DEVICES += meig_slt866
+
 define Device/mercusys_mr70x-v1
   $(Device/dsa-migration)
   $(Device/tplink-safeloader)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 3ceac60434..784a4ba0d9 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -137,6 +137,10 @@ linksys,ea8100-v2)
 	ucidef_set_led_netdev "lan4" "lan4 link" "green:lan4" "lan4" "link"
 	ucidef_set_led_netdev "wan" "wan link" "green:wan" "wan" "link"
 	;;
+meig,slt866)
+	ucidef_set_led_netdev "lan" "eth" "blue:lanwan" "lan" "link tx rx"
+	ucidef_set_led_netdev "wwan0" "net" "blue:internet" "wwan0" "link tx rx"
+	;;
 mikrotik,routerboard-760igs)
 	ucidef_set_led_netdev "sfp" "SFP" "blue:sfp" "sfp"
 	;;
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 827d97e540..4b23afc1cf 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
@@ -146,7 +146,8 @@ ramips_setup_interfaces()
 		ucidef_set_interface "qtn" ifname "eth1" protocol "static" ipaddr "1.1.1.1" netmask "255.255.255.0"
 		;;
 	comfast,cf-e390ax|\
-	comfast,cf-ew72-v2)
+	comfast,cf-ew72-v2|\
+	meig,slt866)
 		ucidef_set_interfaces_lan_wan "lan" "wan"
 		;;
 	*)




More information about the lede-commits mailing list