Fix 2720 Flip cover init, shared backlight and flip lock
This commit is contained in:
1 parent
c939687138
commit
b389120328
24 files changed
+494
-217
No files matched your search
+9
-1
@@ -13,6 +13,14 @@ 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.
|
||||
|
||||
### Vendor-init kernel cover path and persistent flip lock
|
||||
|
||||
- **Root cause of the dark cover**: the KaiOS 3.10 downstream DTS (`0004-dts-adaptations.patch`) shows that both GC9305s share CS0, gpio110 D/C and one PMIC MPP2 PWM backlight; gpio13 selects the panel, gpio23 is the external reset and gpio21 is TE. The previous kernel backend left that shared backlight at zero, never pulsed gpio23, and replayed the internal 240x320 init instead of the stock 240x240 stream. A DPMS off/on cycle alone cannot initialise the external panel. The earlier open transition also removed the lock flag and returned straight to the unlocked desktop.
|
||||
- **Switch**: `nokia,beatles-gc9305-ext-panel.bin` now contains the exact vendor `fe ef 3a 05 ... 2a/2b 0..239, 11, 29` stream. While closed, `bananarchy-cover-idle` claims gpio13/gpio23, pulses reset, sends that stream through the kernel driver's `/sys/kernel/debug/dri/0/command` hook, publishes `/run/bananarchy/cover-backlight` before enabling the shared backlight, and renders a 240x240 `/dev/fb0` damage rect once per second so Xorg repaints cannot erase it. `bananarchy-display-power-sync` skips the closed-lid hard-off gate only while that marker and `lid-state=closed` are both present. `bananarchy-lid` now keeps `/tmp/bananarchy_screen_locked`, writes `sxmo.state=lock`, sends `LOCK` to `locker.so` and runs `sxmo_state.sh set lock` on open instead of auto-unlocking.
|
||||
- **Guards**: `scripts/test-cover-kernel.py`, `scripts/test-lid-gate.py`, `scripts/check-rebuild.sh`, `bananarchy-cover-diagnose.sh`, README, MANUAL and `AGENTS.md` now guard the vendor firmware, debugfs command hook, shared-backlight marker, 1 s repaint, DPMS-off initial gate, lock-on-open and both mux-polarity runtime knobs. The legacy `spidev`/`fb`/`none`, 8/9-bit and PROBE rollback paths remain.
|
||||
- **Live verification**: with the flip state injected closed and DPMS off, `BUTTON` produced `backend=kernel`, marker present, brightness 14, `bl_power=0`, DPMS On, 172800 non-zero bytes in the top 240x240 of `/dev/fb0`, 460919 extra kernel `spi0.0` bytes and zero SPI errors/timeouts. A gpiochip TE scan proved the bus routing objectively: blank had `ext(gpio21)=0 int(gpio24)=0` transitions, `mux_closed_level=0` had `ext=0 int=78`, and `mux_closed_level=1` had `ext=52 int=0`; high is the cover and low is the internal panel. A controlled close→open transition left `state=lock`, the lock flag present, the cover marker absent, `mux=free`, brightness 14, keypad 1 and DPMS On; it stayed locked after 1 s. The phone was restored to open/unlocked with all services started and zero `SPI transfer failed` messages. Eyes-on illumination still needs a human look, but the external panel's TE, shared backlight and kernel SPI traffic are now confirmed.
|
||||
- **Image persistence**: rebuilt `images/bananarchy-nokia-beatles.img` at `a1108` / `dejavu`; verified raw hash `e2ec6a35d1e7db698f929fa0ebdbed94ffd941a55fc50ceff7a223e82896e985`, pinned by `scripts/check-rebuild.sh`. `e2fsck -fn` passed on both partitions, `debugfs` confirms the rebuilt daemons, firmware, config, helper and scripts 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.
|
||||
|
||||
### 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.
|
||||
@@ -21,7 +29,7 @@ Work since `a1108` has focused on reliable 2720 Flip hardware support and a repr
|
||||
- **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.
|
||||
- **Image persistence**: rebuilt `images/bananarchy-nokia-beatles.img` at `a1108` / `dejavu`; verified raw hash `ce0542321990a8cff8ab122c0a47c0684fcc7e3d5f6fc97e74b3b0ea4c4826b5`, pinned by `scripts/check-rebuild.sh` at that point. `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. Superseded by the vendor-init rebuild below.
|
||||
|
||||
### Cover panel hardware sign-off path after the button regression
|
||||
|
||||
|
||||
Reference in new issue
Block a user