Bring up nokia-sparkler SMP/cpufreq/lk2nd/cam/haptics, fix timer and EDL USB timeout

- Add 0013 early-SCM 4-core SMP + cpufreq kernel patch and clock-frequency DT nodes
- Complete nokia-sparkler lk2nd port, boot/X11 session startup, 180-deg cached camera, and 157 Hz haptic audio
- Replace root-only timer backend with permissionless sxmo_timer.sh and keypad/hook cancellation
- Fix EDL Firehose rawmode ACK, USB active-config preservation, *+# hint, and 30 s default USB timeout
- Sync a1120 (cocojamboo) prebuilts, docs, tests, and verified checksums in check-rebuild.sh
This commit is contained in:
Luxferre committed 2026-11-16 11:45:38 +02:00
1 parent ab53423e33
commit d7992904bf
56 files changed
+31850 -28281

No files matched your search

+175 -15
View File
@@ -179,12 +179,22 @@ for module in usb gpt sahara firehose utils; do
fail "missing vendor/edl/Library/$module.py"
fi
done
if [ ! -f "$BASE_DIR/vendor/edl/LICENSE" ]; then
fail "missing vendor/edl/LICENSE"
for f in vendor/edl/LICENSE scripts/test-edl-firehose-read.py; do
if [ ! -f "$BASE_DIR/$f" ]; then
fail "missing $f"
fi
done
if ! python3 "$BASE_DIR/scripts/test-edl-firehose-read.py" >/dev/null 2>&1; then
fail "Firehose rawmode read regression tests failed"
fi
if ! grep -q '^from Library\.sahara import qualcomm_sahara$' "$BASE_DIR/flash-edl.py"; then
fail "flash-edl.py is missing the Sahara client import"
fi
if ! grep -qF 'DEFAULT_USB_TIMEOUT_MS = 30000' "$BASE_DIR/vendor/edl/Library/usb.py" || \
! grep -qF 'DEFAULT_USB_IO_TIMEOUT_SEC = 30' "$BASE_DIR/flash-edl.py" || \
! grep -qF '"--usb-timeout"' "$BASE_DIR/flash-edl.py"; then
fail "EDL flasher USB transfer timeout defaults (30s) regressed"
fi
echo "[check] Device-specific EDL Firehose loaders..."
if ! grep -q '^DEVICE_LOADERS = {' "$BASE_DIR/flash-edl.py"; then
@@ -286,6 +296,7 @@ if ! grep -qF 'target_names = ("boot", "recovery", "lk2nd")' \
fi
for f in bootloader/lk2nd/nokia-beatles.patch \
bootloader/lk2nd/nokia-coconut.patch \
bootloader/lk2nd/nokia-sparkler.patch \
bootloader/lk2nd/README.md \
bootloader/lk2nd/spi-panel-init.h \
bootloader/lk2nd/Dockerfile \
@@ -294,6 +305,10 @@ for f in bootloader/lk2nd/nokia-beatles.patch \
scripts/build-lk2nd-coconut.sh \
scripts/check-lk2nd-coconut.py \
scripts/test-lk2nd-coconut-port.py \
scripts/build-lk2nd-sparkler.sh \
scripts/check-lk2nd-sparkler.py \
scripts/test-lk2nd-sparkler-port.py \
scripts/test-sparkler-port.py \
scripts/inspect-stock-msm8905-dump.py; do
if [ ! -f "$BASE_DIR/$f" ]; then
fail "missing lk2nd port / inspection file: $f"
@@ -303,6 +318,10 @@ if ! grep -qF 'COCONUT_LK2ND_IMAGE = "images/boot-lk2nd-nokia-coconut-display.im
"$BASE_DIR/flash-edl.py"; then
fail "flash-edl.py no longer references the display-enabled coconut lk2nd image"
fi
if ! grep -qF 'SPARKLER_LK2ND_IMAGE = "images/boot-lk2nd-nokia-sparkler-display.img"' \
"$BASE_DIR/flash-edl.py"; then
fail "flash-edl.py no longer references the display-enabled sparkler lk2nd image"
fi
for variant in normal diagnostic display; do
case "$variant" in
normal)
@@ -331,6 +350,34 @@ for variant in normal diagnostic display; do
fail "$label validation failed"
fi
done
for variant in normal diagnostic display; do
case "$variant" in
normal)
image="$BASE_DIR/images/boot-lk2nd-nokia-sparkler.img"
opts="--expect-fastboot 0"
label="source-built nokia-sparkler lk2nd"
;;
diagnostic)
image="$BASE_DIR/images/boot-lk2nd-nokia-sparkler-diagnostic.img"
opts="--expect-fastboot 1"
label="nokia-sparkler forced-fastboot diagnostic image"
;;
display)
image="$BASE_DIR/images/boot-lk2nd-nokia-sparkler-display.img"
opts="--expect-fastboot 0 --expect-display 1"
label="nokia-sparkler display lk2nd image with Fastboot reboot cookie"
;;
esac
if [ ! -f "$image" ]; then
echo "[skip] local build output ${image#"$BASE_DIR/"} is absent; prepare-release.sh will rebuild it"
continue
fi
# shellcheck disable=SC2086
if ! python3 "$BASE_DIR/scripts/check-lk2nd-sparkler.py" \
--image "$image" $opts; then
fail "$label validation failed"
fi
done
if [ -f "$BASE_DIR/scripts/make-beatles-lk2nd-bootimg.py" ]; then
fail "obsolete binary-patch lk2nd script is still present"
fi
@@ -434,13 +481,16 @@ fi
echo "[check] Known-good flashable image set..."
for pair in \
"8444544b0395c5bdef2f76b87721a99c326a868465d8236e85ff5572e7634cc0 images/bananarchy-nokia-argon.img" \
"7749caec22f5803112d21d24f032c09162bc7e6a239beabddb903272ebbd79c8 images/bananarchy-nokia-beatles.img" \
"cc58d92e6a54eab77f355a148cbc0b424d2da64e65353e3163a9cfc1eba37235 images/boot-bananarchy-nokia-beatles.img" \
"82f617e425fa9d33b1395c4e35639a6207e3c9d0aa376c7cedf35fddaccb5cc2 images/bananarchy-nokia-argon.img" \
"cc40c682fcdacb6415c112494344826362de2f965e6238685462859de66d660e images/bananarchy-nokia-beatles.img" \
"786e9a1f4e4ae92efc948393a1d8f04a9405840a214b6ef37914cf5821d7ed82 images/boot-bananarchy-nokia-beatles.img" \
"b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d images/boot-lk2nd-nokia-beatles-display.img" \
"19d17f31b970099dc6c212da58efdf8a99249aaa43e65ebeb6e2b904d0c5809d images/bananarchy-nokia-coconut.img" \
"2ff959ec89916adc02296adb948788bf8180009cd26454643e9f59334f09ad08 images/boot-bananarchy-nokia-coconut.img" \
"e876424b38b0782f589756b4107337b24f27f7c37d624cc7d3907a5331df050a images/boot-lk2nd-nokia-coconut-display.img"; do
"e82d64bd9f14b1fcca2c078e9fd43a4c4268b29ff688f268b32a939213be0545 images/bananarchy-nokia-coconut.img" \
"55299e15abe5923fc525b4e54e81aa4791f0e61f8a070e84fe7497f75c62d7d7 images/boot-bananarchy-nokia-coconut.img" \
"e876424b38b0782f589756b4107337b24f27f7c37d624cc7d3907a5331df050a images/boot-lk2nd-nokia-coconut-display.img" \
"5dc17319742e4af95facc42681f0fe6fb2e80ddf30f421f3c54b9dbe04fefd3f images/bananarchy-nokia-sparkler.img" \
"8205e2cb486d8ecc1e261a5c0b6f9ee7f70fd4eed2534d5bafc28ebc62d953d8 images/boot-bananarchy-nokia-sparkler.img" \
"bc41c2ddd1079246a7e91a40222fcafb82b0b52965c8ee8081872767d006748f images/boot-lk2nd-nokia-sparkler-display.img"; do
set -- $pair
want=$1
path="$BASE_DIR/$2"
@@ -558,11 +608,13 @@ if ! grep -q 'msm8905-cam' "$BASE_DIR/overlay/rootfs/etc/local.d/10-bananarchy-h
fail "the local.d hardware fallback no longer loads the camera driver"
fi
CAM_DRIVER="$BASE_DIR/src/msm8905-cam/msm8905-cam.c"
if ! grep -qF 'cam->rotate_180 = of_machine_is_compatible("nokia,beatles");' \
"$CAM_DRIVER" || \
if ! grep -qF 'of_machine_is_compatible("nokia,beatles")' "$CAM_DRIVER" || \
! grep -qF 'of_machine_is_compatible("nokia,sparkler")' "$CAM_DRIVER" || \
! grep -qF 'of_machine_is_compatible("nokia,leo")' "$CAM_DRIVER" || \
! grep -qF 'row_buf' "$CAM_DRIVER" || \
! grep -qF 'msm8905_cam_demosaic(cam->raw_dma_buf, dst_rgb, cam->rotate_180);' \
"$CAM_DRIVER"; then
fail "the beatles-only 180-degree camera orientation correction is missing"
fail "msm8905-cam orientation (beatles/sparkler/leo) or cached-row demosaic check failed"
fi
if [ ! -f "$BASE_DIR/scripts/busybox-sbin-applets.txt" ] || \
! grep -qxF 'reboot' "$BASE_DIR/scripts/busybox-sbin-applets.txt"; then
@@ -809,6 +861,40 @@ else
echo "[skip] local build output images/bananarchy-nokia-coconut.img is absent; prepare-release.sh will rebuild it"
fi
echo "[check] 8000 4G (nokia-sparkler) appended DTB..."
SPARKLER_DTS="$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts"
if ! grep -qF 'qcom,msm-id = <0xf5 0x00>;' "$SPARKLER_DTS"; then
fail "nokia-sparkler DTS lost the stock MSM8909 msm-id"
fi
if ! grep -qF 'qcom,board-id = <0x08 0x100>;' "$SPARKLER_DTS"; then
fail "nokia-sparkler DTS lost the stock MTP board-id"
fi
if ! grep -qF 'qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;' "$SPARKLER_DTS"; then
fail "nokia-sparkler DTS lost the stock pmic-id"
fi
if ! grep -qF 'reg = <0x80000000 0x20000000>;' "$SPARKLER_DTS"; then
fail "nokia-sparkler DTS lost the 512 MiB memory fallback"
fi
for node in 'sound@7702000' 'vibrator@c000' 'audio-codec@f000'; do
if ! grep -qF "$node" "$SPARKLER_DTS"; then
fail "nokia-sparkler DTS is missing $node"
fi
done
if [ -f "$BASE_DIR/images/boot-bananarchy-nokia-sparkler.img" ]; then
if ! python3 "$BASE_DIR/scripts/check-beatles-bootimg.py" --device nokia-sparkler; then
fail "8000 4G boot image validation failed"
fi
else
echo "[skip] local build output images/boot-bananarchy-nokia-sparkler.img is absent; prepare-release.sh will rebuild it"
fi
if [ -f "$BASE_DIR/images/bananarchy-nokia-sparkler.img" ]; then
if ! python3 "$BASE_DIR/scripts/sync-beatles-bootfs.py" --check --device nokia-sparkler --raw-image "$BASE_DIR/images/bananarchy-nokia-sparkler.img"; then
fail "8000 4G raw image pmOS_boot filesystem is damaged or stale"
fi
else
echo "[skip] local build output images/bananarchy-nokia-sparkler.img is absent; prepare-release.sh will rebuild it"
fi
echo "[check] Release hygiene..."
KCONFIG="$BASE_DIR/patches/kernel/config-bananarchy-msm8909.armv7"
for cfg in "$KCONFIG" \
@@ -977,7 +1063,7 @@ fi
if grep -qE '"\$\{?BASE_DIR\}?/prebuilt/kernel-6\.12\.1-msm8916/(leds|camera)/"\*\.ko\*' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then
fail "apply-bananarchy-overlay.sh still copies uncompressed .ko files via *.ko* wildcard"
fi
for dev_img in images/bananarchy-nokia-argon.img images/bananarchy-nokia-beatles.img; do
for dev_img in images/bananarchy-nokia-argon.img images/bananarchy-nokia-beatles.img images/bananarchy-nokia-coconut.img images/bananarchy-nokia-sparkler.img; do
if [ ! -f "$BASE_DIR/$dev_img" ]; then
echo "[skip] local build output $dev_img is absent; skipping initramfs depmod check"
continue
@@ -1493,7 +1579,8 @@ for dts in \
"$BASE_DIR/devices/nokia-argon/qcom-msm8905-nokia-argon.dts" \
"$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dts" \
"$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles-cover.dts" \
"$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts"; do
"$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts"; do
if ! grep -A 3 'dai-link-multimedia3 {' "$dts" | grep -qF 'status = "disabled";'; then
fail "${dts#"$BASE_DIR/"} must keep dai-link-multimedia3 disabled"
fi
@@ -1507,13 +1594,16 @@ for q6cfg in \
done
if [ ! -f "$BASE_DIR/patches/kernel/0010-msm8909-rpm-lpm-bimc-wcd-ldo-uart.patch" ] || \
! grep -qF '0010-msm8909-rpm-lpm-bimc-wcd-ldo-uart.patch' "$BASE_DIR/scripts/build-kernel-audio.sh" || \
[ ! -f "$BASE_DIR/patches/kernel/0013-msm8909-early-scm-smp-cpufreq.patch" ] || \
! grep -qF '0013-msm8909-early-scm-smp-cpufreq.patch' "$BASE_DIR/scripts/build-kernel-audio.sh" || \
! grep -qxF 'CONFIG_QCOM_RPM_MASTER_STATS=y' "$BASE_DIR/patches/kernel/config-bananarchy-msm8909.armv7" || \
! grep -qxF 'CONFIG_QCOM_RPM_MASTER_STATS=y' "$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/kernel-config" || \
! grep -q ' qcom_mpm_enter_sleep$' "$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/System.map" || \
! grep -q ' spm_get_l2_device$' "$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/System.map" || \
! grep -q ' qcom_msm8909_gdsc_is_active$' "$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/System.map" || \
! grep -q ' qcom_iommu_resume$' "$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/System.map"; then
fail "deep-standby kernel patch 0010, RPM master stats config, or vMPM/L2-SAW/IOMMU symbols are missing"
! grep -q ' qcom_iommu_resume$' "$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/System.map" || \
! grep -q ' qcom_scm_set_boot_addr_mc$' "$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/System.map"; then
fail "deep-standby kernel patch 0010/0013, RPM master stats config, or vMPM/L2-SAW/IOMMU/early-SCM symbols are missing"
fi
for dts in \
"$BASE_DIR/devices/nokia-argon/qcom-msm8905-nokia-argon.dts" \
@@ -2240,6 +2330,76 @@ if ! grep -qF 'of_machine_is_compatible("nokia,coconut")' "$TORCH_SRC" || \
fail "nokia-coconut dual LED separation (GPIO_13 white:torch vs GPIO_32 camera:flash) is incomplete"
fi
echo "[check] Nokia 8000 4G (nokia-sparkler) keypad, audio, initfs, DRM & dual-GPIO torch invariants..."
SPARKLER_DEVINFO="$BASE_DIR/devices/nokia-sparkler/deviceinfo"
SPARKLER_INITFS="$BASE_DIR/devices/nokia-sparkler/modules-initfs"
SPARKLER_DTB="$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8909-nokia-sparkler.dtb"
TORCH_KO="$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko"
if ! grep -qxF 'deviceinfo_drm="true"' "$SPARKLER_DEVINFO"; then
fail "devices/nokia-sparkler/deviceinfo must set deviceinfo_drm=\"true\""
fi
if ! grep -qxF 'matrix_keypad' "$SPARKLER_INITFS" || \
! grep -qxF 'matrix_keymap' "$SPARKLER_INITFS"; then
fail "devices/nokia-sparkler/modules-initfs must include matrix_keypad and matrix_keymap"
fi
if ! grep -qF '0x500d4' "$SPARKLER_DTS" || \
! grep -qF '0x100007f' "$SPARKLER_DTS" || \
! grep -qF '0x205000e' "$SPARKLER_DTS" || \
! grep -qF '0x301009e' "$SPARKLER_DTS" || \
! grep -qF 'clock-frequency = <1094400000>;' "$SPARKLER_DTS" || \
! awk '/vibrator@c000 \{/,/\};/ { if ($0 ~ /status = "disabled";/) found=1 } END { exit(found ? 0 : 1) }' "$SPARKLER_DTS" || \
grep -qE '0x5008b|0x10002b8|0x20501be|0x30102b9' "$SPARKLER_DTS"; then
fail "devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts drifted from Sxmo keypad, CPU clock, or haptic invariants"
fi
if command -v dtc >/dev/null 2>&1 && [ -f "$SPARKLER_DTB" ]; then
dec_sparkler="$(dtc -q -I dtb -O dts "$SPARKLER_DTB" 2>/dev/null || true)"
if ! printf "%s\n" "$dec_sparkler" | grep -qF 'qcom,msm-id = <0xf5 0x00>;' || \
! printf "%s\n" "$dec_sparkler" | grep -qF 'qcom,board-id = <0x08 0x100>;' || \
! printf "%s\n" "$dec_sparkler" | grep -qF 'reg = <0x80000000 0x20000000>;' || \
! printf "%s\n" "$dec_sparkler" | grep -qF 'sound@7702000' || \
! printf "%s\n" "$dec_sparkler" | \
awk '/vibrator@c000 \{/,/\};/ { if ($0 ~ /status = "disabled";/) found=1 } END { exit(found ? 0 : 1) }' || \
! printf "%s\n" "$dec_sparkler" | grep -qF 'audio-codec@f000' || \
! printf "%s\n" "$dec_sparkler" | grep -qF '0x500d4' || \
! printf "%s\n" "$dec_sparkler" | grep -qF '0x100007f' || \
! printf "%s\n" "$dec_sparkler" | grep -qF '0x205000e' || \
! printf "%s\n" "$dec_sparkler" | grep -qF '0x301009e' || \
printf "%s\n" "$dec_sparkler" | grep -qE '0x5008b|0x10002b8|0x20501be|0x30102b9'
then
fail "prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8909-nokia-sparkler.dtb drifted from Sparkler DTS invariants"
fi
fi
if ! grep -qF 'vibrate_haptic_audio' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \
! grep -qF '157.0' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \
! grep -qF 'nokia,sparkler' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c"; then
fail "sxmo_vibrate.c lost 157 Hz haptic audio support for nokia-sparkler"
fi
if ! grep -qF 'of_machine_is_compatible("nokia,sparkler")' "$TORCH_SRC" || \
! grep -qF 'MSM8905_TLMM_GPIO31_PHYS' "$TORCH_SRC" || \
{ [ -f "$TORCH_KO" ] && ! grep -qaF 'GPIO_32/GPIO_31 (BC847BS)' "$TORCH_KO"; }; then
fail "nokia-sparkler dual-GPIO BC847BS torch support in leds-msm8905-torch is incomplete"
fi
echo "[check] Universal keypad-friendly timer (sxmo_timer.sh, dmenu, hooks)..."
TIMER_SH="$BASE_DIR/overlay/rootfs/usr/bin/sxmo_timer.sh"
if [ ! -x "$TIMER_SH" ] || ! sh -n "$TIMER_SH" 2>/dev/null; then
fail "overlay/rootfs/usr/bin/sxmo_timer.sh is missing, not executable, or has invalid syntax"
fi
if grep -qE 'boottime_alarm|pkill' "$TIMER_SH" || \
! grep -qF '# title="$icon_clk Timer"' "$TIMER_SH" || \
! grep -qF 'HUP INT TERM EXIT' "$TIMER_SH" || \
! grep -qF 'stop_ringing()' "$TIMER_SH"; then
fail "overlay/rootfs/usr/bin/sxmo_timer.sh failed permissionless/cancellation invariants"
fi
if ! grep -qF 'timer_menu_state' "$DMENU_SRC" || \
! grep -qF '/usr/bin/sxmo_timer.sh stop_ringing' "$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_mute_ring.sh" || \
! grep -qF '/usr/bin/sxmo_timer.sh stop_ringing' "$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_discard.sh"; then
fail "dmenu or ring mute/discard hooks are missing timer stop integration"
fi
if ! python3 "$BASE_DIR/scripts/test-timer.py" >/dev/null 2>&1; then
fail "scripts/test-timer.py failed"
fi
if [ "$FAILURES" -ne 0 ]; then
echo "[check] $FAILURES check(s) failed."
exit 1