diff --git a/AGENTS.md b/AGENTS.md index 900e14d..6599d61 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -79,6 +79,7 @@ Keep this file short. Full details live in `README.md`, `MANUAL.md`, `SDK.md`, ` - Keep the internal beatles panel at 25 MHz, `dc_gpio = -1` for the spidev fallback, external-panel firmware and initramfs module lists, the Xorg `card0` pin, `bananarchy-cover-diagnose.sh`, and the `scripts/test-cover-dt.py` / `scripts/test-cover-spidev.py` guards. +- The shipping cover backend is `backend = kernel`: the kernel `panel-mipi-dbi-spi` driver owns CS0 and the shared gpio110 D/C. Keep `bananarchy-cover-dpms.sh reinit`, the gpio13 mux claim, the 240x240 `/dev/fb0` damage rect, the main-backlight-off gate and `scripts/test-cover-kernel.py`. Keep `spidev`/`fb`/`none` and PROBE as rollback paths. - Keep the 2720 Flip lid handling event-driven and instant: sticky hall state, immediate hall re-read on `EV_SW` edges, 20 ms debounce, and synchronous lid-state/lock/backlight/DPMS writes in `bananarchy-lid.c`. Every main-panel wake path must call `bananarchy-lid-gate.sh`; a closed flip may only light the cover. `sxmo_state.sh set unlock` is diff --git a/CHANGELOG.md b/CHANGELOG.md index a63a97a..79adcb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,16 @@ Release versions follow the `
` format (where `2026` is `a`, Work since `a1108` has focused on reliable 2720 Flip hardware support and a reproducible boot/flash path. Earlier incremental and superseded diagnostic entries are consolidated here. +### Kernel-owned cover panel path (option b) + +- **Why**: after a clean reboot, the kernel's own SPI statistics showed all twelve userspace PROBE cases delivered complete, error-free transfers (230558 B per 9-bit frame, 115279 B per 8-bit frame, zero `errors`/`timedout` and zero dmesg failures) while the cover stayed dark. MISO reads return zeros (write-only panels), no TE toggles on any of 64 TLMM lines at kHz sampling, battery voltage is frozen, there is no current/ALS sensor and only one PWM backlight. The QUP5 pinctrl group has a single CS line and gpio110 (the kernel panel driver's D/C) is shared behind the gpio13 bus switch, so no userspace D/C framing can work. +- **Switch**: `backend = kernel` is now the default. While the flip is closed the compiled cover daemon claims only gpio13 (mux) and gpio23 (cover reset), switches the bus to the cover, and forces a DPMS off/on cycle through `bananarchy-cover-dpms.sh reinit`; `mipi_dbi_enable()` then replays the kernel's firmware init sequence onto the external panel with CS0 and gpio110 D/C. The cover UI is rendered as a 240x240 XR24 damage rect at the top of `/dev/fb0` (using the fbdev stride), which makes `mipi_dbi` set a 240x240 address window matching the cover's native geometry. `FBIOBLANK`/DPMS off blanks it again. The main backlight and keypad stay at 0, so only the outer panel can light. On open the mux returns to the internal panel and the lid daemon requests a `reinit` after an 80 ms settle so the kernel re-initialises the main panel. +- **Rollback**: `backend = spidev` (userspace GC9305), `backend = fb` (opt-in `/dev/fb1` DT) and `backend = none` remain; all polarity/word-width keys, PROBE and `bananarchy-cover-probe.sh` are kept for the legacy path. `SET backend ...` switches at runtime. +- **Guards**: `scripts/test-cover-kernel.py` runs the daemon in simulation against a fake fbdev/backlight/DPMS helper and verifies open-flip silence, mux claim/restore, reinit-on-BUTTON, frame rendering, blanking and the lit-main-backlight block. `scripts/check-rebuild.sh` guards the source, config, helper and lid-daemon reinit. +- **Limitation**: Xorg shares `/dev/fb0`, so its repaints can still overwrite part of the cover UI; a dedicated override-redirect cover compositor is the next step. Physical illumination remains unverified from the host. +- **Live verification**: with the flip closed, `backend=kernel-dark` blanked the cover; `BUTTON` switched to `backend=kernel`, `dpms=On`, gpio13 high (mux on cover), rendered 172800 non-zero bytes of cover UI into the top 240x240 of `/dev/fb0`, and made the **kernel** `spi0.0` push 460899 bytes while the userspace `spi0.1` pushed 0 — zero SPI errors. `BLANK` returned `kernel-dark`/DPMS off; `LID OPEN` released the mux (gpio13 low, `mux=free`). Main backlight and keypad stayed at 0 throughout. +- **Image persistence**: rebuilt `images/bananarchy-nokia-beatles.img` at `a1108` / `dejavu`; verified raw hash `ce0542321990a8cff8ab122c0a47c0684fcc7e3d5f6fc97e74b3b0ea4c4826b5`, pinned by `scripts/check-rebuild.sh`. `e2fsck -fn` passed on both partitions, `debugfs` confirms the rebuilt daemons, helper and config byte-for-byte, and the bootfs sync, boot image check, artifact sync, host tests and rebuild preflight pass. The standalone boot image hash is unchanged. + ### Cover panel hardware sign-off path after the button regression - **Live diagnosis**: with the flip physically closed, `bananarchy-coverctl BUTTON`, `WAKE`, `bananarchy-lid-gate.sh wake` and `sxmo_state.sh set unlock` all reached `backend=spidev visible=1 mux=closed`, and the daemon held `/dev/spidev0.1`, the gpiochip and two line handles. So the wake chain is intact; the outer panel itself never reacts to the frames. Register-ID reads over SPI return zeros for both chip selects (the panels are write-only), and gpio21 stays static, so readback/TE cannot be used to confirm wiring. A reversible `panel-mipi-dbi-spi`/`spidev` rebind on `spi0.0` proved CS0 + the kernel-owned gpio110 D/C path is also unreadable; the phone was fully restored (`/dev/dri/card0`, `/dev/fb0`, Xorg and dwm back). diff --git a/README.md b/README.md index 358c453..b2bb39e 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs - **Webarchy Web browser (`webarchy` / `xwebarchy` / `webarchy.so`)**: full-featured HTML5/CSS3/JS web browser built on WPE / WebKit (`webkit2gtk-4.1` + `libwpe-1.0`) with Adreno 304 hardware acceleration (`WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS`, WebGL, accelerated 2D canvas, and 512 MB RAM pressure tuning), default KaiOS 4.0 User-Agent (`Mozilla/5.0 (Mobile; rv:123.0) Gecko/123.0 Firefox/123.0 KAIOS/4.0`) with preset and custom User-Agent override (`~/.config/sxmo/webarchy_ua.txt`), `UTF-8` default encoding fallback, `Noto Sans` / `Noto Serif` (`font-noto` + `font-noto-emoji`) as the default non-monospace browser fonts and `Fira Code` with OpenType ligatures as the monospace font, full GStreamer multimedia (`MediaSource` / MSE, WebAudio, inline HTML5 `