Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6decb58
soc: apple: sleep: coprocessor stop helpers for a SoC sleep driver of…
AxxzyWasTaken Nov 12, 2026
63b5c79
soc: apple: t6041-sleep: EL2 suspend-to-RAM for T6041 (M4 Max)
AxxzyWasTaken Nov 12, 2026
8a9d521
irqchip/apple-aic: save and restore the T6041 AIC around a firmware s…
AxxzyWasTaken Nov 12, 2026
834cf35
nvme-apple: take part in a firmware sleep on T6041
AxxzyWasTaken Nov 12, 2026
975de41
soc: apple: pmp: keep the T6041 firmware data across a real sleep
AxxzyWasTaken Nov 12, 2026
536bffd
mfd: macsmc: T6041: WKTP and pmVC before the sleep commit
AxxzyWasTaken Nov 12, 2026
3fc4624
soc: apple: aop: T6041 sleep order and the 27.2 firmware segment
AxxzyWasTaken Nov 12, 2026
a9f0bfe
PCI: apple: bring conventional ports back after a real sleep
AxxzyWasTaken Nov 12, 2026
597bb3f
drm/asahi: g17: sleep on T6041
AxxzyWasTaken Nov 12, 2026
49d8c70
iommu/apple-dart: add a display DART keep/restore helper for T6041 S2R
AxxzyWasTaken Nov 11, 2026
74e5abf
drm/apple: T6041 S2R display stop and restart
AxxzyWasTaken Nov 11, 2026
e6a2516
drm/apple: T6041 S2R: leave bridge 4 unarmed, mark external DARTs dark
AxxzyWasTaken Nov 11, 2026
99b47cd
drm/apple: T6041 S2R: shorten the display stop/restart waits
AxxzyWasTaken Nov 11, 2026
8d7fb99
Bluetooth: hci_bcm4377: rebind after power loss in a real sleep
AxxzyWasTaken Nov 11, 2026
740bed8
PCI: apple, nvme-apple: resume asynchronously
AxxzyWasTaken Nov 11, 2026
47d3193
pinctrl: apple: ack a level interrupt again after unmasking it
AxxzyWasTaken Nov 12, 2026
aab3a47
soc: apple: sep: refuse a deep sleep at once over a stuck enclave
AxxzyWasTaken Nov 12, 2026
2b8042b
soc: apple: sep: tell the enclave at suspend where no sleep core comm…
AxxzyWasTaken Nov 12, 2026
06836ec
soc: apple: t6041-sleep: say what the driver does now
AxxzyWasTaken Nov 12, 2026
4383b14
soc: apple: t6041-sleep: hold the parked CPUs before stopping them
AxxzyWasTaken Nov 12, 2026
f828b8c
soc: apple: t6041-sleep: wait for the reply to each PMU write
AxxzyWasTaken Nov 12, 2026
d26da41
spmi: apple: drop replies left by firmware at a firmware-driven resume
AxxzyWasTaken Nov 12, 2026
118c7e3
soc: apple: t6041-sleep: drain the FIFO before each PMU write too
AxxzyWasTaken Nov 12, 2026
deefca6
soc: apple: sep: refuse to sleep at suspend over a DART without sleep…
AxxzyWasTaken Nov 12, 2026
6b3a4bc
soc: apple: t6041-sleep: stay out without aura's S2R mailbox
AxxzyWasTaken Nov 12, 2026
e640499
dt-bindings: soc: apple: add the T6041 sleep node
AxxzyWasTaken Nov 17, 2026
f01b2e7
arm64: dts: apple: t6041: SEP DART sleep lists and the sleep node
AxxzyWasTaken Nov 12, 2026
cb4425f
drm/asahi: hw: t6041: restart the 40-core GPU after a sleep too
AxxzyWasTaken Nov 12, 2026
7a99a82
soc: apple: t6041-sleep: drop the bring-up diagnostics
AxxzyWasTaken Nov 12, 2026
a8be2e1
iommu/apple-dart: T6041 display keep: drop the register dump
AxxzyWasTaken Nov 12, 2026
30722ab
drm/apple: T6041 S2R: drop the bring-up test hooks
AxxzyWasTaken Nov 12, 2026
42e0b1c
soc: apple: display-gate: M4 Max: chains from a tree that describes D…
AxxzyWasTaken Nov 12, 2026
70a0051
drm/apple: T6041 S2R: the external chains' DARTs dark by node
AxxzyWasTaken Nov 12, 2026
5f0293c
drm/apple: T6041 S2R: every external DCP, not only the first two
AxxzyWasTaken Nov 12, 2026
7bef903
soc: apple: t6041-sleep: the full part's 32 memory channels
AxxzyWasTaken Nov 13, 2026
8a2c3a0
mfd: macsmc: T6041: WKTP back to 0 once a wake is a full one
AxxzyWasTaken Nov 15, 2026
ea97ef5
soc: apple: sep: T6041 sleep messages rate-limited, Lost refused with…
AxxzyWasTaken Nov 15, 2026
cd59f6b
tools/asahi: model the T6041 S2R paths in the bcm4377 and SEP sleep t…
AxxzyWasTaken Nov 15, 2026
38a0205
soc: apple: t6041-sleep: dcs_27 to AUTO at the commit on the full part
AxxzyWasTaken Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Documentation/devicetree/bindings/soc/apple/apple,t6041-sleep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/apple/apple,t6041-sleep.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple T6041 system sleep

maintainers:
- AxxzyWasTaken <axxzytte@gmail.com>

description: |
Suspend-to-RAM on the M4 Max (T6041) for a kernel running directly at EL2.
Unlike the sleep nodes of the other Apple SoCs, this one has no registers
and no properties. The blocks the driver writes to enter and leave the sleep
(the PMGR's power words, the CPU clusters, the memory controller's channels,
the PMU behind nub-spmi0, the storage link) are at the same addresses on
every T6041 and belong to several hardware blocks that other drivers also
use, so the driver maps them itself and claims none of them. The way back
from a sleep is the boot loader's S2R mailbox, which the boot loader names
in /chosen; without it the driver offers no deep sleep.

properties:
compatible:
const: apple,t6041-sleep

required:
- compatible

additionalProperties: false

examples:
- |
t6041-sleep {
compatible = "apple,t6041-sleep";
};
5 changes: 5 additions & 0 deletions arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
sep = &sep;
};

/* Suspend-to-RAM at EL2 through aura's S2R mailbox; without the mailbox it stays out. */
t6041-sleep {
compatible = "apple,t6041-sleep";
};

chosen {
#address-cells = <2>;
#size-cells = <2>;
Expand Down
14 changes: 14 additions & 0 deletions arch/arm64/boot/dts/apple/t6041.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,20 @@
opp-microwatt = <531000>;
};

/*
* What the SEP's DART gets around a sleep, as offset and value: the writes T8140's has
* (t8140.dtsi), which the J616C has slept with. The SEP driver saves the DART with them
* before it tells the enclave to sleep at suspend.
*/
&sep_dart {
apple,sleep-prepare = <0x80 0xa102>, <0x704 0xffffffff>;
apple,sleep-restore = <0x210 0x0>, <0x20c 0x800005f5>,
<0x220 0xf0f0f>, <0x224 0x80808>,
<0x300 0x1>, <0x318 0x1>;
apple,sleep-restore-late = <0x80 0x8000>, <0x228 0x3f3f3f3f>,
<0x22c 0x1010101>;
};

/*
* The ISP DART's address filter, from the J616c ADT's dart-isp0
* dapf-instance-0 (its sixth reg window), in the ADT's order: the
Expand Down
14 changes: 14 additions & 0 deletions drivers/bluetooth/hci_bcm4377.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Copyright (C) The Asahi Linux Contributors
*/

#include <linux/suspend.h>
#include <linux/async.h>
#include <linux/atomic.h>
#include <linux/bitfield.h>
Expand Down Expand Up @@ -3194,6 +3195,19 @@ static int bcm4377_resume(struct device *dev)
bcm4377->wake_armed = false;
}

/*
* A real sleep took the function's power: the firmware is gone, and every resume command
* would only time out (two times 2 s inside the system resume, then the rebind anyway).
* Skip them and rebind from the work queue; probe boots the firmware from scratch.
*/
if (pm_resume_via_firmware() && !bcm4377->dma_window_base) {
bcm4377->quiesced = false;
bcm4377->resume_powered = false;
WRITE_ONCE(bcm4377->setup_retry_blocked, false);
bcm4377_queue_rebind(bcm4377, "power lost in the sleep");
return 0;
}

if (bcm4377->quiesced) {
iowrite32(BCM4377_BAR0_SLEEP_CONTROL_UNQUIESCE,
bcm4377->bar0 + BCM4377_BAR0_SLEEP_CONTROL);
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/apple/apple_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1991,6 +1991,9 @@ static int apple_platform_suspend(struct device *dev)
if (apple && apple->dark_held)
return 0;

if (pm_suspend_via_firmware())
dcp_t6041_s2r_all(false);

if (apple && !apple->aborted) {
apple->s2r_skipped = apple_drm_firmware_stopped(apple);
if (!apple->s2r_skipped)
Expand Down Expand Up @@ -2036,6 +2039,9 @@ static int apple_platform_resume(struct device *dev)
{
struct apple_drm_private *apple = dev_get_drvdata(dev);

/* Nothing if this suspend never took the display down. */
dcp_t6041_s2r_all(true);

if (!apple || apple->aborted || apple->s2r_skipped)
return 0;

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/apple/dcp-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ struct apple_dcp {
*/
bool ext_failsafe;
bool ext_dead;
/* T6041 S2R: this external DCP's firmware stop ran in a sleep of this boot */
bool t6041_ext_seen;
/*
* A T6030 external processor in the main DRM device: the kernel starts
* its firmware on first use, its modes come from the attached display.
Expand Down
Loading
Loading