mirror of
https://github.com/Creased/RCM-Emulator.git
synced 2026-12-06 02:48:11 +01:00
Test the CCPLEX model and the hwtest sweep in CI, and document both
- 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
This commit is contained in:
10 files changed
+566
-26
No files matched your search
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
# Build hwtest-rcm (https://github.com/Creased/hwtest-rcm) with distro
|
||||
# toolchains, CPU0 stub included. Usage: tests/hwtest/build.sh <workdir>
|
||||
# Produces <workdir>/hwtest-rcm/build/hwtest.bin.
|
||||
#
|
||||
# hwtest's Makefile only needs $(DEVKITARM)/base_rules to exist - it names
|
||||
# arm-none-eabi-gcc itself - so an empty file stands in for devkitARM, and
|
||||
# Debian/Ubuntu's gcc-aarch64-linux-gnu builds the AArch64 stub, which is
|
||||
# what hwtest's own CI does too.
|
||||
#
|
||||
# Pinned so a change on the hwtest side cannot turn this emulator's CI red
|
||||
# without a commit here; bump HWTEST_REF deliberately.
|
||||
set -e
|
||||
WORK=${1:-build-hwtest}
|
||||
HWTEST_REF=${HWTEST_REF:-3738e9a47e1833605fc5a30eeca0ea95caa3b936}
|
||||
|
||||
mkdir -p "$WORK"
|
||||
cd "$WORK"
|
||||
if [ ! -d hwtest-rcm/.git ]; then
|
||||
git init -q hwtest-rcm
|
||||
git -C hwtest-rcm remote add origin https://github.com/Creased/hwtest-rcm.git
|
||||
fi
|
||||
git -C hwtest-rcm fetch -q --depth 1 origin "$HWTEST_REF"
|
||||
git -C hwtest-rcm checkout -q FETCH_HEAD
|
||||
git -C hwtest-rcm submodule update -q --init --depth 1 third_party/hekate
|
||||
|
||||
mkdir -p devkitARM
|
||||
: > devkitARM/base_rules
|
||||
make -C hwtest-rcm -j"$(nproc)" DEVKITARM="$PWD/devkitARM" \
|
||||
A64_CC=aarch64-linux-gnu-gcc A64_OC=aarch64-linux-gnu-objcopy REQUIRE_A64=1
|
||||
ls -l hwtest-rcm/build/hwtest.bin
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/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; }
|
||||
Reference in new issue
Block a user