ath79: add support for ALLNET ALL-WAP02860AC
authorTomasz Maciej Nowak <tomek_n@o2.pl>
Fri, 14 Aug 2020 16:03:40 +0000 (18:03 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sat, 15 Aug 2020 13:58:39 +0000 (15:58 +0200)
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@o2.pl>
[add MAC address comment to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
package/boot/uboot-envtools/files/ath79
target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts [new file with mode: 0644]
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ath79/image/generic.mk

index b00e3fa12766789c77e565d9a30f578c1c9b5aad..c0873c6e0d7f34383e5b7aa19c8da6d9562efff2 100644 (file)
@@ -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 (file)
index 0000000..6d7eeb2
--- /dev/null
@@ -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@5 {
+               reg = <5>;
+               eee-broken-100tx;
+               eee-broken-1000t;
+       };
+};
+
+&pcie0 {
+       status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0 0 0 0 0>;
+       };
+};
+
+&pll {
+       clocks = <&extosc>;
+};
+
+&spi {
+       status = "okay";
+
+       num-cs = <1>;
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <25000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x000000 0x040000>;
+                               read-only;
+                       };
+
+                       partition@40000 {
+                               label = "u-boot-env";
+                               reg = <0x040000 0x010000>;
+                       };
+
+                       partition@50000 {
+                               label = "custom";
+                               reg = <0x050000 0x050000>;
+                               read-only;
+                       };
+
+                       partition@a0000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               reg = <0x0a0000 0xcd0000>;
+                       };
+
+                       partition@d70000 {
+                               label = "failsafe";
+                               reg = <0xd70000 0x280000>;
+                               read-only;
+                       };
+
+                       art: partition@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;
+};
index 4195332ae21773dd035472ed106c4afae8a70de8..f655abe740af1b1eac2fdf9a1ec55a074d45e53a 100755 (executable)
@@ -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|\
index 19e20c7d36073e6d643ad21df668e462e11d8b24..1c93fe332cff3d23af4505184fe05e2fb5f373b4 100644 (file)
@@ -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)
index e2c37f7a5706939cea1c2ff88a22f714dd73c93b..debb6722caa079777761e9965f8cd7874e93582e 100644 (file)
@@ -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