[From nobody Thu Jun 25 05:54:54 2020
Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444])
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1gKiA3-0007My-8F
 for openwrt-devel@lists.openwrt.org; Thu, 08 Nov 2018 11:07:45 +0000
Received: by mail-wr1-x444.google.com with SMTP id v18-v6so1468796wrt.8
 for &lt;openwrt-devel@lists.openwrt.org&gt;; Thu, 08 Nov 2018 03:07:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=googlemail.com; s=20161025;
 h=from:to:subject:date:message-id:in-reply-to:references:mime-version
 :content-transfer-encoding;
 bh=MyKKFefQkc7X15Nl+SAXjHRwN42UvizyX9e3bfCaJ9U=;
 b=UH+6hRiA30uSGkW3D0FMnUAJvab0aj92aAfvgp8aVssUQIMsJrX/TyerL8CPXo3OIu
 Gqn8fdAUa3ZAG4FNYj78i7S+bULfh7PdshoOr05KV9Q1GoVi+zMRerxe/eOkTgsHK/Eo
 G6TXRjPfOf2ml+AcCxTO21F79ILWLT1ulZUQc5mbQiI8ssvjOn04K1xee7JIULWIadN1
 TspfbOcubjxOn6OwyrIRCmRfsa9+QsBw7YyxMoBWGbYrYwpyEzHvX35Hg13EEHyPL37+
 bUGbw1tl6ARMfi1waXdCxOjGBT+RgtI3CZmG1eHezUf7ulZnFS9sqWcettN4xnL2XsB/
 Tm1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=MyKKFefQkc7X15Nl+SAXjHRwN42UvizyX9e3bfCaJ9U=;
 b=B6vC0aQOo+MjAR8/hohrrREWieWHmx6CdyE36+h2GJ3JjhZJVChWc9LAOJqDAowM3/
 RT4HlhqQdfpTJtxOydptAfldQrVk4o1x0+sUNmE6Mx6hsjVgNsEHK71TXRWM58cdvbWs
 Rk3e/x7gM1IKqu0NH8SiRf8ZCGMuEhswDf7c/vyIl/fXoO2m+rV2ulC4gjdbeUW31vJQ
 Gi/PB9dKY+X1wbj+L/7o9RVdl/cYj3X3JZnN8Zat92gF/pGrAUrg8YfA/B850vpQ2jZS
 w14uxdy9/Bx0ewlMJSG05KStfvMoN7Jiw7cXMubzdVJ0bmSetgXtPdodM5Ojas7rPrYX
 2yWw==
X-Gm-Message-State: AGRZ1gIbBwf5dy6mMPlKtR1qJ0kHzPdgqAK7fMVt/2kJdytVOoJa7sO6
 p05ugCPBE6kmMrqs3wBc+7tc1O+5KkA=
X-Google-Smtp-Source: AJdET5cIJLhmD9iE2Tju3M88VX2hOoDWB8K2j4SPJpFxo7yyJRYAD5DCwpleE52tM+uXJdJFsBls1A==
X-Received: by 2002:adf:ce8b:: with SMTP id
 r11-v6mr3600668wrn.194.1541675251459; 
 Thu, 08 Nov 2018 03:07:31 -0800 (PST)
Received: from precision.intern.chemmedia.de ([87.128.76.185])
 by smtp.gmail.com with ESMTPSA id y83-v6sm2539502wmg.13.2018.11.08.03.07.30
 for &lt;openwrt-devel@lists.openwrt.org&gt;
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 08 Nov 2018 03:07:31 -0800 (PST)
From: Christoph Krapp &lt;achterin@googlemail.com&gt;
To: openwrt-devel@lists.openwrt.org
Subject: [PATCH] ar71xx: add support for UniFi-AC-Mesh-Pro
Date: Thu,  8 Nov 2018 12:07:17 +0100
Message-Id: &lt;20181108110717.18235-2-achterin@googlemail.com&gt;
X-Mailer: git-send-email 2.19.1
In-Reply-To: &lt;20181108110717.18235-1-achterin@googlemail.com&gt;
References: &lt;20181108110717.18235-1-achterin@googlemail.com&gt;
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20181108_030743_401209_1763CAFF 
X-CRM114-Status: GOOD (  12.60  )
X-Spam-Score: -0.2 (/)
X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
 Content analysis details:   (-0.2 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/,
 no trust [2a00:1450:4864:20:0:0:0:444 listed in]
 [list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (achterin[at]googlemail.com)
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
 envelope-from domain
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
 valid
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
 author's domain

This adds the build option for UniFi AC Mesh Pro as well as
model detection for it.
The device is a hardware clone of the AC Pro.

- SoC: QCA9563-AL3A (775Mhz)
- RAM: 128MiB
- Flash: 16MiB - dual firmware partitions!
- LAN: 2x 1000M - POE+
- Wireless:
        2.4G: QCA9563
          5G: UniFi Chip, QCA988X compatible

Signed-off-by: Christoph Krapp &lt;achterin@googlemail.com&gt;
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh    | 17 ++++++++++++-----
 .../files/arch/mips/ath79/Kconfig.openwrt       |  2 +-
 .../files/arch/mips/ath79/mach-ubnt-unifiac.c   |  2 +-
 .../ar71xx/files/arch/mips/ath79/machtypes.h    |  2 +-
 target/linux/ar71xx/image/generic-ubnt.mk       |  6 ++++++
 5 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 05f497fcbf..a9df93a2da 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -98,22 +98,28 @@ ubnt_xm_board_detect() {
 	[ -z &quot;$model&quot; ] || AR71XX_MODEL=&quot;${model}${magic:3:1}&quot;
 }
 
-ubnt_ac_lite_get_mtd_part_magic() {
+ubnt_unifi_ac_get_mtd_part_magic() {
 	ar71xx_get_mtd_offset_size_format EEPROM 12 2 %02x
 }
 
-ubnt_ac_lite_board_detect() {
+ubnt_unifi_ac_board_detect() {
 	local model
 	local magic
 
-	magic=&quot;$(ubnt_ac_lite_get_mtd_part_magic)&quot;
+	magic=&quot;$(ubnt_unifi_ac_get_mtd_part_magic)&quot;
 	case ${magic:0:4} in
 	&quot;e517&quot;)
 		model=&quot;Ubiquiti UniFi-AC-LITE&quot;
 		;;
+	&quot;e537&quot;)
+		model=&quot;Ubiquiti UniFi-AC-PRO&quot;
+		;;
 	&quot;e557&quot;)
 		model=&quot;Ubiquiti UniFi-AC-MESH&quot;
 		;;
+	&quot;e567&quot;)
+		model=&quot;Ubiquiti UniFi-AC-MESH-PRO&quot;
+		;;
 	esac
 
 	[ -z &quot;$model&quot; ] || AR71XX_MODEL=&quot;${model}&quot;
@@ -1388,10 +1394,11 @@ ar71xx_board_detect() {
 		;;
 	*&quot;UniFi-AC-LITE/MESH&quot;)
 		name=&quot;unifiac-lite&quot;
-		ubnt_ac_lite_board_detect
+		ubnt_unifi_ac_board_detect
 		;;
-	*&quot;UniFi-AC-PRO&quot;)
+	*&quot;UniFi-AC-PRO/MESH-PRO&quot;)
 		name=&quot;unifiac-pro&quot;
+		ubnt_unifi_ac_board_detect
 		;;
 	*&quot;UniFiAP Outdoor&quot;)
 		name=&quot;unifi-outdoor&quot;
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index f60825a6dd..86581a6743 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -2133,7 +2133,7 @@ config ATH79_MACH_UBNT
 	select ATH79_DEV_USB
 
 config ATH79_MACH_UBNT_UNIFIAC
-	bool &quot;Ubiquiti UniFi AC (LITE/LR/MESH/PRO) support&quot;
+	bool &quot;Ubiquiti UniFi AC (LITE/LR/MESH/PRO/MESH-PRO) support&quot;
 	select SOC_QCA956X
 	select ATH79_DEV_AP9X_PCI if PCI
 	select ATH79_DEV_ETH
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c
index 5ea0028df8..09a0bba867 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c
@@ -176,4 +176,4 @@ static void __init ubnt_unifiac_pro_setup(void)
 
 
 MIPS_MACHINE(ATH79_MACH_UBNT_UNIFIAC_PRO, &quot;UBNT-UF-AC-PRO&quot;,
-	     &quot;Ubiquiti UniFi-AC-PRO&quot;, ubnt_unifiac_pro_setup);
+	     &quot;Ubiquiti UniFi-AC-PRO/MESH-PRO&quot;, ubnt_unifiac_pro_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 987e80bb1f..2298be55bb 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -333,7 +333,7 @@ enum ath79_mach_type {
 	ATH79_MACH_UBNT_UAP_PRO,		/* Ubiquiti UniFi AP Pro */
 	ATH79_MACH_UBNT_UNIFI,			/* Ubiquiti Unifi */
 	ATH79_MACH_UBNT_UNIFIAC_LITE,		/* Ubiquiti Unifi AC LITE/LR/MESH */
-	ATH79_MACH_UBNT_UNIFIAC_PRO,		/* Ubiquiti Unifi AC PRO */
+	ATH79_MACH_UBNT_UNIFIAC_PRO,		/* Ubiquiti Unifi AC PRO/MESH PRO */
 	ATH79_MACH_UBNT_UNIFI_OUTDOOR,		/* Ubiquiti UnifiAP Outdoor */
 	ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS,	/* Ubiquiti UnifiAP Outdoor+ */
 	ATH79_MACH_UBNT_XM,			/* Ubiquiti Networks XM board rev 1.0 */
diff --git a/target/linux/ar71xx/image/generic-ubnt.mk b/target/linux/ar71xx/image/generic-ubnt.mk
index 6941012cbe..42275bae18 100644
--- a/target/linux/ar71xx/image/generic-ubnt.mk
+++ b/target/linux/ar71xx/image/generic-ubnt.mk
@@ -143,6 +143,12 @@ define Device/ubnt-unifiac-pro
 endef
 TARGET_DEVICES += ubnt-unifiac-pro
 
+define Device/ubnt-unifiac-mesh-pro
+  $(Device/ubnt-unifiac-pro)
+  DEVICE_TITLE := Ubiquiti UniFi AC-Mesh-Pro
+endef
+TARGET_DEVICES += ubnt-unifiac-mesh-pro
+
 define Device/ubnt-unifi-outdoor
   $(Device/ubnt-bz)
   DEVICE_TITLE := Ubiquiti UniFi Outdoor
-- 
2.19.1


]