[OpenWrt-Devel] [PATCH v2 2/2] ramips: Add support for ZBT WE1026-H

Kristian Evensen kristian.evensen at gmail.com
Tue Sep 24 06:47:12 EDT 2019


This commit adds support for the ZBT WE1026-H, an outdoor AP with
support for adding an internal LTE modem. The detailed specs are:

* CPU: MT7620A
* 2x 10/100Mbps Ethernet (LAN port has passive PoE support).
* 16/32 MB Flash.
* 128/256 MB RAM.
* 1x USB 2.0 port.
* 1x mini-PCIe slot (only USB2.0 bus).
* 1x SIM slot (standard size).
* 1x 2.4Ghz WIFI (rt2800).
* 1x button.
* 6x LEDS (4 GPIO-controlled).
* 1x micro-SD reader.

The following have been tested and working:
- Ethernet switch
- Wifi
- Mini-PCIe slot + SIM slot
- USB port
- microSD slot
- sysupgrade
- reset button

Installation and recovery:

In order to install OpenWRT the first time or ito recover the router,
you can use the web-based recovery system. Keep the reset button pressed
during boot and access 192.168.1.1 in your browser when your machine
obtains an IP address. Upload the firmware to start the recovery
process.

Notes:

* The LED labeled "USB" is used as the power LED. When binding this LED
to a usbport, the LED is switched on all the time due to the presence of
an internal hub. Thus, it does not really signal any USB-information.

* I only have the 32MB version and have only added support for this
device. However, the files are structured so that adding support for the
16MB version should be easy.

* Only the LAN port is accessible from the outside of the casing and LEDs
are not visible.

v1->v2:
* Rebased on top of master.
* Read correct WAN address from flash (thanks Adrian Schmutzler).

Signed-off-by: Kristian Evensen <kristian.evensen at gmail.com>
---
 .../ramips/base-files/etc/board.d/01_leds     |  5 +++
 .../ramips/base-files/etc/board.d/02_network  |  6 ++-
 .../dts/mt7620a_zbtlink_we1026-h-32m.dts      | 14 +++++++
 .../ramips/dts/mt7620a_zbtlink_we1026-h.dtsi  | 42 +++++++++++++++++++
 target/linux/ramips/image/mt7620.mk           | 12 ++++++
 5 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/mt7620a_zbtlink_we1026-h-32m.dts
 create mode 100644 target/linux/ramips/dts/mt7620a_zbtlink_we1026-h.dtsi

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 46202b4117..3e12c2a947 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -461,6 +461,11 @@ zbtlink,zbt-we826-16m|\
 zbtlink,zbt-we826-32m)
 	set_wifi_led "zbt-we826:green:wifi"
 	;;
+zbtlink,we1026-h-32m)
+	set_wifi_led "we1026-h:green:wifi"
+	ucidef_set_led_switch "lan" "lan" "we1026-h:green:lan" "switch0" "0x8"
+	ucidef_set_led_switch "wan" "wan" "we1026-h:green:wan" "switch0" "0x10"
+	;;
 zbtlink,zbt-we1226)
 	set_wifi_led "$boardname:green:wlan"
 	ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x01"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 63644331e5..d94cd5fa98 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -272,7 +272,8 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5 at eth0"
 		;;
-	buffalo,wcr-1166ds)
+	buffalo,wcr-1166ds|\
+	zbtlink,we1026-h-32m)
 		ucidef_add_switch "switch0" \
 			"3:lan" "4:wan" "6 at eth0"
 		;;
@@ -721,6 +722,9 @@ ramips_setup_macs()
 		wan_mac=$(mtd_get_mac_binary factory 0xe006)
 		label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
 		;;
+	zbtlink,we1026-h-32m)
+		wan_mac=$(mtd_get_mac_binary factory 0x2e)
+		;;
 	*)
 		wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
 		;;
diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h-32m.dts b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h-32m.dts
new file mode 100644
index 0000000000..ca62ccfc84
--- /dev/null
+++ b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h-32m.dts
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "mt7620a_zbtlink_we1026-h.dtsi"
+
+/ {
+	compatible = "zbtlink,we1026-h-32m", "zbtlink,we1026-h",
+		     "zbtlink,we1026","ralink,mt7620a-soc";
+	model = "ZBT WE1026-H (32M)";
+};
+
+&firmware {
+	reg = <0x50000 0x1fb0000>;
+};
diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h.dtsi
new file mode 100644
index 0000000000..fed79c2809
--- /dev/null
+++ b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h.dtsi
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "mt7620a_zbtlink_we1026.dtsi"
+
+/ {
+	compatible = "zbtlink,we1026-h", "zbtlink,we1026",
+		     "ralink,mt7620a-soc";
+
+	aliases {
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+		label-mac-device = &wmac;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: usb {
+			label = "we1026-h:green:usb";
+			gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
+		};
+
+		lan {
+			label = "we1026-h:green:lan";
+			gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
+		};
+
+		wan {
+			label = "we1026-h:green:wan";
+			gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi {
+			label = "we1026-h:green:wifi";
+			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 320d4abd1f..3011e08af7 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -973,6 +973,18 @@ define Device/zbtlink_we1026-5g-16m
 endef
 TARGET_DEVICES += zbtlink_we1026-5g-16m
 
+define Device/zbtlink_we1026-h-32m
+  MTK_SOC := mt7620a
+  DTS := WE1026-H-32M
+  IMAGE_SIZE := 32448k
+  DEVICE_VENDOR := Zbtlink
+  DEVICE_MODEL := ZBT-WE1026-H
+  DEVICE_VARIANT := 32M
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \
+		     kmod-ledtrig-netdev
+endef
+TARGET_DEVICES += zbtlink_we1026-h-32m
+
 define Device/zbtlink_zbt-ape522ii
   MTK_SOC := mt7620a
   IMAGE_SIZE := 15872k
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list