Repository navigation
T8011 (A10X): Wire USB host charging budget and back off on VBUS droop - #164
Merged
Merged
Conversation
…ghtning charger Every other Tristar iPad sets usb-psy-name = "lightning" on its dwc2 device node so vbus_draw reports the configured USB host budget (500 mA) to apple-tristar-charger. t8011-pro2.dtsi omitted it, leaving iPad Pro 2 boards (J120, J121, J207, J208) at the 80 mA fallback (CURRENT_MAX=0) when attached to a computer USB port. Add usb-psy-name = "lightning" to &usb2dev and update the VBUS window comment on charger@80. Tested on J207 (iPad Pro 10.5-inch, Wi-Fi): attached to a Linux host USB port, dwc2 reports 500 mA and apple-tristar-charger ramps cleanly from 80 mA to 500 mA. Ref: OrchardLinux/orchard#552 Assisted-by: LLM Signed-off-by: Grier Johnson <grier@scooterfarm.com>
…of faulting at 4.75 V The Orion Bellatrix VBUS ADC measures Lightning VBUS at the iPad's connector, after USB cable and adapter IR drop. On real 5 V USB-A bricks and cables, drawing 1.0-1.5 A routinely drops connector VBUS below 4.75 V (the host-port minimum before cable drop): on J207 we measured 4736 mV at 1.48 A on an Anker Zolo 50 W USB-A brick (BrickID 5) and 4688 mV at 1.48 A (4736 mV at 1.28 A) on an Apple MacBook Air brick through a USB-A adapter (BC1.2 DCP). Previously, any single sample below 4750 mV latched TRISTAR_FAULT and withdrew input current to the 80 mA fallback until unplug. Separate hard VBUS faults from normal cable droop: - Keep immediate TRISTAR_FAULT withdrawal to fallback on IIO read error, overvoltage (> 5500 mV, protecting low-voltage range 0 against high-voltage USB-PD rails), or severe brownout (< 4350 mV, below the USB 2.0 4.40 V device-side minimum), checked whenever input is above fallback or targeting > 1 A. - On droop below 4500 mV, step back by one ramp step (100 mA), cap vbus_limit_ma for the current attachment, and hold steady instead of collapsing to 80 mA. Reset vbus_limit_ma on disconnect/new attachment. Tested on J207 (combined with OrchardLinux#136's GetID retry): - Computer USB-A (SDP): ramps cleanly to 500 mA (VBUS 5040 -> 4880 mV) - Anker Zolo 50 W USB-A (BrickID 5): ramps to 1500 mA, VBUS 4736 mV, +725 mA net into battery - Apple MacBook Air USB-C brick + USB-C-to-Lightning (3.0 A CC): ramps to 1500 mA, VBUS 4832 mV, +749 mA net into battery - Apple brick + USB-A adapter + USB-A-to-Lightning (BC1.2 DCP): ramps to 1500 mA, VBUS 4688 mV, +688 mA net into battery Ref: OrchardLinux/orchard#552 Assisted-by: LLM Signed-off-by: Grier Johnson <grier@scooterfarm.com>
…rrors With the VBUS guard active at 500 mA USB input as well as > 1 A, a single transient I2C NACK (-ENXIO) or -EBUSY from the Orion Bellatrix VBUS ADC permanently latched TRISTAR_FAULT and collapsed input current to the 80 mA fallback for the rest of the attachment. Observed live on J207 at t = 2.48s right after ramping to 500 mA USB SDP: i2c-apple 20a111000.i2c: NACK, status 0x10210110 apple-tristar-charger ...: VBUS guard tripped (sample 0 mV, error -6) Require three consecutive VBUS ADC read errors before latching TRISTAR_FAULT, holding the current ramp step (without advancing) while retrying and resetting the error counter on any successful read or attachment change. Measured overvoltage (> 5500 mV) and severe brownout (< 4350 mV) still trip TRISTAR_FAULT immediately. Ref: OrchardLinux/orchard#552 Assisted-by: LLM Signed-off-by: Grier Johnson <grier@scooterfarm.com>
|
Merged, thank you Grier! A great first contribution, and the measurements in the description made it easy to land. What it does for users: on the A10X iPad Pros a computer's USB port now gives 500 mA instead of 80 mA, and 5 V bricks keep charging at about 1.5 A when the cable and adapter drop the voltage, instead of collapsing to 80 mA until the cable is pulled. Merged as it was, nothing changed on your branch. Two follow-ups we are doing ourselves in a separate pull request right away:
Still open: wall chargers on J207 also need the cable-ID retry from #136. |
|
The two follow-ups are merged in #175: the sag check is now a per-chip hook shared by the ramp and the guard, and the limit drops only after a second reading in a row below 4.5 V. |
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.
Summary
Fixes two charging regressions observed on iPad Pro (10.5-inch, Wi-Fi) (
J207, shared across T8011J120/J121/J207/J208and Tristar boards with VBUS telemetry).Refs OrchardLinux/orchard#552.
(Note: full wall-charger cable identification on J207's CBTL1610 rev
0x8aalso depends on theGetIDretry commit2928ee76in #136; we left that commit out of this PR to avoid duplicating/conflicting with #136 and tested these two commits together with it.)Changes
arm64: dts: apple: t8011-pro2: Wire USB host current budget to the Lightning chargerusb-psy-name = "lightning";to&usb2dev(matching every other Tristar iPad inarch/arm64/boot/dts/apple/), sodwc2reportsvbus_draw(500 mA) toapple-tristar-chargerinstead of holding computer USB ports at the80 mAfallback (CURRENT_MAX=0).power: supply: apple_tristar_charger: Back off on VBUS droop instead of faulting at 4.75 V1.0–1.5 A, connector VBUS legitimately drops below4750 mV(4736 mVat1.48 Aon an Anker Zolo 50 W USB-A brick,4688 mVat1.48 A/4736 mVat1.28 Aon an Apple MacBook Air brick via USB-A adapter), which previously latchedTRISTAR_FAULTand collapsed charging to80 mAuntil unplug.TRISTAR_FAULTwithdrawal to fallback on IIO read error, overvoltage (> 5500 mV, protecting low-voltage range 0 against HV USB-PD rails), or severe brownout (< 4350 mV, below the USB 2.04.40 Vdevice-side minimum), monitored whenever input is above fallback or targeting> 1 A.4500 mV, backs off by one ramp step (100 mA), capsvbus_limit_mafor that attachment, and holds steady instead of collapsing to80 mA.Testing
Tested on iPad Pro (10.5-inch, Wi-Fi) (
J207) (combined with2928ee76from #136; also verifiedt8011-charging-prbuilds cleanly standalone and passes all 52test_source_*.pychecks):SDP(USB budget: 500 mA)500 mA(was80 mA)5040 -> 4880 mVBrickID 5 (2.4 A)1500 mA(was80 mA)4992 -> 4736 mV+725 mA(Charging)USB-C 3.0 A(CC 1619 mV)1500 mA5168 -> 4832 mV+749 mA(Charging)BC1.2 DCP(D- 721 mV, D+ 722 mV)1500 mA(previously tripped4736 mV->80 mA)5168 -> 4688 mV+688 mA(Charging)Assisted-by: LLM