Files
bananarchy/overlay/rootfs/usr/bin/bananarchy-cover-diagnose.sh
T
Luxferre 40a840b49b Drive the 2720 Flip cover panel from userspace while closed
The shipping single-panel DTB left the external GC9305 unused because
bananarchy-cover-idle only knew /dev/fb1. The compiled daemon now owns the
shared QUP5 bus while the flip is closed: it claims gpio13/21/23 through
the gpiochip ABI, replays the external firmware over /dev/spidev0.1 at the
verified 25 MHz and pushes 240x240 RGB565 frames. LID OPEN restores the mux
and releases the panel lines; activation also requires the main panel to be
DPMS-off. Polarities are config keys and live SET knobs, with
SET backend none as a rollback. /dev/fb1 keeps precedence and the two-panel
spi-mux DT stays opt-in.

Rebuilt the a1108/dejavu nokia-beatles image and pinned the verified hash
ccc8c44517a6a3b78e16e45e9dddbf89f6f04a35ee4c52246d38d89970bd13ac in
check-rebuild.sh. e2fsck -fn passes on both partitions, debugfs confirms
the four updated rootfs files byte-for-byte, and the bootfs sync, boot image
check, artifact sync, host tests and rebuild preflight all pass.

This is an intermediate checkpoint: eyes-on confirmation that the cover
lights up and several more polarity/CS fixes are still required.
2026-11-10 19:41:57 +02:00

80 lines
3.2 KiB
Bash
Executable File

#!/bin/sh
# Report the live state of the 2720 Flip external panel (closed-flip backend).
# Intended for the physical gpio13/reset/DC sign-off: it never changes state.
set -u
FB=/dev/fb1
SYSFS=/sys/class/graphics/fb1
SPI=/dev/spidev0.1
GPIOCHIP=/dev/gpiochip0
FW=/lib/firmware/nokia,beatles-gc9305-ext-panel.bin
CONF=/etc/bananarchy/cover-display.conf
COVERCTL=/usr/bin/bananarchy-coverctl
printf '=== Bananarchy cover display diagnostics ===\n'
if [ -r /usr/share/bananarchy/lid-profile ]; then
printf 'lid-profile : %s\n' "$(cat /usr/share/bananarchy/lid-profile)"
else
printf 'lid-profile : missing (not a flip build?)\n'
fi
if [ -e "$FB" ]; then
printf 'framebuffer : %s present\n' "$FB"
for attr in virtual_size bits_per_pixel stride; do
if [ -r "$SYSFS/$attr" ]; then
printf ' %-20s: %s\n' "$attr" "$(cat "$SYSFS/$attr")"
else
printf ' %-20s: missing\n' "$attr"
fi
done
else
printf 'framebuffer : %s absent (single-panel shipping DTB)\n' "$FB"
fi
if [ -e "$SPI" ]; then
printf 'spidev : %s present\n' "$SPI"
else
printf 'spidev : %s MISSING\n' "$SPI"
fi
if [ -e "$GPIOCHIP" ]; then
printf 'gpiochip : %s present\n' "$GPIOCHIP"
else
printf 'gpiochip : %s MISSING\n' "$GPIOCHIP"
fi
printf 'DRM cards : %s\n' "$(ls /dev/dri/card* 2>/dev/null | tr '\n' ' ')"
printf 'main panel dpms : %s\n' "$(cat /sys/class/drm/card0-SPI-1/dpms 2>/dev/null || printf 'unknown')"
printf 'fbdev nodes : %s\n' "$(ls /dev/fb* 2>/dev/null | tr '\n' ' ')"
for mod in mux_core mux_gpio spi_mux panel_mipi_dbi spidev; do
if grep -q "^$mod " /proc/modules 2>/dev/null; then
printf 'module %-20s: loaded\n' "$mod"
else
printf 'module %-20s: not loaded\n' "$mod"
fi
done
if [ -r "$FW" ]; then
printf 'panel firmware : %s (%s bytes)\n' "$FW" "$(wc -c < "$FW")"
else
printf 'panel firmware : %s MISSING\n' "$FW"
fi
printf 'mux select (lid-state): %s\n' "$(cat /run/bananarchy/lid-state 2>/dev/null || printf 'unknown')"
if [ -r /sys/kernel/debug/gpio ]; then
printf 'TLMM lines :\n'
grep -E '^ gpio(13|21|23|25|110) ' /sys/kernel/debug/gpio | sed 's/^/ /'
fi
if [ -r "$CONF" ]; then
printf 'backend config :\n'
grep -E '^(backend|spi_device|spi_mux_gpio|spi_dc_gpio|spi_reset_gpio|mux_open_level|mux_closed_level|dc_command_level|dc_data_level|reset_assert_level|reset_idle_level|spi_speed_hz) ' "$CONF" | sed 's/^/ /'
fi
if [ -x "$COVERCTL" ]; then
printf 'daemon : %s\n' "$("$COVERCTL" STATUS 2>/dev/null || printf 'not answering')"
else
printf 'daemon : %s missing\n' "$COVERCTL"
fi
if command -v rc-service >/dev/null 2>&1; then
rc-service bananarchy-cover-display status 2>&1 | sed 's/^/service : /'
fi
printf 'sign-off : LID CLOSED; TEST bars, then LID OPEN\n'
printf ' bananarchy-coverctl SET mux_closed_level 0|1\n'
printf ' bananarchy-coverctl SET reset_assert_level 0|1\n'
printf ' bananarchy-coverctl SET dc_command_level 0|1\n'
printf ' rollback: bananarchy-coverctl SET backend none\n'
exit 0