Drive the 2720 Flip cover panel through the kernel panel driver
Autonomous testing (clean reboot, kernel SPI statistics, kHz GPIO sweeps, CS0/CS1 register reads, battery/ALS/hwmon checks, host webcam differential imaging) showed all twelve userspace PROBE cases delivered complete, error-free SPI traffic while the cover stayed dark. The QUP5 pinctrl group has one CS line and gpio110 (the kernel panel-mipi-dbi-spi driver's D/C) is shared behind the gpio13 bus switch, so no userspace D/C framing can work. 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. 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. Live verification: closed -> backend=kernel-dark (DPMS off); BUTTON -> backend=kernel, dpms=On, gpio13 high, 172800 non-zero bytes of cover UI in /dev/fb0, kernel spi0.0 +460899 bytes and userspace spi0.1 +0, zero SPI errors; BLANK -> kernel-dark/DPMS off; LID OPEN -> mux=free, gpio13 low. Main backlight and keypad stayed at 0 throughout. All spidev/8-bit/9-bit paths, PROBE, bananarchy-cover-probe.sh and backend = fb|spidev|none remain as runtime rollback paths. New host test scripts/test-cover-kernel.py plus check-rebuild.sh guards. Rebuilt the a1108/dejavu nokia-beatles image and pinned the verified hash ce0542321990a8cff8ab122c0a47c0684fcc7e3d5f6fc97e74b3b0ea4c4826b5 in 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 all pass. Limitation: Xorg shares /dev/fb0, so its repaints can still overwrite part of the cover UI; a dedicated override-redirect cover compositor is next. Physical illumination is still unverified from the host.
This commit is contained in:
1 parent
5f8b7c88ac
commit
c939687138
15 files changed
+468
-21
No files matched your search
@@ -13,6 +13,16 @@ Release versions follow the `<year-letter><MM><DD>` 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).
|
||||
|
||||
Reference in new issue
Block a user