Files
wlan-ap/feeds/qca-wifi-7/ipq53xx/base-files/etc/hotplug.d/firmware/10-ath12k-caldata
Ken Shi f7a9ad770d ipq533x: add CIG WF189W support
Signed-off-by: Ken Shi <xshi@actiontec.com>
2025-04-09 09:14:50 +02:00

81 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions.sh
. /lib/functions/system.sh
. /lib/functions/caldata.sh
caldata_die() {
echo "caldata: " "$*"
exit 1
}
caldata_extract() {
local part=$1
local offset=$(($2))
local count=$(($3))
local mtd
mtd=$(find_mtd_chardev $part)
[ -n "$mtd" ] || caldata_die "no mtd device found for partition $part"
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
caldata_die "failed to extract calibration data from $mtd"
}
board=$(board_name)
case "$FIRMWARE" in
ath12k/IPQ5332/hw1.0/caldata.bin)
case "$board" in
cig,wf189w|\
cig,wf189|\
edgecore,eap105|\
sercomm,ap72tip)
caldata_extract "0:ART" 0x1000 0x20000
;;
sonicfi,rap7110c-341x)
caldata_extract_mmc "0:ART" 0x1000 0xF800
;;
sonicfi,rap750w-311a)
caldata_extract "0:ART" 0x1000 0xf800
;;
esac
;;
ath12k/QCN92XX/hw1.0/cal-pci-0001:01:00.0.bin)
case "$board" in
cig,wf189|\
edgecore,eap105|\
sercomm,ap72tip)
caldata_extract "0:ART" 0x58800 0x2d000
;;
sonicfi,rap7110c-341x)
caldata_extract_mmc "0:ART" 0x58800 0x2d000
;;
esac
;;
ath12k/QCN6432/hw1.0/caldata_1.bin)
case "$board" in
sonicfi,rap750w-311a)
caldata_extract "0:ART" 0x26800 0x18800
;;
esac
;;
ath12k/QCN6432/hw1.0/cal-ahb-soc@0:wifi1@c0000000.bin)
case "$board" in
cig,wf189w)
caldata_extract "0:ART" 0x26800 0x20000
;;
esac
;;
ath12k/QCN6432/hw1.0/cal-ahb-soc@0:wifi2@c0000000.bin)
case "$board" in
cig,wf189w)
caldata_extract "0:ART" 0x58800 0x20000
;;
esac
;;
*)
exit 1
;;
esac