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.
This commit is contained in:
Luxferre committed 2026-11-10 19:41:57 +02:00
1 parent d402a53221
commit 40a840b49b
12 files changed
+1085 -72

No files matched your search

@@ -3,7 +3,11 @@
# /home/user/.config/bananarchy/cover-display.conf and are applied by
# the xcover DWM plugin at session start.
# auto = /dev/fb1 (kernel spi-mux) -> /dev/spidev0.1 -> no hardware
# auto = /dev/fb1 (opt-in two-panel spi-mux DT) when present, otherwise the
# compiled /dev/spidev0.1 backend while the flip is closed. Both panels share
# QUP5 SPI through the gpio13 mux, so the userspace backend is NEVER used with
# the flip open: the main 240x320 panel keeps the bus then. fb = fbdev only,
# spidev = force spidev, none = keep the bus untouched (rollback).
backend = auto
fb_device = /dev/fb1
spidev_device = /dev/spidev0.1
@@ -23,6 +27,24 @@ reset_gpio = 23
# only when the spi-mux kernel modules own both panels instead.
dc_gpio = -1
# Closed-flip userspace GC9305 backend. gpio13 is held low by the boot chain
# while the main panel is active, so low = internal, high = cover. The 240x240
# panel has its own D/C (gpio21) and reset (gpio23) lines. All polarities are
# config knobs for the physical sign-off: change them here, restart the
# service, and use bananarchy-coverctl TEST bars with LID CLOSED.
spi_device = /dev/spidev0.1
spi_mux_gpio = 13
spi_dc_gpio = 21
spi_reset_gpio = 23
mux_open_level = 0
mux_closed_level = 1
dc_command_level = 0
dc_data_level = 1
reset_assert_level = 0
reset_idle_level = 1
# Keep the verified internal-panel clock on the shared bus.
spi_speed_hz = 25000000
# Privacy defaults: no caller name, no notification body, no text in logs.
enabled = 1
show_caller = 0
@@ -33,7 +55,6 @@ brightness = 160
# Follow Config -> Screen blank (~/.config/sxmo/idle_blank_timeout, default
# 300 s, 0 = never). A numeric value here overrides it for the cover panel.
blank_timeout = auto
# Optional sysfs node for the external panel backlight. Empty while the cover
# panel DT overlay is hardware-gated: the daemon still writes an all-black
# frame, which is the software-visible "fully off" state.
# Optional sysfs node for the external panel backlight. Empty: the daemon
# writes an all-black frame and sends GC9305 display-off (0x28) instead.
backlight_path =
@@ -5,8 +5,10 @@
description="Nokia 2720 Flip external cover display"
# The recovered native bananarchy-coverd busy-loops at 100% CPU on the
# spidev backend (gpio110/DC is owned by panel-mipi-dbi-spi) and paints
# nothing. Keep that binary installed for the future spi-mux work, but run
# the compiled idle IPC server in the default runlevel. No Python runs here.
# nothing. Keep that binary installed as a diagnostic, but run the compiled
# idle IPC server: it drives the external panel through /dev/spidev0.1 only
# while the flip is closed and hands the QUP5 bus back on open. No Python
# runs here.
command="/usr/bin/bananarchy-cover-idle"
command_args="--config /etc/bananarchy/cover-display.conf"
command_background="yes"
@@ -1,11 +1,14 @@
#!/bin/sh
# Report the live state of the 2720 Flip external panel (/dev/fb1).
# 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'
@@ -24,11 +27,22 @@ if [ -e "$FB" ]; then
fi
done
else
printf 'framebuffer : %s ABSENT (panel-mipi-dbi did not probe)\n' "$FB"
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; do
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
@@ -41,6 +55,14 @@ 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
@@ -49,4 +71,9 @@ 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
Binary file not shown.