From 4456dd4660b4fa4e9c04d73029c72bf7b0f2ba84 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 27 Jun 2018 14:33:40 +0200 Subject: [PATCH] ath79: add support for Unifi AC Mesh The Unifi AC Mesh is equivalent to the Unifi AC Lite. However, for setting certain parameters with the flashed device it is helpful that the devices know their variant (e.g. automatically setting antenna gain for the different antennas in Lite and Mesh). Signed-off-by: Adrian Schmutzler --- .../ath79/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + .../ath79/dts/qca9563_ubnt_unifiac-lite.dts | 21 ++----------------- .../ath79/dts/qca9563_ubnt_unifiac-lite.dtsi | 20 ++++++++++++++++++ .../ath79/dts/qca9563_ubnt_unifiac-mesh.dts | 9 ++++++++ target/linux/ath79/image/generic-ubnt.mk | 7 +++++++ 6 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi create mode 100644 target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network index 5601c789b05..579ccc5bd32 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -16,6 +16,7 @@ ath79_setup_interfaces() "tplink,tl-mr10u"|\ "tplink,tl-wr703n"|\ "ubnt,unifiac-lite"|\ + "ubnt,unifiac-mesh"|\ "ubnt,unifi") ucidef_set_interface_lan "eth0" ;; diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index dff33b70cee..c27b4111dec 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -96,6 +96,7 @@ case "$FIRMWARE" in ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2) ;; "ubnt,unifiac-lite"|\ + "ubnt,unifiac-mesh"|\ "ubnt,unifiac-pro") ath10kcal_extract "EEPROM" 20480 2116 ;; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts index 6b872561ed4..a3ae7089d50 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts @@ -1,26 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "qca9563_ubnt_unifiac.dtsi" +#include "qca9563_ubnt_unifiac-lite.dtsi" / { compatible = "ubnt,unifiac-lite", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-LITE/MESH/LR"; -}; - -&mdio0 { - status = "okay"; - - phy-mask = <4>; - phy4: ethernet-phy@4 { - phy-mode = "sgmii"; - reg = <4>; - }; -}; - -ð0 { - status = "okay"; - - mtd-mac-address = <&eeprom 0x0>; - phy-handle = <&phy4>; + model = "Ubiquiti UniFi-AC-LITE/LR"; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi new file mode 100644 index 00000000000..6fe43453ec2 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9563_ubnt_unifiac.dtsi" + +&mdio0 { + status = "okay"; + + phy-mask = <4>; + phy4: ethernet-phy@4 { + phy-mode = "sgmii"; + reg = <4>; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&eeprom 0x0>; + phy-handle = <&phy4>; +}; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts new file mode 100644 index 00000000000..6eed56bb6cf --- /dev/null +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_ubnt_unifiac-lite.dtsi" + +/ { + compatible = "ubnt,unifiac-mesh", "qca,qca9563"; + model = "Ubiquiti UniFi-AC-MESH"; +}; diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 31905820a09..540277d41b8 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -96,6 +96,13 @@ define Device/ubnt_unifiac-lite endef TARGET_DEVICES += ubnt_unifiac-lite +define Device/ubnt_unifiac-mesh + $(Device/ubnt_unifiac) + DEVICE_TITLE := Ubiquiti UniFi AC-Mesh + SUPPORTED_DEVICES += ubnt-unifiac-mesh +endef +TARGET_DEVICES += ubnt_unifiac-mesh + define Device/ubnt_unifiac-pro $(Device/ubnt_unifiac) DEVICE_TITLE := Ubiquiti UniFi AC-Pro