Repository navigation
pmdomain: apple: pmgr-pwrstate: enable auto-managed domains early at boot (T6041) - #2175
AxxzyWasTaken wants to merge 3 commits into
Conversation
a0ab1c8 to
42443cc
Compare
|
Tested on the J614c (16-core CPU / 40-core GPU M4 Max, the full T6041 with 32 memory channels), on top of #1664. The full part has eight DCS channels that the J616c list doesn't cover: dcs_24-27 and dcs_28-31. On the J614c, iBoot leaves them forced on like the other 24, so with only the 36 words from the PR they stay on. I added them after the others in each block: 0x502800210, 0x502800220, 0x502800230, 0x502800240, /* dcs_16-19 */
0x502800250, 0x502800260, 0x502800270, 0x502800530, /* dcs_24-27 (full part) */
...
0x502280320, 0x502280328, 0x502280330, 0x502280338, /* dcs_20-23 */
0x502280340, 0x502280348, 0x502280350, 0x502280358, /* dcs_28-31 (full part) */dcs_27 isn't next to dcs_26: it's at main +0x530, and +0x280 is amcc27. It's the same word as the dcs_27 line I suggested on #1664. I don't know macOS's order for these eight. I used the ADT order, since I have no J614c ApplePMGR trace. Result:
On the J616c the eight extra words should be fused off, so your check skips them and the count stays at 36. I can't test that here. Could you confirm it on yours, if you add them? 🤖 Generated with Claude Code |
… too The full T6041 has 32 memory channels, the binned one 24. The words put on AUTO at boot come from a binned J616c, so on a full part iBoot's forced-on dcs_24-31 stayed forced on. Add their eight power-state words after the other DCS words of each PMGR group: dcs_24-27 in the main group, where dcs_27 is at +0x530, as +0x280 is amcc27, and dcs_28-31 in the East group. They go in ADT order, as there is no macOS trace from a full part. On the binned part they are fused off, so the existing check skips them: the binned part puts 36 words on AUTO, the full part 44. The full part's eight DCS words and their order come from joske's J614c test on aurora-silicon#2175. Assisted-by: LLM Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
|
Thanks for testing it on the full part, and for the words. I've added them as a new commit on top, "soc: apple: t6041-sleep: the full part's DCS channels on AUTO at boot too", as you wrote them: dcs_24-27 after dcs_16-19, with dcs_27 at main +0x530, and dcs_28-31 after dcs_20-23, in ADT order. The comment above the list now says that the full part's words are in ADT order and that the binned part skips them. The commit message credits your J614c test. On this J616c (binned: 24 channels, 6 AMCCs), one boot of my daily kernel with only this commit added:
Seven of the eight (dcs_24-26 and dcs_28-31) already read So the count stays at 36 here, and it's 44 on your J614c. Disclosure: prepared with an AI tool (the commits carry Assisted-by: LLM); tested as described. |
… too The full T6041 has 32 memory channels, the binned one 24. The words put on AUTO at boot come from a binned J616c, so on a full part iBoot's forced-on dcs_24-31 stayed forced on. Add their eight power-state words after the other DCS words of each PMGR group: dcs_24-27 in the main group, where dcs_27 is at +0x530, as +0x280 is amcc27, and dcs_28-31 in the East group. They go in ADT order, as there is no macOS trace from a full part. On the binned part they are fused off, so the existing check skips them: the binned part puts 36 words on AUTO, the full part 44. The full part's eight DCS words and their order come from joske's J614c test on aurora-silicon#2175. Assisted-by: LLM Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
f207e78 to
4c4ebec
Compare
|
Restacked on the rebased #1664 (integration/aurora 391fac6; head 4c4ebec), and it's no longer conflicting. Both commits applied unchanged. On my J616c, the head boots with "memory and fabric power management: 36 words on AUTO, 0 late" and 24 memory channels. One deep sleep and wake on it went cleanly: GPU, Wi-Fi and Bluetooth all came back, with 0 GPU fault lines. Host tests are 449/450, the same as the base; the details are on #1664. |
|
This PR adds a t6041_mem_auto= kernel command-line parameter in drivers/soc/apple/t6041-sleep.c and, behind it, a fixed table of physical PMGR register addresses written at arch_initcall when of_machine_is_compatible("apple,t6041"). Those domains are described in the device tree; the AUTO_ENABLE step should be driven from the PMGR power-state nodes (their reg and a property marking them auto-managed), with no command-line switch. The SMC pre-commit writes in apple_smc_sleep_commit() and dcp_t6041_s2r_all() are likewise chosen by the SoC compatible instead of the device's own node, and the display sleep path relies on fixed msleep() values documented only as measured; these should become bounded polls on the state they wait for. Until then this should stay a draft. |
4c4ebec to
9b996dd
Compare
… too The full T6041 has 32 memory channels, the binned one 24. The words put on AUTO at boot come from a binned J616c, so on a full part iBoot's forced-on dcs_24-31 stayed forced on. Add their eight power-state words after the other DCS words of each PMGR group: dcs_24-27 in the main group, where dcs_27 is at +0x530, as +0x280 is amcc27, and dcs_28-31 in the East group. They go in ADT order, as there is no macOS trace from a full part. On the binned part they are fused off, so the existing check skips them: the binned part puts 36 words on AUTO, the full part 44. The full part's eight DCS words and their order come from joske's J614c test on aurora-silicon#2175. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
9b996dd to
5726722
Compare
|
Pushed standalone DT-driven rework |
|
Thanks for the rework. At 5726722 the command-line parameter and the address table are gone, and the AUTO_ENABLE switch is driven by Before this leaves draft:
Rows wanted at this head: on the J616c and the J614c, the boot line (36 and 44 enabled, 0 failed), a dump of the words after boot and after a deep-sleep wake, an empty Assisted-by: LLM (Claude:Opus 5.5) |
5726722 to
5bc6f6c
Compare
|
Pushed
Validated with |
|
Thanks. At 5bc6f6c:
Rows wanted at this head: on the J616c and the J614c, the boot line (36 and 44 enabled, 0 failed), the words after boot and after a deep-sleep wake, an empty Assisted-by: LLM (Claude:Opus 5.5) |
5bc6f6c to
5c074c7
Compare
|
Pushed |
|
J616C (M4 Max 16c/32g, 6-MCC) exact-head boot &
(Keeping Draft until the companion |
5c074c7 to
da4ddab
Compare
|
Rebased onto |
Add the apple,auto-managed boolean property for hardware-managed power domains (such as DRAM channel slices and memory fabrics) that the boot loader may leave forced on and that must be switched to hardware automatic power management (AUTO_ENABLE) early at boot, before the PMP firmware starts. Disallow combining apple,auto-managed with apple,no-auto-pm, apple,firmware-owned, apple,inherited-on, or apple,t8132-pmgr-pwrstate. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
…boot Early at boot, before the PMP starts, hardware-managed power domains left forced on by iBoot must be switched to automatic power management (write target 0xf, wait for actual 0xf, then set AUTO_ENABLE). On Apple Silicon systems where iBoot leaves memory channel or fabric domains forced on, enabling AUTO_ENABLE after PMP is running freezes the SoC. Walk available apple,auto-managed PMGR power-state nodes at arch_initcall via their parent syscon regmap and switch forced-on words to AUTO_ENABLE, leaving fused-off, reset, or already auto-managed words untouched. At probe time, reject apple,t8132-pmgr-pwrstate consistently with the binding, fail loudly with -EIO if an apple,always-on auto-managed domain is off at boot, skip non-always-on off (fused-off) auto-managed domains with -ENODEV, and register active ones as always-on without re-writing the register after PMP may have started, refusing power-off and reset operations and skipping them in suspend_noirq and resume_noirq so firmware wake never rewrites AUTO_ENABLE while PMP is running. Add KUnit tests for apple_pmgr_ps_auto_enable() and cover the inherited-on conflict in pmgr-inherited.py. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
…states Add t6041-pmgr.dtsi describing the 32 DCS channel power states (dcs_00-31, with dcs_27 at pmgr_aux +0x530) and 12 fabric power states (fab0-7_soc, fab_gw_0/1, fab_afr, nub_fabric) verified against the J616c ADT, and mark them apple,auto-managed so the PMGR driver switches forced-on words to AUTO_ENABLE early at boot before PMP starts. On binned 24-channel parts (J616c), dcs_24-31 read fused off and are skipped cleanly (36 active words switched); on full 32-channel parts (J614c), all 44 words are switched. Drop the duplicate disabled ps_fab5_soc node from t6041-j614-j616-j575-scaler.dtsi now that t6041-pmgr.dtsi provides and enables it: it was originally added disabled alongside the rest of the placeholder scaler power-domain providers in commit 30f87ea ("arm64: dts: apple: describe both disabled M4 Max scalers"), not because ps_fab5_soc was unsafe, and enabling it as apple,always-on with apple,auto-managed switches the boot-active fabric to AUTO_ENABLE before PMP starts and registers it read-only as always-on. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
da4ddab to
9e68dcc
Compare
Reworked per review to be completely standalone (rebased directly onto
integration/aurora606d37ec77a5, decoupled from#1664) and driven purely from DT PMGR power-state nodes viaapple,auto-managed(zero module parameters, zero hardcoded physical address tables):dt-bindings: power: apple,pmgr-pwrstate: add apple,auto-managed: adds booleanapple,auto-managedwith mutual-exclusion constraints againstapple,no-auto-pm,apple,firmware-owned, andapple,inherited-on.pmdomain: apple: pmgr-pwrstate: enable auto-managed domains early at boot: addsarch_initcall(apple_pmgr_ps_auto_init)walking availableapple,auto-managedPMGR power-state nodes via their parent syscon regmap before PMP starts, switching forced-on domains toAUTO_ENABLEwhile skipping fused-off/reset/already-auto words cleanly. At probe, inactive (fused-off) domains return-ENODEVsilently and active ones register asGENPD_FLAG_ALWAYS_ONwithout rewriting registers, refusing power-off/reset and skippingsuspend_noirq/resume_noirqso firmware wake never rewritesAUTO_ENABLEwhile PMP is running. Includes 3 KUnit tests andpmgr-inherited.pycoverage.arm64: dts: apple: t6041: describe auto-managed DCS and fabric power states: addst6041-pmgr.dtsiwith all 44 ADT-verified T6041 DCS (32) and fabric (12) PMGR nodes (36 active on binned 24-channel J616c; all 44 active on 32-channel J614c; drops duplicate disabledps_fab5_socfromt6041-j614-j616-j575-scaler.dtsi).Verification
5726722abcad, 3 bisectable commits on606d37ec77a5./arm-io/pmgr).dt_binding_check(apple,pmgr-pwrstate.yaml): PASS.CHECK_DTBS=yacrosst6041-j616c.dtb,t6041-j614c.dtb,t6041-j575c.dtb: 0 errors/warnings.W=1build ofdrivers/pmdomain/apple/pmgr-pwrstate.o: 0 warnings.tools/testing/selftests/drivers/apple/pmgr-inherited.py: 5/5 PASS.scripts/checkpatch.pl --strict: 0 errors (only new-file MAINTAINERS notice on Commit 3).5726722abcad(confirmingapple-pmgr-pwrstate: 36 auto-managed domains enabled, 0 failedon J616c) is queued for our next idle test boot; J575c is untested and J614c 44/44 was previously tested on the earlier table prototype.Assisted-by: LLM (Google:Gemini 4 Neon)