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

Kristian Evensen kristian.evensen at gmail.com
Sun Jun 23 05:24:48 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.

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  |  3 +-
 target/linux/ramips/dts/WE1026-H-32M.dts      | 14 +++++++
 target/linux/ramips/dts/WE1026-H.dtsi         | 41 +++++++++++++++++++
 target/linux/ramips/image/mt7620.mk           |  9 ++++
 5 files changed, 71 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/WE1026-H-32M.dts
 create mode 100644 target/linux/ramips/dts/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 043b814773..e44e0cb973 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -439,6 +439,11 @@ zbt-we826-16M|\
 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 52204eacbf..9e953b4ef0 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -427,7 +427,8 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5 at eth0"
 		;;
-	wcr-1166ds)
+	wcr-1166ds|\
+	zbtlink,we1026-h-32m)
 		ucidef_add_switch "switch0" \
 			"3:lan" "4:wan" "6 at eth0"
 		;;
diff --git a/target/linux/ramips/dts/WE1026-H-32M.dts b/target/linux/ramips/dts/WE1026-H-32M.dts
new file mode 100644
index 0000000000..ba96b03355
--- /dev/null
+++ b/target/linux/ramips/dts/WE1026-H-32M.dts
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "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/WE1026-H.dtsi b/target/linux/ramips/dts/WE1026-H.dtsi
new file mode 100644
index 0000000000..3c6a2f99dc
--- /dev/null
+++ b/target/linux/ramips/dts/WE1026-H.dtsi
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "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;
+	};
+
+	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 077834edc8..a39ad5a6dd 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -812,6 +812,15 @@ define Device/we1026-5g-16m
 endef
 TARGET_DEVICES += we1026-5g-16m
 
+define Device/zbtlink_we1026-h-32m
+  DTS := WE1026-H-32M
+  IMAGE_SIZE := 32448k
+  DEVICE_TITLE := Zbtlink ZBT-WE1026-H (32M)
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \
+		     kmod-ledtrig-netdev
+endef
+TARGET_DEVICES += zbtlink_we1026-h-32m
+
 define Device/zbt-ape522ii
   DTS := ZBT-APE522II
   DEVICE_TITLE := Zbtlink ZBT-APE522II
-- 
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