Skip to content

pmdomain: apple: T8152 PSD services as power domains - #2459

Open
sithglan wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/t8152-psd
Open

sithglan wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/t8152-psd

Conversation

@sithglan

Copy link
Copy Markdown
Contributor

On T8152 several blocks are powered through PMGR2 PSD services rather than PMGR power-state registers: the video decoder (service 50), the USB4 routers and their PHYs (the CIO services) and the USB controllers (175, 176). So far #2139 and #2178 each carried their own variant of a PSD power domain: one compatible per user, AVD always on, CIO with power-off. As agreed on #1797, this replaces them with one generic per-service provider.

  • dt-bindings: power: add the Apple T8152 PSD service (apple,t8152-psd): one node per service, its 0x100-byte block as reg, #power-domain-cells = <0>, an optional label, and an optional apple,always-on for a service whose consumers can't yet restore what another agent set up in its blocks.
  • pmdomain: apple: add the T8152 PSD power domains. Power-on requests state 0 and power-off the cold state 6. The driver waits for the acknowledge (bit 0 of +0xbc) before reading the state (bits 2:0 of +0x80), because that read consumes the acknowledge. An apple,always-on service is powered at probe and kept on. Any other starts in the state the hardware reports, so genpd powers off a service nobody uses.

Users:

Checks: pmgr-psd.o builds with no W=1 warnings, dt_binding_check passes for the new schema, checkpatch is clean. Hardware results for the AVD power-off and the CIO services are in the comments.

On T8152 the video decoder, the USB4 routers and their PHYs and the USB
controllers are powered through PMGR2 PSD services instead of PMGR
power-state registers. Each service has a 0x100-byte block with a target
state, an acknowledge bit and the current state.

Describe one service per node as a power domain, with an optional
apple,always-on for a service whose consumers cannot restore what
another agent set up in its blocks yet.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Provide each T8152 PMGR2 PSD service as a power domain. Power-on
requests state 0 and power-off the cold state 6. The driver waits for the
acknowledge before it reads the state, because reading the state
consumes the acknowledge. A service marked apple,always-on is powered at
probe and kept on. Otherwise the domain starts in the state the
hardware reports, so genpd powers off a service that nothing uses.

The consumers include IRQ-safe devices, the DARTs, so the domains are
IRQ-safe and a transition is polled atomically, as the PMGR power states
are. On the J873g the AVD service (50) reaches state 0 in 390-500 us and
the cold state in about 240 us; the timeout is 10 ms.

The AVD and the USB4 routers' CIO services, which so far each had their
own variant of this, and the USB controllers (services 175 and 176) use
it.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan

Copy link
Copy Markdown
Contributor Author

J873g results, on #2178's stack (which carries #2139's AVD with this provider) plus a TEST-only commit that logged every transition.

  • IRQ-safe: the first version used sleeping polls. genpd then refused to power off the AVD domain, because its DART is an IRQ-safe device (PM domain avd will not be powered off). The domains are now GENPD_FLAG_IRQ_SAFE and poll atomically, like pmgr-pwrstate.
  • Transition times (AVD, service 50): state 0 in 390–500 µs, the cold state in 236–242 µs. The atomic timeout is 10 ms.
  • AVD: with the decoder idle at boot, the domain went off 2 s after probe (state register 6) and genpd shows avd off-0. Decoding H.264, HEVC, HEVC Main10, VP9 and AV1 (60 frames each, framemd5 against software) powered it on and stayed bit-exact across 292 on/off transitions: the decoder autosuspends after 100 ms, so it cycled between files. 4K60 H.264 to a null sink ran at 150 fps. 11 s after the last decode the domain was off again. No DART or AVD errors, so the cold Gen3 DART re-init and the decoder setup on resume both hold up.
  • CIO: the twelve CIO services probe and read off-0 while no USB4 cable is attached, as with J873g: USB4 with hotplug on the rear USB-C ports (T8152 routers, PCIe-C, port monitor; M6 Mac mini) #2178's previous variant. No cable was on the J873g for this run.

I'm taking this out of draft.

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