Skip to content

T8011 (A10X): Wire USB host charging budget and back off on VBUS droop - #164

Merged
henrikklee merged 3 commits into
OrchardLinux:mainfrom
grierj:t8011-charging-pr
Dec 4, 2026
Merged

henrikklee merged 3 commits into
OrchardLinux:mainfrom
grierj:t8011-charging-pr

Conversation

@grierj

@grierj grierj commented Dec 4, 2026

Copy link
Copy Markdown

Summary

Fixes two charging regressions observed on iPad Pro (10.5-inch, Wi-Fi) (J207, shared across T8011 J120/J121/J207/J208 and Tristar boards with VBUS telemetry).

Refs OrchardLinux/orchard#552.

(Note: full wall-charger cable identification on J207's CBTL1610 rev 0x8a also depends on the GetID retry commit 2928ee76 in #136; we left that commit out of this PR to avoid duplicating/conflicting with #136 and tested these two commits together with it.)

Changes

  1. arm64: dts: apple: t8011-pro2: Wire USB host current budget to the Lightning charger
    • Adds usb-psy-name = "lightning"; to &usb2dev (matching every other Tristar iPad in arch/arm64/boot/dts/apple/), so dwc2 reports vbus_draw (500 mA) to apple-tristar-charger instead of holding computer USB ports at the 80 mA fallback (CURRENT_MAX=0).
  2. power: supply: apple_tristar_charger: Back off on VBUS droop instead of faulting at 4.75 V
    • Orion Bellatrix measures VBUS at the Lightning connector after USB cable/adapter IR drop. On real 5 V USB-A bricks and cables at 1.0–1.5 A, connector VBUS legitimately drops below 4750 mV (4736 mV at 1.48 A on an Anker Zolo 50 W USB-A brick, 4688 mV at 1.48 A / 4736 mV at 1.28 A on an Apple MacBook Air brick via USB-A adapter), which previously latched TRISTAR_FAULT and collapsed charging to 80 mA until unplug.
    • Preserves immediate TRISTAR_FAULT withdrawal 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.0 4.40 V device-side minimum), monitored whenever input is above fallback or targeting > 1 A.
    • On normal cable/adapter droop below 4500 mV, backs off by one ramp step (100 mA), caps vbus_limit_ma for that attachment, and holds steady instead of collapsing to 80 mA.

Testing

Tested on iPad Pro (10.5-inch, Wi-Fi) (J207) (combined with 2928ee76 from #136; also verified t8011-charging-pr builds cleanly standalone and passes all 52 test_source_*.py checks):

Power source Identification Input limit Orion VBUS (80 mA -> steady) Battery net current
Linux host USB-A port SDP (USB budget: 500 mA) 500 mA (was 80 mA) 5040 -> 4880 mV —
Anker Zolo 50 W (USB-A) BrickID 5 (2.4 A) 1500 mA (was 80 mA) 4992 -> 4736 mV +725 mA (Charging)
Apple MacBook Air brick (USB-C) USB-C 3.0 A (CC 1619 mV) 1500 mA 5168 -> 4832 mV +749 mA (Charging)
Apple brick + USB-A adapter BC1.2 DCP (D- 721 mV, D+ 722 mV) 1500 mA (previously tripped 4736 mV -> 80 mA) 5168 -> 4688 mV +688 mA (Charging)

Assisted-by: LLM

…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>
@henrikklee
henrikklee merged commit 10bec28 into OrchardLinux:main Dec 4, 2026
4 checks passed
@henrikklee

Copy link
Copy Markdown

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:

  • The droop backoff moves out of the poll loop into a hook in the charger's per-chip table, used by both the ramp and the guard, so boards without a VBUS ADC (J127/J128, through the PMIC's input-collapse signal) can plug in later. Behaviour on the A10X stays the same.
  • The limit is lowered only when a second reading in a row is still below 4.5 V, as the SN2400 driver does, so one short dip doesn't cost the attachment its current.

Still open: wall chargers on J207 also need the cable-ID retry from #136.

@henrikklee

Copy link
Copy Markdown

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.

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.

2 participants