Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified Runner/init_env
100755 → 100644
Empty file.
Empty file modified Runner/plans/meta-qcom_PreMerge.yaml
100755 → 100644
Empty file.
Empty file modified Runner/plans/qcom-next-ci-premerge.yaml
100755 → 100644
Empty file.
Empty file modified Runner/run-test.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Connectivity/Bluetooth/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Connectivity/Ethernet/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/DCVS/Freq_Scaling/run.sh
100755 → 100644
Empty file.
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh
100755 → 100644
Empty file.
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/Interrupts/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh
100755 → 100644
Empty file.
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/USBHost/run.sh
100755 → 100644
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# gdsp_remoteproc Test

© Qualcomm Technologies, Inc. and/or its subsidiaries.
SPDX-License-Identifier: BSD-3-Clause-Clear

## Overview

This test case validates the functionality of the **GPDSP (General Purpose DSP)** firmware loading and control on the **Lemans** platform. It specifically targets:

- `gpdsp0`
- `gpdsp1`

The script ensures that each GPDSP remote processor:
- Is currently running
- Can be stopped successfully
- Can be restarted and returns to the running state

This is essential for verifying the stability and control of DSP subsystems on Qualcomm-based platforms.

## Usage

### Instructions

1. **Transfer the Script**: Use `scp` or any file transfer method to copy the script to the Lemans target device.
2. **Navigate to the Script Directory**: SSH into the device and go to the directory where the script is located.
3. **Run the Script**:
```sh
./run.sh
```
---
#### Quick Example
```
git clone <this-repo>
cd <this-repo>
scp -r common Runner user@target_device_ip:<Path in device>
ssh user@target_device_ip
cd <Path in device>/Runner && ./run-test.sh gdsp_remoteproc
```
---
## Prerequisites
1. The device must expose `/sys/class/remoteproc/remoteproc*/firmware and /state` interfaces.
2. Root access may be required to write to remoteproc state files.
3. The firmware names must include gpdsp0 and gpdsp1.
---
## Result Format
Test result will be saved in `gdsp_remoteproc.res` as:
## Output
A .res file is generated in the same directory:

`gdsp_remoteproc PASS` OR `gdsp_remoteproc FAIL`

## Sample Log
```
Output

[INFO] 1970-01-01 03:56:11 - ------------------------------------------------------------------------------
[INFO] 1970-01-01 03:56:11 - -------------------Starting gdsp_remoteproc Testcase----------------------------
[INFO] 1970-01-01 03:56:11 - === Test Initialization ===
[INFO] 1970-01-01 03:56:11 - Found gpdsp0 at /sys/class/remoteproc/remoteproc3
[PASS] 1970-01-01 03:56:11 - gpdsp0 stop successful
[INFO] 1970-01-01 03:56:11 - Restarting gpdsp0
[PASS] 1970-01-01 03:56:12 - gpdsp0 PASS
[INFO] 1970-01-01 03:56:12 - Found gpdsp1 at /sys/class/remoteproc/remoteproc4
[PASS] 1970-01-01 03:56:12 - gpdsp1 stop successful
[INFO] 1970-01-01 03:56:12 - Restarting gpdsp1
[PASS] 1970-01-01 03:56:12 - gpdsp1 PASS
[INFO] 1970-01-01 03:56:12 - -------------------Completed gdsp_remoteproc Testcase----------------------------
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

# Robustly find and source init_env
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
INIT_ENV=""
SEARCH="$SCRIPT_DIR"
while [ "$SEARCH" != "/" ]; do
if [ -f "$SEARCH/init_env" ]; then
INIT_ENV="$SEARCH/init_env"
break
fi
SEARCH=$(dirname "$SEARCH")
done

if [ -z "$INIT_ENV" ]; then
echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2
exit 1
fi

if [ -z "$__INIT_ENV_LOADED" ]; then
# shellcheck disable=SC1090
. "$INIT_ENV"
fi
# shellcheck disable=SC1090,SC1091
. "$TOOLS/functestlib.sh"

TESTNAME="gdsp_remoteproc"
test_path=$(find_test_case_by_name "$TESTNAME")
cd "$test_path" || exit 1
res_file="./$TESTNAME.res"

log_info "-----------------------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
log_info "=== Test Initialization ==="

for gdsp_firmware in gpdsp0 gpdsp1; do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to have a modular and reusable approach for remoteproc validation. It's better to move it to functestlib.sh files, allowing it to find the remoteproc path for a given firmware substring.

log_info "Processing $gdsp_firmware"
rproc_path=$(get_remoteproc_path_by_firmware "$gdsp_firmware")
if [ -z "$rproc_path" ]; then
log_fail "$gdsp_firmware remoteproc path not found"
echo "$TESTNAME FAIL" > "$res_file"
exit 1
fi

log_info "Found $gdsp_firmware remoteproc at $rproc_path"

state=$(get_remoteproc_state "$rproc_path")
if [ "$state" != "running" ]; then
log_fail "$gdsp_firmware not running initially"
echo "$TESTNAME FAIL" > "$res_file"
exit 1
fi

if ! stop_remoteproc "$rproc_path"; then
log_fail "$gdsp_firmware stop failed"
echo "$TESTNAME FAIL" > "$res_file"
exit 1
else
log_pass "$gdsp_firmware stop successful"
fi

log_info "Restarting $gdsp_firmware"
if ! start_remoteproc "$rproc_path"; then
log_fail "$gdsp_firmware start failed"
echo "$TESTNAME FAIL" > "$res_file"
exit 1
fi

log_pass "$gdsp_firmware PASS"
done

echo "$TESTNAME PASS" > "$res_file"
log_info "-------------------Completed $TESTNAME Testcase----------------------------"
exit 0
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/pinctrl/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/qcrypto/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/remoteproc/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/rngtest/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/shmbridge/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/smmu/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/storage/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Kernel/FunctionalArea/baseport/watchdog/run.sh
100755 → 100644
Empty file.
Empty file.
Empty file modified Runner/suites/Multimedia/Audio/AudioPlayback/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Multimedia/Audio/AudioRecord/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Multimedia/CDSP/fastrpc_test/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Multimedia/DSP_AudioPD/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Multimedia/Graphics/KMSCube/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/suites/Multimedia/Graphics/weston-simple-egl/run.sh
100755 → 100644
Empty file.
Empty file.
Empty file modified Runner/suites/Multimedia/Video/iris_v4l2_video_decode/run.sh
100755 → 100644
Empty file.
Empty file.
Empty file modified Runner/suites/Multimedia/Video/iris_v4l2_video_encode/run.sh
100755 → 100644
Empty file.
Empty file modified Runner/utils/basics.sh
100755 → 100644
Empty file.
48 changes: 48 additions & 0 deletions Runner/utils/functestlib.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -391,3 +391,51 @@ weston_start() {
fi
}

# Find the remoteproc path for a given firmware substring (e.g., "adsp", "cdsp", "gdsp").
get_remoteproc_path_by_firmware() {
name="$1"
local idx path
# List all remoteproc firmware nodes, match name, and return the remoteproc path
idx=$(cat /sys/class/remoteproc/remoteproc*/firmware 2>/dev/null | grep -n "$name" | cut -d: -f1 | head -n1)
[ -z "$idx" ] && return 1
idx=$((idx - 1))
path="/sys/class/remoteproc/remoteproc${idx}"
[ -d "$path" ] && echo "$path" && return 0
return 1
}

# Get current remoteproc state
get_remoteproc_state() {
rproc_path="$1"
[ -f "$rproc_path/state" ] && cat "$rproc_path/state"
}

# Wait until remoteproc reaches a given state (with retries)
wait_remoteproc_state() {
rproc_path="$1"
target="$2"
retries="${3:-6}"
i=0
while [ $i -lt "$retries" ]; do
state=$(get_remoteproc_state "$rproc_path")
[ "$state" = "$target" ] && return 0
sleep 1
i=$((i+1))
done
return 1
}

# Stop remoteproc (wait for "offline")
stop_remoteproc() {
rproc_path="$1"
echo stop > "$rproc_path/state"
wait_remoteproc_state "$rproc_path" "offline" 6
}

# Start remoteproc (wait for "running")
start_remoteproc() {
rproc_path="$1"
echo start > "$rproc_path/state"
wait_remoteproc_state "$rproc_path" "running" 6
}

Empty file modified Runner/utils/platform.sh
100755 → 100644
Empty file.
Empty file modified Runner/utils/result_parse.sh
100755 → 100644
Empty file.
Empty file modified Runner/utils/send-to-lava.sh
100755 → 100644
Empty file.
Loading