ath79: add support for ALFA Network Pi-WiFi4
authorPiotr Dymacz <pepe2k@gmail.com>
Fri, 9 Oct 2020 05:30:24 +0000 (07:30 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Wed, 18 Nov 2020 22:49:34 +0000 (23:49 +0100)
ALFA Network Pi-WiFi4 is a Qualcomm QCA9531 v2 based, high-power 802.11n
WiFi board in Raspberry Pi 3B shape, equipped with 1x FE and 4x USB 2.0.

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 650/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16+ MB of flash (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 2T2R 2.4 GHz Wi-Fi with Qorvo RFFM8228P FEM
- 2x IPEX/U.FL connectors on PCB
- 4x USB 2.0 Type-A
- Genesys Logic GL850G 4-port USB HUB
- USB power is controlled by GPIO
- 5x LED (3x on PCB, 2x in RJ45, 4x driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- 1x micro USB Type-B for power and system console (Holtek HT42B534)
- UART and GPIO (8-pin, 1.27 mm pitch) header on PCB

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   device, wait for first blink of all LEDs (indicates network setup),
   then keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts [new file with mode: 0644]
target/linux/ath79/generic/base-files/etc/board.d/01_leds
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/image/generic.mk

diff --git a/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts b/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts
new file mode 100644 (file)
index 0000000..42f2c9f
--- /dev/null
@@ -0,0 +1,87 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca9531_alfa-network_r36a.dtsi"
+
+/ {
+       model = "ALFA Network Pi-WiFi4";
+       compatible = "alfa-network,pi-wifi4", "qca,qca9531";
+
+       aliases {
+               led-boot = &led_usb;
+               led-failsafe = &led_usb;
+               led-upgrade = &led_usb;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&enable_gpio4 &enable_gpio16>;
+
+               lan_data {
+                       label = "orange:lan_data";
+                       gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+               };
+
+               lan_link {
+                       label = "green:lan_link";
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+               };
+
+               led_usb: usb {
+                       label = "green:usb";
+                       gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "usbport";
+                       trigger-sources = <&gl850g_port1>, <&gl850g_port2>,
+                                         <&gl850g_port3>, <&gl850g_port4>;
+               };
+
+               wlan {
+                       label = "blue:wlan";
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "phy0tpt";
+               };
+       };
+};
+
+&eth0 {
+       mtd-mac-address = <&art 0x1002>;
+       mtd-mac-address-increment = <(-1)>;
+};
+
+&eth1 {
+       compatible = "syscon", "simple-mfd";
+};
+
+&gpio_export {
+       usb-power {
+               gpio-export,name = "usb-power";
+               gpio-export,output = <1>;
+               gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
+       };
+};
+
+&hub_port0 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       gl850g_port1: port@1 {
+               reg = <1>;
+               #trigger-source-cells = <0>;
+       };
+
+       gl850g_port2: port@2 {
+               reg = <2>;
+               #trigger-source-cells = <0>;
+       };
+
+       gl850g_port3: port@3 {
+               reg = <3>;
+               #trigger-source-cells = <0>;
+       };
+
+       gl850g_port4: port@4 {
+               reg = <4>;
+               #trigger-source-cells = <0>;
+       };
+};
index 08ca2a839830200402f2a578b22403ec3a7604f8..a345dca4af79161e0cbc85700c3d83a43dd70c0b 100755 (executable)
@@ -40,6 +40,10 @@ alfa-network,n5q)
        ucidef_set_led_rssi "signal3" "SIGNAL3" "green:signal3" "wlan0" "50" "100"
        ucidef_set_led_rssi "signal4" "SIGNAL4" "green:signal4" "wlan0" "75" "100"
        ;;
+alfa-network,pi-wifi4)
+       ucidef_set_led_netdev "lan_data" "LAN_DATA" "orange:lan_data" "eth0" "tx rx"
+       ucidef_set_led_netdev "lan_link" "LAN_LINK" "green:lan_link" "eth0" "link"
+       ;;
 alfa-network,r36a)
        ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0"
        ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x10"
index 4d0766d262e27b354e7d9d0b5aabdedb4242b8fb..d03399a054237364435c90e86129b894161ef389 100755 (executable)
@@ -13,6 +13,7 @@ ath79_setup_interfaces()
        adtran,bsap1840|\
        allnet,all-wap02860ac|\
        alfa-network,ap121f|\
+       alfa-network,pi-wifi4|\
        arduino,yun|\
        aruba,ap-105|\
        avm,fritz1750e|\
@@ -418,6 +419,7 @@ ath79_setup_macs()
        alfa-network,ap121fe|\
        alfa-network,n2q|\
        alfa-network,n5q|\
+       alfa-network,pi-wifi4|\
        alfa-network,r36a|\
        engenius,ens202ext-v1)
                label_mac=$(mtd_get_mac_binary art 0x1002)
index dc91e1b6d976c0cd6af4e27f88a0707585331d7e..fc8b136c5109faca3145bef4caba333ac983b708 100644 (file)
@@ -257,6 +257,15 @@ define Device/alfa-network_n5q
 endef
 TARGET_DEVICES += alfa-network_n5q
 
+define Device/alfa-network_pi-wifi4
+  SOC := qca9531
+  DEVICE_VENDOR := ALFA Network
+  DEVICE_MODEL := Pi-WiFi4
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport -swconfig
+  IMAGE_SIZE := 15872k
+endef
+TARGET_DEVICES += alfa-network_pi-wifi4
+
 define Device/alfa-network_r36a
   SOC := qca9531
   DEVICE_VENDOR := ALFA Network