Skip to content

Commit abcbb9c

Browse files
committed
imx95-pqc-demo: give the renderer the DisplayPort on autostart
1 parent d070575 commit abcbb9c

5 files changed

Lines changed: 49 additions & 8 deletions

File tree

‎imx95-pqc-demo/demo/demo-run.sh‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env bash
22
# Two-pane i.MX95 demo. Runs ON THE BOARD as root.
33
#
4-
# left - wolfCrypt PQC benchmarks in a container on the Cortex-A55 cluster
4+
# left - wolfBoot's own ML-DSA-87 verified boot of Linux, replaced by the
5+
# wolfCrypt PQC benchmarks once the container has results
56
# right - wolfBoot ML-DSA-87 verified boot of the Cortex-M7
67
#
78
# Everything is local to the board, so once this is running nothing depends on
89
# a host being connected.
910
#
1011
# sudo bash demo-run.sh # render on this terminal
11-
# sudo bash demo-run.sh /dev/tty1 # render on the HDMI console
12+
# sudo bash demo-run.sh /dev/tty1 # render on the DisplayPort panel
1213
#
1314
# The M7 can only be started ONCE per Linux boot, so re-running the demo needs a
1415
# full board power cycle. That is the "reboot beat" - and it has to come from
@@ -31,9 +32,23 @@ bash "$DEMO/m7-start.sh" || echo " (M7 already running - power cycle to replay
3132

3233
echo "== rendering =="
3334
if [ -n "$TARGET" ]; then
34-
# A getty owns tty1; stop it first or the two fight over the console.
35+
# Torizon's kernel has no fbdev emulation, so text written to a VT reaches
36+
# no display: the renderer has to own the DisplayPort through KMS. Take the
37+
# screen away from everything else that wants it first - the getty on the
38+
# console, the framebuffer console redrawing over the KMS output, and
39+
# Torizon's pairing overlay - then render as the sole DRM master.
3540
systemctl stop getty@"$(basename "$TARGET")" 2>/dev/null || true
36-
exec python3 "$DEMO/twopane.py" > "$TARGET" 2>/dev/null
41+
for v in /sys/class/vtconsole/vtcon*; do
42+
if grep -qi 'frame buffer' "$v/name" 2>/dev/null; then
43+
echo 0 > "$v/bind" 2>/dev/null || true
44+
fi
45+
done
46+
docker stop torizon-easy-pairing-bash-1 >/dev/null 2>&1 || true
47+
# stderr is left alone on purpose: the DRM path is the most failure-prone
48+
# part of the demo (hotplug, EDID, DRM-master contention), and discarding
49+
# it turns a black screen into a silent restart loop with nothing in the
50+
# journal to explain it.
51+
exec env RENDER=drm python3 "$DEMO/twopane.py"
3752
else
3853
exec python3 "$DEMO/twopane.py"
3954
fi

‎imx95-pqc-demo/demo/install-autostart.sh‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@
55
# sudo bash install-autostart.sh --off # disable, restore the getty
66
set -euo pipefail
77
UNIT=/etc/systemd/system/wolfssl-demo.service
8+
M7_UNIT=/etc/systemd/system/wolfssl-m7.service
89
HERE="$(cd "$(dirname "$0")" && pwd)"
910

1011
if [ "${1:-}" = "--off" ]; then
1112
systemctl disable --now wolfssl-demo.service 2>/dev/null || true
13+
systemctl disable --now wolfssl-m7.service 2>/dev/null || true
1214
systemctl start getty@tty1.service 2>/dev/null || true
1315
sync
1416
echo "demo autostart disabled, getty on tty1 restored"
1517
exit 0
1618
fi
1719

1820
install -m 0644 "$HERE/wolfssl-demo.service" "$UNIT"
21+
install -m 0644 "$HERE/wolfssl-m7.service" "$M7_UNIT"
1922
systemctl daemon-reload
20-
systemctl enable wolfssl-demo.service
23+
systemctl enable wolfssl-demo.service wolfssl-m7.service
2124
# The demo's replay beat is a hard power cut, so nothing may sit in the page
2225
# cache: an unsynced unit file is simply gone after the next cycle.
2326
sync
24-
echo "installed and enabled: $UNIT"
27+
echo "installed and enabled: $UNIT and $M7_UNIT"
2528
echo "the demo now starts on boot; power cycle is the whole replay"
2629
echo "disable with: sudo bash $HERE/install-autostart.sh --off"

‎imx95-pqc-demo/demo/stage.sh‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ PAYLOAD="${PAYLOAD:-$DEMO/m7/build/zephyr/payload_v1_signed.bin}"
1515

1616
ssh "$BOARD" 'mkdir -p ~/demo/fw ~/demo/results ~/bin'
1717

18-
scp -q "$DEMO/demo/twopane.py" "$DEMO/demo/demo-run.sh" \
18+
scp -q "$DEMO/demo/twopane.py" "$DEMO/demo/drmfb.py" "$DEMO/demo/font8x8.py" \
19+
"$DEMO/demo/demo-run.sh" \
1920
"$DEMO/demo/m7-start.sh" "$DEMO/demo/m7-console-tail.sh" \
2021
"$DEMO/demo/m7-rpmsg-log.sh" "$DEMO/demo/install-autostart.sh" \
21-
"$DEMO/demo/wolfssl-demo.service" "$BOARD:~/demo/"
22+
"$DEMO/demo/wolfssl-demo.service" "$DEMO/demo/wolfssl-m7.service" \
23+
"$BOARD:~/demo/"
2224
scp -q "$DEMO/container/docker-compose.yml" "$BOARD:~/demo/"
2325
scp -q "$WOLFBOOT/wolfboot.elf" "$BOARD:~/demo/fw/rproc-imx-rproc-fw"
2426
scp -q "$PAYLOAD" "$BOARD:~/demo/fw/payload.bin"

‎imx95-pqc-demo/demo/wolfssl-demo.service‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Conflicts=getty@tty1.service
1616
[Service]
1717
Type=simple
1818
ExecStart=/bin/bash /home/torizon/demo/demo-run.sh /dev/tty1
19+
# The renderer owns the DisplayPort through KMS (see demo-run.sh); Torizon has
20+
# no fbdev emulation, so there is no console path to the screen.
21+
Environment=RENDER=drm
1922
# A dead screen is worse than a retry on a show floor. Re-running is safe: the
2023
# M7 start is skipped when the core is already running, and the compose project
2124
# is torn down and brought back up on each pass.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Unit]
2+
# Release the Cortex-M7 once Linux is up. Separate from the renderer unit so
3+
# the core still boots (and its log still lands in the shared ring) when the
4+
# display is absent or the renderer is being restarted.
5+
Description=wolfSSL i.MX95 demo - start the Cortex-M7 (wolfBoot -> Zephyr)
6+
Documentation=https://github.com/wolfSSL/wolfBoot-examples/pull/13
7+
After=multi-user.target
8+
9+
[Service]
10+
# One shot per Linux boot, because that is the hardware's limit: "echo stop"
11+
# fails on this BSP and the core stays running, so replaying the M7 boot is a
12+
# board power cycle. RemainAfterExit keeps the unit from being re-run.
13+
Type=oneshot
14+
RemainAfterExit=yes
15+
ExecStart=/home/torizon/demo/m7-start.sh
16+
17+
[Install]
18+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)