Skip to content

iOS 27 charging: CHARGING.md, the S9 charger guard's and fast-charge path's rules (hakios.max77705_charge.h) with host tests, the owner's fast-charger test plan - #415

Merged
claudiusthebot merged 1 commit into
mainfrom
agent/fastcharge/charging
Nov 24, 2026
Merged

claudiusthebot merged 1 commit into
mainfrom
agent/fastcharge/charging

Conversation

@claudiusthebot

@claudiusthebot claudiusthebot commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

The Galaxy S9's charging under iOS 27: the facts (CHARGING.md), the rules the fork's new charger guard and its fast-charge path follow (hakios.max77705_charge.h, plain C), their host tests in CI, and the owner's test plan for a fast wall charger (CHARGING-TEST.md).

Goes with Scion-Project/xnu#68 (the guard itself, bsd/dev/starlte_charger.c, which carries a copy of the header).

What was wrong (measured on phone 2, 24 Nov): the iOS 27 kernel only read the gauge. S-Boot leaves the MAX77705 charger's watchdog on, and nothing in iOS kicked it, so the charger stopped about 70 s after every boot (DETAILS_01 0x33 -> 0x3b, watchdog expired) and iOS said "cable in, not charging". iOS was also given a fixed 25 C battery temperature, and nothing stopped charging when hot or cold. The hardware safety timer is off (S-Boot and Samsung's driver leave it off).

The rules (every number is Samsung's own, from its device tree for the S9; stricter where they differ):

  • per charger type (from the MUIC's BC_STATUS): SDP 475/550 mA, CDP 1500/1500, DCP 1800/2100, AFC 9 V 1650/2150, anything else 500/500;
  • charging off at 41.0 C and up (back at 39.0) and 5.0 C and down (back at 10.0); 700 mA at 15.0 C and down; 45 C latches off;
  • session timers per type; full and recharge (4280 mV / 98 %);
  • faults latch off until the cable goes: float above 4350 mV, VBUS over-voltage, battery missing/dead/over-voltage, timer fault, thermal shutdown, a read-back that differs; the charger's watchdog expiry is re-armed, as Samsung does;
  • 9 V only on a DCP, battery 15-39 C, charger thermistor under 44 C, under 98 %, no fault, VBUS at 5 V, and only after the answer says result 0 with VBUS 7.5-10.5 V both in the answer and in USBC_STATUS1; dropped (500 mA, 5 V asked) when any of that stops holding; never on a computer port.

Tests: tools/max77705-charge-test.sh (sanitizers): every encoding, every BC_STATUS byte, every type at every temperature both ways through the hysteresis, each fault, the timers, full/recharge, the 9 V path's refusals, its good path and every reason to drop it, and a 61440-state grid of invariants (input never above the type's, never above 500 mA with VBUS high outside a 9 V session, 9 V never asked outside its conditions). 664810 checks, 0 failures. Added to check.yml; the header is a codec layer (arch-layers.conf).

On the phone (phone 2, the Mac mini's USB-C port, a CDP): see CHARGING.md's last section and the PR in the fork. The fast-charge handshake itself could not run here (no wall charger); CHARGING-TEST.md is the owner's step.

Nothing of Samsung's code is copied; its GPL source was read for numbers and register meanings only. No NVM or OTP of any chip is written by anything here.

… fast-charge path (hakios.max77705_charge.h) and their tests, the owner's fast-charger test plan

docs/ios27/CHARGING.md: which chips charge the Galaxy S9, how Samsung's kernel detects the charger and does the
AFC 9 V handshake, its limits per charger type, its temperature bands and timers, what the hardware enforces
alone and what needs software, what iOS 27 did before (measured on phone 2: the charger stopped about 70 s after
every boot because nothing kicked its watchdog; a fixed 25 C battery; no temperature protection), what the
fork's charger guard does now, and phone 2's windows on a computer port.

drivers/power/max77705/hakios.max77705_charge.h (plain C, a codec): the rules, every number Samsung's own for
this phone, stricter where they differ. tools/max77705_charge_test.c (tools/max77705-charge-test.sh, in CI):
the encodings, every BC_STATUS byte, every type at every temperature both ways, the faults, the timers, full
and recharge, the watchdog's re-arm, the 9 V path's refusals, its good path and every reason to drop it, and a
61440-state grid of invariants: 664810 checks.

docs/ios27/CHARGING-TEST.md: the owner's steps with a fast wall charger, what to see, what to read from the
console, when to stop.

The fork's copy of the header is Scion-Project/xnu bsd/dev/hakios.max77705_charge.h. Samsung's GPL source was
read for facts only.
@claudiusthebot
claudiusthebot merged commit 0dd9db9 into main Nov 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant