[openwrt/openwrt] ath79: add support for ALLNET ALL-WAP02860AC

LEDE Commits lede-commits at lists.infradead.org
Sat Aug 15 09:58:44 EDT 2020


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ebf71533f9123d9ca182154a55af5e2904460a25

commit ebf71533f9123d9ca182154a55af5e2904460a25
Author: Tomasz Maciej Nowak <tomek_n at o2.pl>
AuthorDate: Fri Aug 14 18:03:40 2020 +0200

    ath79: add support for ALLNET ALL-WAP02860AC
    
    ALLNET ALL-WAP02860AC is a dual-band wireless access point.
    
    Specification
    SoC: Qualcomm Atheros QCA9558
    RAM: 128 MB DDR2
    Flash: 16 MB SPI NOR
    WIFI: 2.4 GHz 3T3R integrated
          5 GHz 3T3R QCA9880 Mini PCIe card
    Ethernet: 1x 10/100/1000 Mbps AR8035-A, PoE capable (802.3at)
    LEDS: 5x, which four are GPIO controlled
    Buttons: 1x GPIO controlled
    UART: 4 pin header near Mini PCIe card, starting count from white
          triangle on PCB
          1. VCC 3.3V, 2. GND, 3. TX, 4. RX
          baud: 115200, parity: none, flow control: none
    
    MAC addresses
    Calibration data does not contain valid MAC addresses.
    The calculated MAC addresses are chosen in accordance with OEM firmware.
    
    Because of:
    a) constrained environment (SNMP) when connecting through Telnet
       or SSH,
    b) hard-coded kernel and rootfs sizes,
    c) checksum verification of kerenel and rootfs images in bootloder,
    
    creating factory image accepted by OEM web interface is difficult,
    therefore, to install OpenWrt on this device UART connection is needed.
    The teardown is simple, unscrew four screws to disassemble the casing,
    plus two screws to separate mainboard from the casing.
    Before flashing, be sure to have a copy of factory firmware, in case You
    wish to revert to original firmware.
    
    Installation
    1. Prepare TFTP server with OpenWrt initramfs-kernel image.
    2. Connect to LAN port.
    3. Connect to UART port.
    4. Power on the device and when prompted to stop autoboot, hit any key.
    5. Alter U-Boot environment with following commands:
        setenv failsafe_boot bootm 0x9f0a0000
        saveenv
    6. Adjust "ipaddr" and "serverip" addresses in U-Boot environment, use
       'setenv' to do that, then run following commands:
        tftpboot 0x81000000 <openwrt_initramfs-kernel_image_name>
        bootm 0x81000000
    7. Wait about 1 minute for OpenWrt to boot.
    8. Transfer OpenWrt sysupgrade image to /tmp directory and flash it
       with:
        sysupgrade -n /tmp/<openwrt_sysupgrade_image_name>
    9. After flashing, the access point will reboot to OpenWrt. Wait few
       minutes, until the Power LED stops blinking, then it's ready for
       configuration.
    
    Signed-off-by: Tomasz Maciej Nowak <tomek_n at o2.pl>
    [add MAC address comment to commit message]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 package/boot/uboot-envtools/files/ath79            |   1 +
 .../ath79/dts/qca9558_allnet_all-wap02860ac.dts    | 156 +++++++++++++++++++++
 .../generic/base-files/etc/board.d/02_network      |   1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |   9 +-
 target/linux/ath79/image/generic.mk                |   9 ++
 5 files changed, 172 insertions(+), 4 deletions(-)

diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
index b00e3fa127..c0873c6e0d 100644
--- a/package/boot/uboot-envtools/files/ath79
+++ b/package/boot/uboot-envtools/files/ath79
@@ -14,6 +14,7 @@ board=$(board_name)
 
 case "$board" in
 alfa-network,ap121f|\
+allnet,all-wap02860ac|\
 arduino,yun|\
 buffalo,bhr-4grv2|\
 devolo,magic-2-wifi|\
diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
new file mode 100644
index 0000000000..6d7eeb2630
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
@@ -0,0 +1,156 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca955x.dtsi"
+
+/ {
+	model = "ALLNET ALL-WAP02860AC";
+	compatible = "allnet,all-wap02860ac", "qca,qca9558";
+
+	aliases {
+		label-mac-device = &eth0;
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "all-wap02860ac:amber:power";
+			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		wlan2g {
+			label = "all-wap02860ac:blue:wlan2g";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wlan5g {
+			label = "all-wap02860ac:green:wlan5g";
+			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		wps {
+			label = "all-wap02860ac:blue:wps";
+			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	pll-data = <0x8e000000 0x80000101 0x80001313>;
+	phy-handle = <&phy5>;
+	phy-mode = "rgmii-rxid";
+
+	mtd-mac-address = <&art 0x0>;
+};
+
+&mdio0 {
+	status = "okay";
+
+	phy5: ethernet-phy at 5 {
+		reg = <5>;
+		eee-broken-100tx;
+		eee-broken-1000t;
+	};
+};
+
+&pcie0 {
+	status = "okay";
+
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0 0 0 0 0>;
+	};
+};
+
+&pll {
+	clocks = <&extosc>;
+};
+
+&spi {
+	status = "okay";
+
+	num-cs = <1>;
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <25000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x000000 0x040000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "u-boot-env";
+				reg = <0x040000 0x010000>;
+			};
+
+			partition at 50000 {
+				label = "custom";
+				reg = <0x050000 0x050000>;
+				read-only;
+			};
+
+			partition at a0000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x0a0000 0xcd0000>;
+			};
+
+			partition at d70000 {
+				label = "failsafe";
+				reg = <0xd70000 0x280000>;
+				read-only;
+			};
+
+			art: partition at ff0000 {
+				label = "art";
+				reg = <0xff0000 0x010000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&uart {
+	status = "okay";
+};
+
+&wmac {
+	status = "okay";
+
+	mtd-cal-data = <&art 0x1000>;
+	mtd-mac-address = <&art 0x0>;
+	mtd-mac-address-increment = <1>;
+	qca-no-eeprom;
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index 4195332ae2..f655abe740 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -11,6 +11,7 @@ ath79_setup_interfaces()
 	case "$board" in
 	adtran,bsap1800-v2|\
 	adtran,bsap1840|\
+	allnet,all-wap02860ac|\
 	alfa-network,ap121f|\
 	arduino,yun|\
 	aruba,ap-105|\
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 19e20c7d36..1c93fe332c 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -10,6 +10,11 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath10k/cal-pci-0000:00:00.0.bin")
 	case $board in
+	allnet,all-wap02860ac|\
+	glinet,gl-x750)
+		caldata_extract "art" 0x5000 0x844
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
+		;;
 	avm,fritz1750e|\
 	avm,fritzdvbc)
 		caldata_extract "urlader" 0x198a 0x844
@@ -72,10 +77,6 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x5000 0x844
 		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
 		;;
-	glinet,gl-x750)
-		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
-		;;
 	nec,wg800hp)
 		caldata_extract "art" 0x5000 0x844
 		ath10k_patch_mac $(mtd_get_mac_text board_data 0x880)
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index e2c37f7a57..debb6722ca 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -210,6 +210,15 @@ define Device/alfa-network_ap121f
 endef
 TARGET_DEVICES += alfa-network_ap121f
 
+define Device/allnet_all-wap02860ac
+  SOC := qca9558
+  DEVICE_VENDOR := ALLNET
+  DEVICE_MODEL := ALL-WAP02860AC
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
+  IMAGE_SIZE := 13120k
+endef
+TARGET_DEVICES += allnet_all-wap02860ac
+
 define Device/arduino_yun
   SOC := ar9331
   DEVICE_VENDOR := Arduino



More information about the lede-commits mailing list