Skip to content

Commit

Permalink
WIFI-14410: Wifi7 driver with RAP7110C-341X support
Browse files Browse the repository at this point in the history
Signed-off-by: Wingate Chi <[email protected]>
  • Loading branch information
wingate5678 authored and blogic committed Feb 6, 2025
1 parent 426943c commit a969484
Show file tree
Hide file tree
Showing 11 changed files with 537 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf189', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'cybertan_rap630w-312g', 'cybertan_rap63xc-211g', 'sonicfi_rap630c-311g', 'sonicfi_rap630w-311g', 'sonicfi_rap630w-211g', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap105', 'edgecore_eap111', 'edgecore_eap112', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4x_3', 'hfcl_ion4xi_w', 'hfcl_ion4x_w', 'indio_um-305ax', 'sercomm_ap72tip', 'udaya_a6-id2', 'udaya_a6-od2', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf189', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'cybertan_rap630w-312g', 'cybertan_rap63xc-211g', 'sonicfi_rap630c-311g', 'sonicfi_rap630w-311g', 'sonicfi_rap630w-211g', 'sonicfi_rap7110c-341x', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap105', 'edgecore_eap111', 'edgecore_eap112', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4x_3', 'hfcl_ion4xi_w', 'hfcl_ion4x_w', 'indio_um-305ax', 'sercomm_ap72tip', 'udaya_a6-id2', 'udaya_a6-od2', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
steps:
- uses: actions/checkout@v3

Expand Down
3 changes: 3 additions & 0 deletions feeds/qca/ipq53xx/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ sercomm,ap72tip)
ucidef_set_led_netdev "wan_link" "wan_link" "green:phy" "eth0" "link"
ucidef_set_led_netdev "wan_act" "wan_act" "yellow:phy" "eth0" "rx tx"
;;
sonicfi,rap7110c-341x)
ucidef_set_led_default "power" "POWER" "pwm:blue" "on"
;;
esac

board_config_flush
Expand Down
13 changes: 10 additions & 3 deletions feeds/qca/ipq53xx/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ ipq53xx_setup_interfaces()
qcom,ipq9574-ap-al02-c4)
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5" "eth0"
;;

cig,wf189|\
edgecore,eap105|\
sercomm,ap72tip)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
;;
sonicfi,rap7110c-341x)
ucidef_set_interfaces_lan_wan "" "eth0"
;;
esac
}

qcom_setup_macs()
{
local board="$1"

case $board in
cig,wf189)
mtd=$(find_mtd_chardev "0:APPSBLENV")
Expand All @@ -44,6 +45,12 @@ qcom_setup_macs()
wan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
sonicfi,rap7110c-341x)
wan_mac=$(cat /sys/class/net/eth0/address)
ucidef_set_wireless_macaddr_base 2g $(macaddr_add "$wan_mac" 1)
ucidef_set_wireless_macaddr_base 5g $(macaddr_add "$wan_mac" 2)
ucidef_set_wireless_macaddr_base 6g $(macaddr_add "$wan_mac" 3)
;;
*)
wan_mac=$(cat /sys/class/net/eth1/address)
lan_mac=$(macaddr_add "$wan_mac" 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh

[ -e /lib/firmware/$FIRMWARE ] && exit 0

. /lib/functions.sh
. /lib/functions/system.sh
. /lib/functions/caldata.sh

caldata_die() {
echo "caldata: " "$*"
Expand Down Expand Up @@ -35,23 +35,30 @@ ath12k_generate_macs_eap105() {
}

board=$(board_name)

case "$FIRMWARE" in
ath12k/IPQ5332/hw1.0/caldata.bin)
case "$board" in
cig,wf189|\
edgecore,eap105|\
sonicfi,rap750w-311a|\
sercomm,ap72tip)
caldata_extract "0:ART" 0x1000 0x20000
;;
sonicfi,rap7110c-341x)
caldata_extract_mmc "0:ART" 0x1000 0xF800
;;
esac
;;
ath12k/QCN92XX/hw1.0/cal-pci-0001:01:00.0.bin)
case "$board" in
cig,wf189|\
edgecore,eap105|\
sonicfi,rap750w-311a|\
sercomm,ap72tip)
caldata_extract "0:ART" 0x58800 0x2d000
caldata_extract "0:ART" 0x58800 0x2d000
;;
sonicfi,rap7110c-341x)
caldata_extract_mmc "0:ART" 0x58800 0x2d000
;;
esac
;;
Expand Down
73 changes: 73 additions & 0 deletions feeds/qca/ipq53xx/base-files/lib/upgrade/platform.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,76 @@
RAMFS_COPY_BIN='fw_printenv fw_setenv'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'

find_mmc_part() {
local DEVNAME PARTNAME

if grep -q "$1" /proc/mtd; then
echo "" && return 0
fi

for DEVNAME in /sys/block/mmcblk*/mmcblk*p*; do
PARTNAME=$(grep PARTNAME ${DEVNAME}/uevent | cut -f2 -d'=')
[ "$PARTNAME" = "$1" ] && echo "/dev/$(basename $DEVNAME)" && return 0
done
}

do_flash_emmc() {
local tar_file=$1
local emmcblock=$(find_mmc_part $2)
local board_dir=$3
local part=$4

[ -b "$emmcblock" ] || emmcblock=$(find_mmc_part $2)

[ -z "$emmcblock" ] && {
echo failed to find $2
return
}

echo erase $4 / $emmcblock
dd if=/dev/zero of=${emmcblock} 2> /dev/null
echo flash $4
tar Oxf $tar_file ${board_dir}/$part | dd of=${emmcblock}
}

emmc_do_upgrade() {
local tar_file="$1"
local block_kernel="0:HLOS"
local block_rootfs="rootfs"
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
board_dir=${board_dir%/}

board=$(board_name)
case $board in
sonicfi,rap7110c-341x)
local boot_part=""
boot_part=$(fw_printenv | grep bootfrom | awk -F'=' '{printf $2}')
[ -n "$boot_part" ] || boot_part="0"
echo "**** boot_part=$boot_part" > /dev/console

if [ "$boot_part" = "0" ]; then
block_kernel="0:HLOS_1"
block_rootfs="rootfs_1"
fw_setenv bootfrom 1
elif [ "$boot_part" = "1" ]; then
block_kernel="0:HLOS"
block_rootfs="rootfs"
fw_setenv bootfrom 0
else
echo "Invalid boot partition $boot_part! Skip upgrade....."
return
fi
;;
esac
do_flash_emmc $tar_file $block_kernel $board_dir kernel
do_flash_emmc $tar_file $block_rootfs $board_dir root

local emmcblock="$(find_mmc_part "rootfs_data")"
if [ -e "$emmcblock" ]; then
mkfs.ext4 -F "$emmcblock"
fi
}

platform_check_image() {
local magic_long="$(get_magic_long "$1")"
[ "$magic_long" = "73797375" ] && return 0
Expand Down Expand Up @@ -40,5 +110,8 @@ platform_do_upgrade() {
fi
nand_upgrade_tar "$1"
;;
sonicfi,rap7110c-341x)
emmc_do_upgrade $1 $1
;;
esac
}
1 change: 1 addition & 0 deletions feeds/qca/ipq53xx/config-6.1
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1217,3 +1217,4 @@ CONFIG_ARM_PMU=y
CONFIG_REALTEK_PHY=y
CONFIG_RTK_MSSDK_PHY=y
# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set
CONFIG_LEDS_PWM=y
Loading

0 comments on commit a969484

Please sign in to comment.