Skip to content

Commit 1837d53

Browse files
committed
imx: add Aqara Gateway ZHWG11LM support
Aqara ZHWG11LM is a is a wall-mounted zigbee-to-internet gateway. It is almost a twin of Xiaomi DGNWG05LM with another wifi chip. Device specifications: * SoC: Freescale iMX6ULL * RAM: 256MiB * Flash: 256MiB NAND flash * Wireless 2.4GHz (RTL8189ES): b/g/n * Zigbee Chip: NXP jn5169 * Ring of RGB leds * BTN0 button * Sound chip TFA9882 + speaker Flashing instructions: Flashing requires a flashing tool from NXP: https://github.com/NXPmicro/mfgtools * solder wires and attach to system UART and usb connector * stop uboot by pressing any key * enter `bmode usb` to enable flashing over USB * run `mfgtoolcli` on the main computer to write kernel, dtb and rootfs to the device Known issues: - RTL8189ES driver is buggy and may cause freezes and kernel panics - Removing wdev disables the device until reboot. Patch is required. Signed-off-by: Ivan Belokobylskiy <belokobylskij@gmail.com>
1 parent 75384c3 commit 1837d53

File tree

5 files changed

+63
-11
lines changed

5 files changed

+63
-11
lines changed

package/boot/uboot-imx/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ endef
5252

5353
define U-Boot/xiaomi_dgnwg05lm
5454
NAME:=Xiaomi Lumi gateway
55-
BUILD_DEVICES:=xiaomi_dgnwg05lm
55+
BUILD_DEVICES:=aqara_zhwg11lm xiaomi_dgnwg05lm
5656
endef
5757

5858
UBOOT_TARGETS := \
5959
apalis_imx6 \
60+
aqara_zhwg11lm \
6061
mx6cuboxi \
6162
pico-pi-imx7d \
6263
wandboard \

package/boot/uboot-tools/uboot-envtools/files/imx_cortexa7

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ touch /etc/config/ubootenv
88
board=$(board_name)
99

1010
case "$board" in
11-
technexion,imx7d-pico-pi)
12-
ubootenv_add_uci_config "/dev/mmcblk2" "0xc0000" "0x2000" "0x2000"
13-
;;
11+
aqara,zhwg11lm|\
1412
xiaomi,dgnwg05lm)
1513
ubootenv_add_uci_config "/dev/mtd0" "0x2e0000" "0x20000" "0x20000" "4"
1614
;;
15+
technexion,imx7d-pico-pi)
16+
ubootenv_add_uci_config "/dev/mmcblk2" "0xc0000" "0x2000" "0x2000"
17+
;;
1718
esac
1819

1920
config_load ubootenv

target/linux/imx/cortexa7/base-files/lib/upgrade/platform.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ platform_check_image() {
1515
local board=$(board_name)
1616

1717
case "$board" in
18-
technexion,imx7d-pico-pi)
19-
return 0
20-
;;
18+
aqara,zhwg11lm |\
2119
xiaomi,dgnwg05lm )
2220
local platform_dir_name=$(echo $board | sed 's/,/_/g')
2321
nand_do_platform_check $platform_dir_name $1
2422
return $?;
2523
;;
24+
technexion,imx7d-pico-pi)
25+
return 0
26+
;;
2627
esac
2728

2829
echo "Sysupgrade is not yet supported on $board."
@@ -33,12 +34,13 @@ platform_do_upgrade() {
3334
local board=$(board_name)
3435

3536
case "$board" in
36-
technexion,imx7d-pico-pi)
37-
imx_sdcard_do_upgrade "$1"
38-
;;
37+
aqara,zhwg11lm |\
3938
xiaomi,dgnwg05lm )
4039
nand_do_upgrade "$1"
4140
;;
41+
technexion,imx7d-pico-pi)
42+
imx_sdcard_do_upgrade "$1"
43+
;;
4244
esac
4345
}
4446

target/linux/imx/image/cortexa7.mk

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ define Device/xiaomi_gateway-lumi
3636
kmod-ledtrig-activity kmod-ledtrig-oneshot \
3737
kmod-ledtrig-transient kmod-ledtrig-gpio \
3838
kmod-i2c-core kmod-iio-core kmod-iio-vf610 \
39-
kmod-sound-core kmod-sound-soc-imx \
39+
kmod-hid kmod-sound-core kmod-sound-soc-imx \
4040
kmod-sound-soc-tfa9882 alsa-utils \
4141
wpa-supplicant ca-certificates hostapd \
4242
nand-utils kobs-ng
@@ -62,3 +62,13 @@ define Device/xiaomi_dgnwg05lm
6262
imx6ull-xiaomi-dgnwg05lm
6363
endef
6464
TARGET_DEVICES += xiaomi_dgnwg05lm
65+
66+
define Device/aqara_zhwg11lm
67+
$(Device/xiaomi_gateway-lumi)
68+
DEVICE_VENDOR := Aqara
69+
DEVICE_MODEL := ZHWG11LM
70+
DEVICE_PACKAGES += kmod-rtl8189es-ol
71+
DEVICE_DTS := \
72+
imx6ull-aqara-zhwg11lm
73+
endef
74+
TARGET_DEVICES += aqara_zhwg11lm
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Aqara ZHWG11LM is a is a wall-mounted zigbee-to-internet gateway.
2+
Device specifications:
3+
* SoC: Freescale iMX6ULL
4+
* RAM: 256MiB
5+
* Flash: 256MiB NAND flash
6+
* Wireless 2.4GHz (RTL8189ES): b/g/n
7+
* Zigbee Chip: NXP jn5169
8+
* Ring of RGB leds
9+
* BTN0 button
10+
* Sound chip TFA9882 + speaker
11+
12+
Tested on: Aqara Gateway ZHWG11LM
13+
14+
Signed-off-by: Ivan Belokobylskiy <belokobylskij@gmail.com>
15+
16+
--- a/arch/arm/boot/dts/nxp/imx/Makefile
17+
+++ b/arch/arm/boot/dts/nxp/imx/Makefile
18+
@@ -316,6 +316,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
19+
imx6ul-tx6ul-mainboard.dtb \
20+
imx6ull-14x14-evk.dtb \
21+
imx6ull-xiaomi-dgnwg05lm.dtb \
22+
+ imx6ull-aqara-zhwg11lm.dtb \
23+
imx6ull-colibri-aster.dtb \
24+
imx6ull-colibri-emmc-aster.dtb \
25+
imx6ull-colibri-emmc-eval-v3.dtb \
26+
--- /dev/null
27+
+++ b/arch/arm/boot/dts/nxp/imx/imx6ull-aqara-zhwg11lm.dts
28+
@@ -0,0 +1,10 @@
29+
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
30+
+
31+
+/dts-v1/;
32+
+
33+
+#include "imx6ull-xiaomi-lumi.dtsi"
34+
+
35+
+/ {
36+
+ model = "Aqara Gateway ZHWG11LM";
37+
+ compatible = "aqara,zhwg11lm", "xiaomi,gateway-lumi", "fsl,imx6ull";
38+
+};

0 commit comments

Comments
 (0)