[openwrt/openwrt] ath79: add support for Araknis AN-700-AP-I-AC

LEDE Commits lede-commits at lists.infradead.org
Sun Mar 13 12:53:49 PDT 2022


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/41be1a2de2f84f532a7eb1c11ece99811ca47ba5

commit 41be1a2de2f84f532a7eb1c11ece99811ca47ba5
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Wed Sep 8 17:00:00 2021 -0400

    ath79: add support for Araknis AN-700-AP-I-AC
    
    FCC ID: 2AG6R-AN700APIAC
    
    Araknis AN-700-AP-I-AC is an indoor wireless access point with
    1 Gb ethernet port, dual-band wireless,
    internal antenna plates, and 802.3at PoE+
    
    this board is a Senao device:
    the hardware is equivalent to EnGenius EAP1750
    the software is modified Senao SDK which is based on openwrt and uboot
    including image checksum verification at boot time,
    and a failsafe image that boots if checksum fails
    
    **Specification:**
    
      - QCA9558 SOC         MIPS 74kc, 2.4 GHz WMAC, 3x3
      - QCA9880 WLAN        PCI card, 5 GHz, 3x3, 26dBm
      - AR8035-A PHY        RGMII GbE with PoE+ IN
      - 40 MHz clock
      - 16 MB FLASH         MX25L12845EMI-10G
      - 2x 64 MB RAM        NT5TU32M16
      - UART console        J10, populated, RX shorted to ground
      - 4 antennas          5 dBi, internal omni-directional plates
      - 4 LEDs              power, 2G, 5G, wps
      - 1 button            reset
    
      NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide
            therefore, the power LED is off for default state
    
    **MAC addresses:**
    
      MAC address labeled as ETH
      Only one Vendor MAC address in flash at art 0x0
    
      eth0 ETH  *:xb art 0x0
      phy1 2.4G *:xc ---
      phy0 5GHz *:xd ---
    
    **Serial Access:**
    
      the RX line on the board for UART is shorted to ground by resistor R176
      therefore it must be removed to use the console
      but it is not necessary to remove to view boot log
    
      optionally, R175 can be replaced with a solder bridge short
    
      the resistors R175 and R176 are next to the UART RX pin at J10
    
    **Installation:**
    
      Method 1: Firmware upgrade page:
    
        (if you cannot access the APs webpage)
        factory reset with the reset button
        connect ethernet to a computer
        OEM webpage at 192.168.20.253
        username and password 'araknis'
        make a new password, login again...
    
        Navigate to 'File Management' page from left pane
        Click Browse and select the factory.bin image
        Upload and verify checksum
        Click Continue to confirm
        wait about 3 minutes
    
      Method 2: Serial to load Failsafe webpage:
    
        After connecting to serial console and rebooting...
        Interrupt uboot with any key pressed rapidly
        execute `run failsafe_boot` OR `bootm 0x9fd70000`
        wait a minute
        connect to ethernet and navigate to
        192.168.20.253
        Select the factory.bin image and upload
        wait about 3 minutes
    
    **Return to OEM:**
    
      Method 1: Serial to load Failsafe webpage (above)
    
      Method 2: delete a checksum from uboot-env
      this will make uboot load the failsafe image at next boot
      because it will fail the checksum verification of the image
    
        ssh into openwrt and run
        `fw_setenv rootfs_checksum 0`
        reboot, wait a minute
        connect to ethernet and navigate to
        192.168.20.253
        select OEM firmware image and click upgrade
    
      Method 3: backup mtd partitions before upgrade
    
    **TFTP recovery:**
    
      Requires serial console, reset button does nothing
    
      rename initramfs-kernel.bin to '0101A8C0.img'
      make available on TFTP server at 192.168.1.101
      power board, interrupt boot with serial console
      execute `tftpboot` and `bootm 0x81000000`
    
      NOTE: TFTP may not be reliable due to bugged bootloader
            set MTU to 600 and try many times
    
    **Format of OEM firmware image:**
    
      The OEM software is built using SDKs from Senao
      which is based on a heavily modified version
      of Openwrt Kamikaze or Altitude Adjustment.
      One of the many modifications is sysupgrade being performed by a custom script.
      Images are verified through successful unpackaging, correct filenames
      and size requirements for both kernel and rootfs files, and that they
      start with the correct magic numbers (first 2 bytes) for the respective headers.
    
      Newer Senao software requires more checks but their script
      includes a way to skip them.
    
      The OEM upgrade script is at
      /etc/fwupgrade.sh
    
      OKLI kernel loader is required because the OEM software
      expects the kernel to be less than 1536k
      and the OEM upgrade procedure would otherwise
      overwrite part of the kernel when writing rootfs.
    
    Note on PLL-data cells:
    
      The default PLL register values will not work
      because of the external AR8035 switch between
      the SOC and the ethernet port.
    
      For QCA955x series, the PLL registers for eth0 and eth1
      can be see in the DTSI as 0x28 and 0x48 respectively.
      Therefore the PLL registers can be read from uboot
      for each link speed after attempting tftpboot
      or another network action using that link speed
      with `md 0x18050028 1` and `md 0x18050048 1`.
    
      The clock delay required for RGMII can be applied at the PHY side,
      using the at803x driver `phy-mode` setting through the DTS.
      Therefore, the Ethernet Configuration registers for GMAC0
      do not need the bits for RGMII delay on the MAC side.
      This is possible due to fixes in at803x driver
      since Linux 5.1 and 5.3
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 package/boot/uboot-envtools/files/ath79            |   1 +
 .../ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts   | 104 +++++++++++++++++++++
 .../generic/base-files/etc/board.d/02_network      |   1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |   1 +
 .../generic/base-files/lib/upgrade/platform.sh     |   1 +
 target/linux/ath79/image/generic.mk                |  12 +++
 6 files changed, 120 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
index 87a129cd89..230f2fe417 100644
--- a/package/boot/uboot-envtools/files/ath79
+++ b/package/boot/uboot-envtools/files/ath79
@@ -22,6 +22,7 @@ alfa-network,tube-2hq|\
 allnet,all-wap02860ac|\
 araknis,an-300-ap-i-n|\
 araknis,an-500-ap-i-ac|\
+araknis,an-700-ap-i-ac|\
 arduino,yun|\
 buffalo,bhr-4grv2|\
 devolo,magic-2-wifi|\
diff --git a/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts
new file mode 100644
index 0000000000..304eac5e62
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts
@@ -0,0 +1,104 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca955x_senao_loader.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "araknis,an-700-ap-i-ac", "qca,qca9558";
+	model = "Araknis AN-700-AP-I-AC";
+
+	aliases {
+		label-mac-device = &eth0;
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "amber:power";
+			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		wifi2g {
+			label = "blue:wifi2g";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wifi5g {
+			label = "blue:wifi5g";
+			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		wps {
+			label = "blue:wps";
+			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&partitions {
+	art: partition at ff0000 {
+		label = "art";
+		reg = <0xff0000 0x010000>;
+		read-only;
+	};
+};
+
+&mdio0 {
+	status = "okay";
+
+	phy5: ethernet-phy at 5 {
+		reg = <5>;
+		eee-broken-100tx;
+		eee-broken-1000t;
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	nvmem-cells = <&macaddr_art_0>;
+	nvmem-cell-names = "mac-address";
+
+	phy-handle = <&phy5>;
+	phy-mode = "rgmii-id";
+
+	pll-data = <0x82000000 0x80000101 0x80001313>;
+};
+
+&wmac {
+	status = "okay";
+
+	mtd-cal-data = <&art 0x1000>;
+	nvmem-cells = <&macaddr_art_0>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&art {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_art_0: macaddr at 0 {
+		reg = <0x0 0x6>;
+	};
+};
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 9641cac39f..bc32081910 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -16,6 +16,7 @@ ath79_setup_interfaces()
 	alfa-network,tube-2hq|\
 	araknis,an-300-ap-i-n|\
 	araknis,an-500-ap-i-ac|\
+	araknis,an-700-ap-i-ac|\
 	arduino,yun|\
 	aruba,ap-105|\
 	asus,rp-ac66|\
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 cede6daf86..b8e99a661f 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
@@ -12,6 +12,7 @@ case "$FIRMWARE" in
 	case $board in
 	allnet,all-wap02860ac|\
 	araknis,an-500-ap-i-ac|\
+	araknis,an-700-ap-i-ac|\
 	engenius,eap1200h|\
 	engenius,enstationac-v1|\
 	glinet,gl-x750)
diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
index 38975129f1..953d6a96d3 100644
--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
@@ -50,6 +50,7 @@ platform_do_upgrade() {
 	allnet,all-wap02860ac|\
 	araknis,an-300-ap-i-n|\
 	araknis,an-500-ap-i-ac|\
+	araknis,an-700-ap-i-ac|\
 	engenius,eap1200h|\
 	engenius,eap300-v2|\
 	engenius,eap600|\
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 2d595ccf63..769c0ee1da 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -343,6 +343,18 @@ define Device/araknis_an-500-ap-i-ac
 endef
 TARGET_DEVICES += araknis_an-500-ap-i-ac
 
+define Device/araknis_an-700-ap-i-ac
+  $(Device/senao_loader_okli)
+  SOC := qca9558
+  DEVICE_VENDOR := Araknis
+  DEVICE_MODEL := AN-700-AP-I-AC
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
+  IMAGE_SIZE := 11584k
+  LOADER_FLASH_OFFS := 0x220000
+  SENAO_IMGNAME := senao-generic-v1-an700
+endef
+TARGET_DEVICES += araknis_an-700-ap-i-ac
+
 define Device/arduino_yun
   SOC := ar9331
   DEVICE_VENDOR := Arduino




More information about the lede-commits mailing list