uzbek-plus/logs/b10/b10b2/B10B2-RESULT.md
q 58dcb3d121 B10: battery charging — PM8916 LBC supervisor v4 (CHARGE/HOLD, FAULT safe clamp to 4.00 V) and persistent B10B-5 cache
- LBC supervisor v1..v4 (linux/patches/b10b3-lbc-supervisor-v3.patch + b10/b10b3/lbc-v3-to-v4-fault-clamp.diff):
  CHARGING 4.20 V/450 mA -> HOLD 4.05 V after 60 min CV -> battery -> new cycle on USB insert; FAULT = VDD_MAX 4.00 V clamp
- RAM tests C/B/D/D2/D3/D4 (safety timer only ends fast charge), B10B-4 actuator audit (VDD_MAX works, USB_SUSP does not),
  B10B-5 FAULT clamp regression, production run, warm reboot via PON reboot reason
- cache = B10B-5 c3732515 (HW EDL write, readback + full partition verify), class-A persistent validation
- test-only hooks/images are not part of the production kernel; images with the AP PSK are not published
2026-10-04 19:00:27 +03:00

72 lines
5.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# B10B2-RESULT — upstream pm8916_lbc charger, RAM only
Date: 2026-10-03. **Verdict: PASS with a caveat** (see "Not verified").
aboot/cache untouched, eMMC writes = 0, no manual PMIC writes before or after probe. Boot class A (RTC 5 s) via RESET-held lk1st fastboot.
## Image / DT
- kernel `7.2.7-aurora-b10b2` = b10b1 + `CONFIG_CHARGER_PM8916_LBC` (`linux/aurora-b10b2.config`).
- DTB `linux/dts/msm8916-jz08-aurora-b10b2.dts` = B10B-1 +
`&pm8916_usbin { disabled }`, `&pm8916_charger { okay; monitored-battery; qcom,fast-charge-safe-voltage = 4200000;
qcom,fast-charge-safe-current = 500000 }`, `&pm8916_bms { power-supplies = <&pm8916_charger> }`,
`&usb`/`&usb_hs_phy { extcon = <&pm8916_charger> }` → **USB extcon has exactly one owner** (`charger@1000`, USB=1; verified in the DTB and live).
- simple-battery unchanged from B10B-1 (3000 mAh, 3.4 V, **4.20 V B10 cap; the cell allows 4.35 V — not used**).
- image `b10/b10b2/out/aurora-b10b2.img` 9f8a9096 (`build-b10b2.sh`), driver `b10b2-boot.sh K`, observer `b10b2-mon.sh N P` (reads only, ALERT on VBAT > 4.22 V / PMIC > 60 °C).
out/ contains the B8F initramfs (PSK) → never publish.
## Baseline before probe (`baseline-b10b1.txt`, `baseline-summary.txt`; running B10B-1, same lk1st path)
CHG_STATUS 05, CHGR RT 20, CHG_CTRL 90, VDD_MAX/SAFE 08/08 (4.20 V), IBAT_MAX/SAFE 00/0a (90/990 mA), VIN_MIN 04 (4308 mV),
TCHG_MAX_EN/TCHG_MAX 80/1d (timer on, 120 min), IBATTERM 0x105B 09, COMP_OVR1 (VBAT_DET override) 00, BOOT_DONE 80, 0x1643 0b,
USB 0x1308/0x1309 02/90, USB RT 03, BAT_IF 0x1208 83, BAT RT 03, USB IRQ cfg 0x1311/15/16 02.
## Charger driver writes (`diff-probe.txt`, full PMIC diff vs baseline)
| reg | before → after | meaning |
|---|---|---|
| 0x1044 IBAT_MAX | 00 → **04** | **450 mA** (500 mA requested; 90 mA hardware step: 500000/90000 − 1 = 4) |
| 0x1045 IBAT_SAFE | 0a → **04** | 450 mA |
| 0x1049 CHG_CTRL | 90 → **a0** | CHG_EN + PSTG_EN (bit4 cleared, bit5 set) |
| **0x1060 TCHG_MAX_EN** | **80 → 00** | **upstream disables the charger safety timer** (0x1061 stays 1d) |
| 0x1040 VDD_MAX / 0x1041 VDD_SAFE | 08 → 08 (written, same value) | 4.20 V |
Untouched: VIN_MIN, IBATTERM/termination (0x105B 09), COMP_OVR1/VBAT_DET (00), BOOT_DONE (80), WDOG, BAT_IF, USB IRQ config (same as with pm8916_usbin).
All other diffs are dynamic data (ADC 0x31/32/33xx, BMS 0x40xx data, RTC). Exactly as predicted from the driver source.
sysfs `pm8916-lbc-chgr` (type USB): online 1, constant_charge_current 450000, constant_charge_voltage_max 4200000. BMS status → Charging.
## Observation (`ram1-mon.txt`, `ram1-mon-table.txt`; 22 samples × 30 s, uptime 54–686 s, then stopped on purpose)
- State: CC/fast charge the whole time (CHG_STATUS 05, CHGR RT 20 = FAST_CHG_ON), USB path 02/90, USB RT 03, BAT RT 03, online 1.
- **VADC VBAT: 3.80 → 3.8235 V**; after the noisy LTE/Wi-Fi start-up a steady rise 3.8086 (295 s) → 3.8235 (686 s) ≈ +2.3 mV/min.
BMS FIFO 13316 → 13433 (diagnostic; BMS voltage_now still ×300 µV, ≈5.5 % high, not used for decisions).
- USB meter (operator): 0.357 A during kernel boot, then **0.355 A, peaks 0.38 A**.
- PMIC die temp 44 → 48–49 °C (plateau), CPU 45–47 °C. No ALERT. VBAT far below 4.22 V.
- CV and termination were not reached (estimated 2.5–4 h more from VBAT 3.82 V).
## BOOT_DONE / the earlier ~0.08 A
| boot | BOOT_DONE | IBAT_MAX | USB meter | VBAT trend |
|---|---|---|---|---|
| cache (lk2nd extlinux), class A | 00 | 00 (90 mA) | 0.15–0.41 A | charging, terminated after ~45 min (B10A) |
| RAM via lk1st fastboot, no LBC driver (B10B-0/1) | 80 | 00 (90 mA) | ≈0.08 A | flat / draining under load (ram1 drained to ≈3.7 V in ~7.7 h) |
| RAM via lk1st fastboot + pm8916_lbc (B10B-2) | 80 (before and after probe) | 04 (450 mA) | ≈0.36 A | rising ≈2.3 mV/min |
With BOOT_DONE = 1 the input/charge current follows IBAT_MAX: the ~0.08 A in B10B-0/1 was IBAT_MAX = 90 mA under BOOT_DONE, not another
cause. Without BOOT_DONE (cache boots) the LBC evidently ignores the 90 mA field (autonomous current). BOOT_DONE = 0 with IBAT_MAX = 450 mA
could not be tested in a RAM boot (lk1st always sets BOOT_DONE in fastboot). The USB meter shows the whole board, not the battery current;
the conclusion rests on meter + VADC VBAT trend together.
## Other subsystems
LTE START OK 74.1 s, ping via wwan0 10/10 (snapshot 3/4 during start-up); Wi-Fi AP enabled 78.8 s, Pronto running; NCM/telnet and
gadget (UDC configured) fine with the LBC extcon; display errors 0 (fbcon/panel up); eMMC w=0.
## Not verified (caveat)
Hardware termination and the (expected) absence of automatic recharge with upstream pm8916_lbc were **not observed in this run**
(low initial SOC, multi-hour duration, and the driver disables the safety timer, so an unattended multi-hour RAM charge was not
accepted). Absence of software recharge is established by the code audit (B10A-DRIVER-AUDIT: only the usb_vbus IRQ is handled).
The full cycle termination → VBAT drop → restart is to be tested in B10B-3 with a recharge supervisor.
## After the test
Monitor stopped (host and board side). The LBC registers written by the driver (IBAT_MAX 450 mA, timer off, CHG_CTRL a0) and
BOOT_DONE live in the PMIC retained domain and survive a warm/class-B reboot → return to SBL defaults needs a **full power-off
(battery out ≥ 90 s) = class A**.
## Bench reset after B10B-2 (class-A power cycle, no RESET; `post-classA-check.txt`)
Operator: USB out → battery out → ≈2.5 min → battery in → USB in. Boot 14:39 = normal cache B9C (`7.2.7-aurora-b9c`), RTC 3 s → **class A**.
Read-only snapshot: CHG_STATUS 05, VDD_MAX/SAFE 08/08, **IBAT_MAX 00**, IBAT_SAFE 0a, VIN_MIN 04, **CHG_CTRL 90**, IBATTERM 09,
**TCHG_MAX_EN/TCHG_MAX 80/1d**, COMP_OVR1 00, USB 0x1308 02, **BOOT_DONE 0x1642 00**, 0x1643 00, PON_REASON1 10, POFF2 00.
→ All LBC registers back at SBL1 defaults; the bench is clean.