ipq807x: improve EAP106 support

The AQ PHY FW was not getting uplaoded properly.

Fixes: WIFI-6055
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2021-12-06 13:21:51 +01:00
parent 1d4b8ab7ff
commit ec8d056cc8
2 changed files with 78 additions and 16 deletions

View File

@@ -2,35 +2,43 @@ Index: qca-ssdk/include/hsl/phy/hsl_phy.h
===================================================================
--- qca-ssdk.orig/include/hsl/phy/hsl_phy.h
+++ qca-ssdk/include/hsl/phy/hsl_phy.h
@@ -541,6 +541,7 @@ typedef struct {
@@ -562,6 +562,7 @@ typedef struct {
#define QCA8033_PHY 0x004DD074
#define QCA8035_PHY 0x004DD072
/*qca808x_start*/
+#define QCA8081_PHY 0x004DD100
#define QCA8081_PHY_V1_1 0x004DD101
#define INVALID_PHY_ID 0
#define INVALID_PHY_ID 0xFFFFFFFF
@@ -559,6 +560,7 @@ typedef struct {
@@ -576,11 +577,14 @@ typedef struct {
#define AQUANTIA_PHY_109 0x03a1b502
#define AQUANTIA_PHY_111 0x03a1b610
#define AQUANTIA_PHY_111B0 0x03a1b612
+#define AQUANTIA_PHY_111C 0x03a1b7e2
#define AQUANTIA_PHY_112 0x03a1b660
#define AQUANTIA_PHY_113C_A0 0x31c31C10
#define AQUANTIA_PHY_113C_A1 0x31c31C11
#define AQUANTIA_PHY_112C 0x03a1b792
+#define AQUANTIA_PHY_114C 0x31c31C22
+#define AQUANTIA_PHY_114C 0x31c31C22
+
#define PHY_805XV2 0x004DD082
#define PHY_805XV1 0x004DD081
/*qca808x_start*/
Index: qca-ssdk/src/hsl/phy/hsl_phy.c
===================================================================
--- qca-ssdk.orig/src/hsl/phy/hsl_phy.c
+++ qca-ssdk/src/hsl/phy/hsl_phy.c
@@ -231,6 +231,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
@@ -231,6 +231,8 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
case AQUANTIA_PHY_108:
case AQUANTIA_PHY_109:
case AQUANTIA_PHY_111:
+ case AQUANTIA_PHY_111C:
+ case AQUANTIA_PHY_114C:
case AQUANTIA_PHY_111B0:
case AQUANTIA_PHY_112:
case AQUANTIA_PHY_113C_A0:
@@ -250,6 +251,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
@@ -250,6 +252,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
phytype = MPGE_PHY_CHIP;
break;
/*qca808x_start*/

View File

@@ -1,7 +1,7 @@
From 19c481164dc772e49e173e08d1bfd266a5f458dd Mon Sep 17 00:00:00 2001
From c1670dcdda1ab0f5310f76e5ae6e710bd16892c7 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Sat, 18 Jul 2020 08:53:44 +0200
Subject: [PATCH 01/36] ipq807x: add the Qualcomm AX target support
Subject: [PATCH 01/38] ipq807x: add the Qualcomm AX target support
Signed-off-by: John Crispin <john@phrozen.org>
---
@@ -14,9 +14,11 @@ Signed-off-by: John Crispin <john@phrozen.org>
target/linux/ipq807x/Makefile | 22 +
.../ipq807x/base-files/etc/board.d/01_leds | 38 +
.../ipq807x/base-files/etc/board.d/02_network | 81 +
.../ipq807x/base-files/etc/board.d/03_wifi | 17 +
.../etc/hotplug.d/firmware/10-ath11k-caldata | 111 +
.../etc/hotplug.d/firmware/11-ath10k-caldata | 16 +
.../ipq807x/base-files/etc/hotplug.d/net/macs | 3 +
.../ipq807x/base-files/etc/init.d/aq_phy | 16 +
.../ipq807x/base-files/etc/init.d/aq_phy | 21 +
.../ipq807x/base-files/etc/init.d/bootcount | 12 +
.../linux/ipq807x/base-files/etc/init.d/wdt | 14 +
...G4_v5.4.B-AQR_CIG_WIFI_ID44715_VER1673.cld | Bin 0 -> 391170 bytes
@@ -66,13 +68,15 @@ Signed-off-by: John Crispin <john@phrozen.org>
target/linux/ipq807x/patches/112-pstore.patch | 147 +
.../ipq807x/patches/200-bpf_backport.patch | 44780 ++++++++++++++++
toolchain/kernel-headers/Makefile | 8 +
61 files changed, 56703 insertions(+), 2 deletions(-)
63 files changed, 56741 insertions(+), 2 deletions(-)
create mode 100644 package/boot/uboot-envtools/files/ipq807x
create mode 100644 target/linux/ipq807x/109-logspam.patch
create mode 100644 target/linux/ipq807x/Makefile
create mode 100755 target/linux/ipq807x/base-files/etc/board.d/01_leds
create mode 100755 target/linux/ipq807x/base-files/etc/board.d/02_network
create mode 100755 target/linux/ipq807x/base-files/etc/board.d/03_wifi
create mode 100755 target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata
create mode 100644 target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
create mode 100644 target/linux/ipq807x/base-files/etc/hotplug.d/net/macs
create mode 100755 target/linux/ipq807x/base-files/etc/init.d/aq_phy
create mode 100755 target/linux/ipq807x/base-files/etc/init.d/bootcount
@@ -344,7 +348,7 @@ index 0000000000..1f1797b0c6
+exit 0
diff --git a/target/linux/ipq807x/base-files/etc/board.d/02_network b/target/linux/ipq807x/base-files/etc/board.d/02_network
new file mode 100755
index 0000000000..7772e309a3
index 0000000000..96bff27075
--- /dev/null
+++ b/target/linux/ipq807x/base-files/etc/board.d/02_network
@@ -0,0 +1,81 @@
@@ -375,6 +379,7 @@ index 0000000000..7772e309a3
+ ;;
+ cig,wf194c|\
+ cig,wf194c4|\
+ edgecore,eap106|\
+ qcom,ipq5018-mp03.3|\
+ sercomm,wallaby)
+ ucidef_set_interface_lan "eth0"
@@ -385,7 +390,6 @@ index 0000000000..7772e309a3
+ ucidef_set_interface_wan "eth0"
+ ;;
+ edgecore,eap102|\
+ edgecore,eap106|\
+ wallys,dr6018|\
+ cig,wf188n)
+ ucidef_set_interface_lan "eth1"
@@ -429,6 +433,29 @@ index 0000000000..7772e309a3
+board_config_flush
+
+exit 0
diff --git a/target/linux/ipq807x/base-files/etc/board.d/03_wifi b/target/linux/ipq807x/base-files/etc/board.d/03_wifi
new file mode 100755
index 0000000000..200e43d15c
--- /dev/null
+++ b/target/linux/ipq807x/base-files/etc/board.d/03_wifi
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+board=$(board_name)
+
+case "$board" in
+edgecore,eap106)
+ ucidef_set_wifi_scanning 'soc/10000000.pci/pci0001:00/0001:00:00.0/0001:01:00.0'
+ ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata
new file mode 100755
index 0000000000..016416c089
@@ -546,6 +573,28 @@ index 0000000000..016416c089
+ exit 1
+ ;;
+esac
diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
new file mode 100644
index 0000000000..eb23e8cd7a
--- /dev/null
+++ b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath10k/pre-cal-pci-0001:01:00.0.bin")
+ case $board in
+ edgecore,eap106)
+ caldata_extract "0:ART" 0x33000 0x2f20
+ ;;
+ esac
+esac
diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/net/macs b/target/linux/ipq807x/base-files/etc/hotplug.d/net/macs
new file mode 100644
index 0000000000..10f38108c8
@@ -557,10 +606,10 @@ index 0000000000..10f38108c8
+[ -n "$mac" ] && ip link set $DEVICENAME address $mac
diff --git a/target/linux/ipq807x/base-files/etc/init.d/aq_phy b/target/linux/ipq807x/base-files/etc/init.d/aq_phy
new file mode 100755
index 0000000000..e64755b5d6
index 0000000000..c56ce91ed1
--- /dev/null
+++ b/target/linux/ipq807x/base-files/etc/init.d/aq_phy
@@ -0,0 +1,16 @@
@@ -0,0 +1,21 @@
+#!/bin/sh /etc/rc.common
+
+START=30
@@ -575,6 +624,11 @@ index 0000000000..e64755b5d6
+ sleep 1
+ ssdk_sh debug phy set 0 0x4004c441 0x8
+ ;;
+ edgecore,eap106)
+ aq-fw-download /lib/firmware/AQR-G4_v5.5.6-AQR_CIG_WIFI_ID44858_VER1745.cld miireg 8 > /dev/null
+ sleep 1
+ ssdk_sh debug phy set 8 0x4004c441 0x8
+ ;;
+ esac
+}
diff --git a/target/linux/ipq807x/base-files/etc/init.d/bootcount b/target/linux/ipq807x/base-files/etc/init.d/bootcount
@@ -8907,7 +8961,7 @@ index 0000000000..e94ab22785
+TARGET_DEVICES += xiaomi_ax1800
diff --git a/target/linux/ipq807x/image/ipq807x.mk b/target/linux/ipq807x/image/ipq807x.mk
new file mode 100644
index 0000000000..1785478ea4
index 0000000000..ba39ad8466
--- /dev/null
+++ b/target/linux/ipq807x/image/ipq807x.mk
@@ -0,0 +1,90 @@
@@ -8972,7 +9026,7 @@ index 0000000000..1785478ea4
+ DEVICE_DTS := qcom-ipq807x-eap106
+ DEVICE_DTS_CONFIG=config@hk02
+ SUPPORTED_DEVICES := edgecore,eap106
+ DEVICE_PACKAGES := ath11k-wifi-edgecore-eap106 iaq-fw-download kmod-usb2 kmod-usb3 uboot-envtools
+ DEVICE_PACKAGES := ath11k-wifi-edgecore-eap106 aq-fw-download kmod-usb2 kmod-usb3 uboot-envtools
+endef
+TARGET_DEVICES += edgecore_eap106
+