mirror of
https://github.com/Creased/RCM-Emulator.git
synced 2026-12-06 02:48:11 +01:00
- tests/ccplex: a self-contained BPMP payload (ARM, arm-none-eabi-gcc; the AArch64 side is pre-assembled words) that drives CPU0 through bdk's ccplex_boot_cpu0() register sequence. It checks that an unpowered release is refused with its reason, that a powered one runs at EL3 from the SB vector and writes the mailbox, that CPU0 sees TIMERUS move, that WFE parks the core, and that RST_CPUG_CMPLX_SET stops it. `make test`. - tests/hwtest: build hwtest-rcm from a pinned commit with distro toolchains (an empty base_rules stands in for devkitARM, the CPU0 stub builds with gcc-aarch64-linux-gnu) and run its whole sweep headless, checking the CPU0-driven Wi-Fi probe enumerates the CYW4356. - CI runs both in the Linux job and keeps their logs on failure. - Makefile: `test` target; the clean rule's line continuation was a literal "\n" that only worked by accident. - README/DESIGN: CCPLEX CPU0, the uc_mmio_map bus, the block-level clock and TIMERUS poll pacing, the new bug-history entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YYewwDPujjo5B2xRyC5Grb
50 lines
1.9 KiB
Bash
Executable File
50 lines
1.9 KiB
Bash
Executable File
#!/bin/sh
|
|
# End-to-end: run hwtest's whole hardware sweep in the emulator, headless,
|
|
# and check the CPU0-driven PCIe probe enumerated the Wi-Fi endpoint.
|
|
# Usage: tests/hwtest/run.sh <rcm_emu> <hwtest.bin> [extra emulator args...]
|
|
#
|
|
# hwtest sits in its pager once the sweep is dumped, so the run is ended as
|
|
# soon as the dump's last line appears (with a hard timeout behind it).
|
|
EMU=${1:-./rcm_emu}
|
|
BIN=${2:-build-hwtest/hwtest-rcm/build/hwtest.bin}
|
|
shift 2 2>/dev/null
|
|
LOG=${LOG:-tests/hwtest/out.log}
|
|
LIMIT=${LIMIT:-300}
|
|
|
|
# POWER at 3 s picks "Hardware test" on hwtest's launcher.
|
|
SDL_VIDEODRIVER=dummy RCM_EMU_NO_AUDIO=1 "$EMU" "$BIN" --input-script "3000 P" "$@" \
|
|
> "$LOG" 2>&1 &
|
|
pid=$!
|
|
t=0
|
|
until grep -q 'end of dump' "$LOG" 2>/dev/null || ! kill -0 $pid 2>/dev/null; do
|
|
sleep 1
|
|
t=$((t + 1))
|
|
if [ $t -ge "$LIMIT" ]; then
|
|
echo "hwtest: no end of dump after ${LIMIT}s"
|
|
break
|
|
fi
|
|
done
|
|
kill $pid 2>/dev/null
|
|
wait $pid 2>/dev/null
|
|
echo "hwtest: sweep took ~${t}s of wall time"
|
|
|
|
fail=0
|
|
expect() {
|
|
if grep -q -- "$1" "$LOG"; then
|
|
echo " ok $2"
|
|
else
|
|
echo " FAIL $2 (missing: $1)"
|
|
fail=1
|
|
fi
|
|
}
|
|
expect 'end of dump' 'the whole sweep ran to its end'
|
|
expect '\[ccplex\] CPU0 released: AArch64 EL3' 'hwtest booted CPU0'
|
|
expect 'CPU0 : ran to completion' 'the CPU0 stub ran to completion'
|
|
expect 'AFI (CPU) : cfg=00103025 witness=A5A50000 -> APERTURE LIVE' 'the PCIe aperture decodes for CPU0'
|
|
expect 'RP1 link : UP, DL active (LNKSTA=3011' 'root port 1 trained'
|
|
expect 'EP config : 14E4:43EC' 'the CYW4356 endpoint enumerated'
|
|
expect 'CPU0 : powergated' 'the cluster was powergated again'
|
|
expect 'Wireless : pass' 'the Wireless verdict passed'
|
|
|
|
[ $fail -eq 0 ] && echo "hwtest: PASS" || { echo "hwtest: FAIL - see $LOG"; exit 1; }
|