Skip to content

Commit 9d28d0d

Browse files
committed
Add gdsp_remoteproc test script and README for Lemans platform
This commit introduces a test script to validate gpdsp0 and gpdsp1 remoteproc functionality on the Lemans platform. It includes start/stop/restart checks and logs results in a standardized format. A detailed README is also added to document usage, expected output, and prerequisites. Signed-off-by: Sai-teja573 <122cs0573@nitrkl.ac.in>
1 parent a7d3701 commit 9d28d0d

File tree

2 files changed

+146
-0
lines changed
  • Runner/suites/Kernel/FunctionalArea/baseport/gdsp_remoteproc

2 files changed

+146
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# gdsp_remoteproc Test
2+
3+
© Qualcomm Technologies, Inc. and/or its subsidiaries.
4+
SPDX-License-Identifier: BSD-3-Clause-Clear
5+
6+
## Overview
7+
8+
This test case validates the functionality of the **GPDSP (General Purpose DSP)** firmware loading and control on the **Lemans** platform. It specifically targets:
9+
10+
- `gpdsp0`
11+
- `gpdsp1`
12+
13+
The script ensures that each GPDSP remote processor:
14+
- Is currently running
15+
- Can be stopped successfully
16+
- Can be restarted and returns to the running state
17+
18+
This is essential for verifying the stability and control of DSP subsystems on Qualcomm-based platforms.
19+
20+
## Usage
21+
22+
### Instructions
23+
24+
1. **Transfer the Script**: Use `scp` or any file transfer method to copy the script to the Lemans target device.
25+
2. **Navigate to the Script Directory**: SSH into the device and go to the directory where the script is located.
26+
3. **Run the Script**:
27+
```sh
28+
./run.sh
29+
```
30+
---
31+
#### Quick Example
32+
```
33+
git clone <this-repo>
34+
cd <this-repo>
35+
scp -r common Runner user@target_device_ip:<Path in device>
36+
ssh user@target_device_ip
37+
cd <Path in device>/Runner && ./run-test.sh gdsp_remoteproc
38+
```
39+
---
40+
## Prerequisites
41+
1. The device must expose `/sys/class/remoteproc/remoteproc*/firmware and /state` interfaces.
42+
2. Root access may be required to write to remoteproc state files.
43+
3. The firmware names must include gpdsp0 and gpdsp1.
44+
---
45+
## Result Format
46+
Test result will be saved in `gdsp_remoteproc.res` as:
47+
## Output
48+
A .res file is generated in the same directory:
49+
50+
`gdsp_remoteproc PASS` OR `gdsp_remoteproc FAIL`
51+
52+
## Sample Log
53+
```
54+
Output
55+
56+
[INFO] 1970-01-01 03:56:11 - ------------------------------------------------------------------------------
57+
[INFO] 1970-01-01 03:56:11 - -------------------Starting gdsp_remoteproc Testcase----------------------------
58+
[INFO] 1970-01-01 03:56:11 - === Test Initialization ===
59+
[INFO] 1970-01-01 03:56:11 - Found gpdsp0 at /sys/class/remoteproc/remoteproc3
60+
[PASS] 1970-01-01 03:56:11 - gpdsp0 stop successful
61+
[INFO] 1970-01-01 03:56:11 - Restarting gpdsp0
62+
[PASS] 1970-01-01 03:56:12 - gpdsp0 PASS
63+
[INFO] 1970-01-01 03:56:12 - Found gpdsp1 at /sys/class/remoteproc/remoteproc4
64+
[PASS] 1970-01-01 03:56:12 - gpdsp1 stop successful
65+
[INFO] 1970-01-01 03:56:12 - Restarting gpdsp1
66+
[PASS] 1970-01-01 03:56:12 - gpdsp1 PASS
67+
[INFO] 1970-01-01 03:56:12 - -------------------Completed gdsp_remoteproc Testcase----------------------------
68+
```
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/sh
2+
3+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
4+
# SPDX-License-Identifier: BSD-3-Clause-Clear
5+
6+
# Robustly find and source init_env
7+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8+
INIT_ENV=""
9+
SEARCH="$SCRIPT_DIR"
10+
while [ "$SEARCH" != "/" ]; do
11+
if [ -f "$SEARCH/init_env" ]; then
12+
INIT_ENV="$SEARCH/init_env"
13+
break
14+
fi
15+
SEARCH=$(dirname "$SEARCH")
16+
done
17+
18+
if [ -z "$INIT_ENV" ]; then
19+
echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2
20+
exit 1
21+
fi
22+
23+
if [ -z "$__INIT_ENV_LOADED" ]; then
24+
# shellcheck disable=SC1090
25+
. "$INIT_ENV"
26+
fi
27+
28+
# shellcheck disable=SC1090,SC1091
29+
. "$TOOLS/functestlib.sh"
30+
31+
TESTNAME="gdsp_remoteproc"
32+
test_path=$(find_test_case_by_name "$TESTNAME")
33+
cd "$test_path" || exit 1
34+
35+
res_file="./$TESTNAME.res"
36+
LOG_FILE="./$TESTNAME.log"
37+
38+
exec > >(tee -a "$LOG_FILE") 2>&1
39+
40+
log_info "-----------------------------------------------------------------------------------------"
41+
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
42+
log_info "=== Test Initialization ==="
43+
44+
for gdsp_firmware in gpdsp0 gpdsp1; do
45+
log_info "Processing $gdsp_firmware"
46+
47+
if validate_remoteproc_running "$gdsp_firmware" "$LOG_FILE"; then
48+
log_pass "$gdsp_firmware remoteproc validated as running"
49+
echo "$TESTNAME PASS" > "$res_file"
50+
else
51+
log_fail "$gdsp_firmware remoteproc failed validation"
52+
echo "$TESTNAME FAIL" > "$res_file"
53+
fi
54+
55+
# At this point we are sure: path exists and is in running state
56+
rproc_path=$(get_remoteproc_path_by_firmware "$gdsp_firmware")
57+
58+
if ! stop_remoteproc "$rproc_path"; then
59+
log_fail "$gdsp_firmware stop failed"
60+
echo "$TESTNAME FAIL" > "$res_file"
61+
exit 1
62+
else
63+
log_pass "$gdsp_firmware stop successful"
64+
fi
65+
66+
log_info "Restarting $gdsp_firmware"
67+
if ! start_remoteproc "$rproc_path"; then
68+
log_fail "$gdsp_firmware start failed"
69+
echo "$TESTNAME FAIL" > "$res_file"
70+
exit 1
71+
fi
72+
73+
log_pass "$gdsp_firmware PASS"
74+
done
75+
76+
echo "$TESTNAME PASS" > "$res_file"
77+
log_info "-------------------Completed $TESTNAME Testcase----------------------------"
78+
exit 0

0 commit comments

Comments
 (0)