Skip to content

Commit 5c512e1

Browse files
committed
functestlib: add get_remoteproc_path_by_firmware() to fix WiFi_Firmware_Driver
Problem - WiFi_Firmware_Driver failed with: `get_remoteproc_path_by_firmware: command not found`. - The runner expects a helper to resolve the remoteproc sysfs path for a given firmware (e.g., `wpss.mbn` on Kodiak/qcm6490/WCN6750), but the function was missing. Signed-off-by: Srikanth Muppandam <[email protected]>
1 parent 609e0e0 commit 5c512e1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Runner/utils/functestlib.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,19 @@ dt_has_remoteproc_fw() {
12641264
return 1
12651265
}
12661266

1267+
# Find the remoteproc path for a given firmware substring (e.g., "adsp", "cdsp", "gdsp").
1268+
get_remoteproc_path_by_firmware() {
1269+
name="$1"
1270+
idx path
1271+
# List all remoteproc firmware nodes, match name, and return the remoteproc path
1272+
idx=$(cat /sys/class/remoteproc/remoteproc*/firmware 2>/dev/null | grep -n "$name" | cut -d: -f1 | head -n1)
1273+
[ -z "$idx" ] && return 1
1274+
idx=$((idx - 1))
1275+
path="/sys/class/remoteproc/remoteproc${idx}"
1276+
[ -d "$path" ] && echo "$path" && return 0
1277+
return 1
1278+
}
1279+
12671280
# Get remoteproc state
12681281
get_remoteproc_state() {
12691282
rp="$1"

0 commit comments

Comments
 (0)