Repository navigation
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
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
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.