Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
1db416f
dt-bindings: chosen: document the aura hibernation layout
fbalazsy Nov 12, 2026
0cc237d
PM: hibernate: Make the image signature handling durable
fbalazsy Nov 21, 2026
4161a74
PM: hibernate: Tell drivers whether a restore went through a boot
fbalazsy Nov 21, 2026
f47a2e1
PM: hibernate: Let platform code decide whether hibernation is refused
fbalazsy Nov 21, 2026
80c547a
PM: hibernate: Clean the loaded image to the PoC on arm64
fbalazsy Nov 21, 2026
d704544
arm64: hibernate: Clean copied pages to the PoC
fbalazsy Nov 21, 2026
b894c79
arm64: hibernate: Add platform hooks for nosave ranges and the boot l…
fbalazsy Nov 21, 2026
49f67dd
arm64: smp: spin-table: Park secondaries outside the image across hib…
fbalazsy Nov 21, 2026
679355f
KVM: arm64: timer: Keep guest counters when the counter restarts in a…
fbalazsy Nov 21, 2026
aea302f
soc: apple: rtkit: Hand running sessions over to a resumed kernel
fbalazsy Nov 21, 2026
9a0adc6
soc: apple: rtkit-helper: Re-adopt a session after a resume from disk
fbalazsy Nov 21, 2026
59b1dd6
soc: apple: Allow hibernation under aura's fixed boot layout
fbalazsy Nov 21, 2026
c0b8c6d
soc: apple: pmp: rebuild the firmware session after a resume from disk
fbalazsy Nov 21, 2026
72408f6
iommu: apple-dart: re-import locked firmware roots after a resume fro…
fbalazsy Nov 21, 2026
7da17e5
mfd: macsmc: start a new SMC session after a resume from disk
fbalazsy Nov 21, 2026
2e0637b
power: reset: macsmc-reboot: give an accepted power-off time to take …
fbalazsy Nov 3, 2026
dfdcdea
rtc: apple-pmu: let hibernation through the prepare step
fbalazsy Nov 20, 2026
7924296
cpufreq: apple-soc: restart the fast die-temperature wait when the PM…
fbalazsy Nov 3, 2026
b4be361
nvme-apple: support hibernation on post-M4 ANS
fbalazsy Nov 21, 2026
5c7a72f
accel/ane: H16: cycle the engine across hibernation as across suspend
fbalazsy Nov 20, 2026
1625924
drm: apple: Suspend the DRM state for hibernation too
fbalazsy Nov 21, 2026
902b79e
drm: apple: track piodma mappings on desktop 26.x firmware too
fbalazsy Nov 3, 2026
42e7768
drm: apple: dptxep: report link faults as warnings only with a sink a…
fbalazsy Nov 3, 2026
c2efa60
drm/apple: dcp: restart the display firmware in place after a resume …
fbalazsy Nov 3, 2026
06973cb
drm/apple: bound kernel retrains of an active CRTC after hotplug
fbalazsy Nov 3, 2026
8fdc256
drm/apple: take the T604x displays down for hibernation as for a sleep
fbalazsy Nov 21, 2026
a682f9f
phy: apple: t6040: keep the PHY state in a restore without a boot
fbalazsy Nov 21, 2026
71afd9c
PM: hibernate: Clear a latched wakeup before the test_resume restore
fbalazsy Nov 23, 2026
34e4080
PM: hibernate: Free the image's swap pages when a test_resume restore…
fbalazsy Nov 23, 2026
10ac8ba
wifi: brcmfmac: pcie: probe the chip again in a restore from hibernation
fbalazsy Nov 23, 2026
3e1f4e7
Bluetooth: hci_bcm4377: Quiesce for hibernation and rebind on restore
fbalazsy Nov 23, 2026
2ae0ad9
arm64: hibernate: Run the exit code inside the CTXR execute window
fbalazsy Nov 23, 2026
2ef4943
usb: xhci: Skip the ep0 max packet check on a slot that is only enabled
fbalazsy Nov 23, 2026
2a5c325
arm64: smp: spin-table: Log the hibernation pen at debug level
fbalazsy Nov 23, 2026
885c832
drm/apple: dcp: Log the hibernation steps at debug level
fbalazsy Nov 23, 2026
09ec99c
iommu: apple-dart: Log the hibernation restore at debug level
fbalazsy Nov 23, 2026
1c31733
mfd: macsmc: Log the hand-over for the restored kernel at debug level
fbalazsy Nov 23, 2026
0c0ffbe
soc: apple: Log the co-processor restore steps at debug level
fbalazsy Nov 23, 2026
901794e
MAINTAINERS: Add the aura hibernation files
fbalazsy Nov 23, 2026
6aecea1
media: apple: isp: Start restartable firmware again after hibernation
fbalazsy Nov 23, 2026
eb0aa1d
soc: apple: aura-hibernate: Drop the helpers no driver uses
fbalazsy Nov 23, 2026
cf9b0e4
soc: apple: sleep: Take this boot's S2R mailbox after a resume from disk
fbalazsy Nov 23, 2026
4b957d6
PM: hibernate: Clean each image page to the PoC as it is loaded
fbalazsy Nov 23, 2026
51027bf
arm64: hibernate: Call the boot loader by its role in a comment
fbalazsy Nov 23, 2026
445cd15
selftests: asahi: Follow the hibernation changes in the host tests
fbalazsy Nov 28, 2026
1df3f53
soc: apple: aura-hibernate: Count unmapped memory as kept out of the …
fbalazsy Nov 29, 2026
ae48ee4
Bluetooth: hci_bcm4377: Log the rebind after a hibernation restore as…
fbalazsy Nov 29, 2026
494754d
PM: hibernate: Report the platform block after all late initcalls
fbalazsy Nov 29, 2026
00a87c5
dt-bindings: chosen: document aurora,s2r-mailbox
fbalazsy Nov 29, 2026
d30a10c
iommu/apple-dart: keep off a deferred display DART across a hibernati…
fbalazsy Nov 30, 2026
bece695
drm/apple: defer a DCP's DART restore to its firmware restart across …
fbalazsy Nov 30, 2026
0120307
pmdomain: apple: resync power domains on a hibernation restore
fbalazsy Nov 30, 2026
a59ddfa
iommu/apple-dart: test: take the T8132 fw-mirror DART off the stack
fbalazsy Dec 1, 2026
81b16c9
apple-sep/hibe: type the op0/op1 request words
fbalazsy Dec 1, 2026
b71a1bd
apple-sep/hibe: hold an OolPair for the hibernation endpoint
fbalazsy Dec 1, 2026
9fa5d55
dt-bindings: soc: apple: document apple,sep-boot-timeout-ms
fbalazsy Dec 1, 2026
bd56b82
apple-sep: hibernation sleep-type and a DT-described boot timeout
fbalazsy Dec 1, 2026
5958764
apple-sep/hibe: op0/op1 exchange and the prepare/resume requests
fbalazsy Dec 1, 2026
28862ac
soc: apple-sep: re-boot the enclave across a hibernation resume
fbalazsy Dec 1, 2026
8be180d
drm/asahi: contain the GPU across a hibernation restore
fbalazsy Dec 1, 2026
8df0d13
pmdomain: core: Run the thaw and restore noirq callbacks of genpd dev…
fbalazsy Dec 1, 2026
db09d81
spmi: apple: Restore the interrupt enables after a hibernation restore
fbalazsy Dec 1, 2026
df7c969
usb: dwc3: apple: Stop the host across a hibernation
fbalazsy Dec 1, 2026
f0d3a89
pinctrl: apple: Put the pins back after a hibernation restore
fbalazsy Dec 1, 2026
d19f273
irqchip/apple-aic: Keep the interrupt setup across a hibernation
fbalazsy Dec 1, 2026
be53318
iommu: apple-dart: Re-import every locked root after a hibernation re…
fbalazsy Dec 1, 2026
3570cba
drm/apple: dcp: Bring the T6040 external outputs back after a hiberna…
fbalazsy Dec 1, 2026
a9e2f46
soc: apple-sep: Start the diag attach and ready times again at each bind
fbalazsy Dec 1, 2026
f4c1303
soc: apple-sep: Bind the driver again after a hibernation restore
fbalazsy Dec 1, 2026
c19904e
nvme: apple: Disable the T6040 controller at a panic
fbalazsy Dec 1, 2026
2d63a0c
soc: apple: sleep: Find the T6040 power controllers for an engine reset
fbalazsy Dec 1, 2026
cce49c0
dmaengine: apple-sio: Stop and boot the firmware across a hibernation
fbalazsy Dec 1, 2026
4b3bf67
watchdog: apple: Drain a WD2 disarm before re-programming CUR_TIME
fbalazsy Dec 1, 2026
03b7a6b
soc: apple: sleep: Look up the engine-reset power block from SoC data
fbalazsy Dec 1, 2026
6667e6d
drm/apple: dcp: Drive external-link restart from display-power match …
fbalazsy Dec 1, 2026
b2e962e
drm/apple: dcp: Give the hibernation relink path generic names
fbalazsy Dec 1, 2026
be10c35
drm/apple: dcp: Take the start ready-wait from match data
fbalazsy Dec 1, 2026
ccc1fb8
drm/asahi: Reboot G17 firmware after a hibernation restore
fbalazsy Dec 2, 2026
fdd44fd
drm/asahi: Clear untracked kernel-dynamic PTEs after reserved-table m…
fbalazsy Dec 2, 2026
e285d57
soc: apple: sleep: Map an unnamed coprocessor register range for engi…
fbalazsy Dec 2, 2026
f45d7df
watchdog: apple: arm WD2 simple-reconfig as a hibernation-restore bac…
fbalazsy Dec 2, 2026
1b91d0e
watchdog: apple: arm the WD2 backstop on hibernation entry too
fbalazsy Dec 2, 2026
b1473c6
watchdog: apple: use the SMC AP deadline on wdt-version 2
fbalazsy Dec 2, 2026
1138b64
PM: hibernation: defer probing while resume-from-disk is pending
fbalazsy Dec 2, 2026
cea6f9d
PM: hibernation: clear resume-pending if software_resume cannot run
fbalazsy Dec 2, 2026
561b67b
iommu: apple-dart: adopt locked roots after a hibernation restore
fbalazsy Dec 2, 2026
e94e9a3
drm/apple, soc/apple: restore deferred DARTs at hibernation power-up
fbalazsy Dec 2, 2026
00adb57
ASoC: tas2764: treat a hibernation restore as an expected power-on
fbalazsy Dec 2, 2026
1024711
PM: hibernation: report restore-phase timings
fbalazsy Dec 2, 2026
308931a
watchdog: apple: hand the SMC AP deadline back after a hibernation re…
fbalazsy Dec 2, 2026
8c78be1
usb: dwc3-apple: resume the USB tree in order after a hibernation res…
fbalazsy Dec 2, 2026
3e4189d
net: usb: r8152: stop resubmitting rx on -ESHUTDOWN
fbalazsy Dec 2, 2026
f1aa343
drm/asahi: copy the kernel-window tables in one pass after a hibernat…
fbalazsy Dec 2, 2026
5af7ff8
PM: hibernation: report image write and read times
fbalazsy Dec 2, 2026
94666ae
PM: hibernate: wait for the transition lock when setting the compressor
fbalazsy Dec 3, 2026
a6cabc5
soc: apple: aop: Start the co-processor again after a resume from disk
fbalazsy Dec 3, 2026
e2528d5
watchdog: apple: disarm the hibernation backstop when the system keep…
fbalazsy Dec 3, 2026
bbf6eaf
Merge branch 'main' into t6040-hibernation
fbalazsy Dec 3, 2026
fbbb637
PM: hibernate: take the reset backstop from the platform
fbalazsy Dec 3, 2026
2e90d66
drm/asahi: wrap a long safety comment in the window-table copy
fbalazsy Dec 3, 2026
71b0ba3
soc: apple: aop: wrap three long lines in the resume-from-disk path
fbalazsy Dec 3, 2026
33502d5
iommu: apple-dart: join a condition split against its parenthesis
fbalazsy Dec 3, 2026
2867c10
drm/asahi: g17: leave the firmware running across the hibernation image
fbalazsy Dec 3, 2026
fb2029d
dmaengine: apple-sio: leave the firmware running across the hibernati…
fbalazsy Dec 3, 2026
e18a631
Merge branch 'main' into t6040-hibernation
fbalazsy Dec 3, 2026
bd712da
dt-bindings: watchdog: apple,wdt: Add the SMC AP deadline register
fbalazsy Dec 3, 2026
f30bd93
arm64: dts: apple: t604x: Describe the watchdog's reconfig and deadli…
fbalazsy Dec 3, 2026
ffed007
watchdog: apple: Take the reconfig and deadline registers from the DT
fbalazsy Dec 3, 2026
e01cfe9
watchdog: apple: Keep the restore backstop running only across a hibe…
fbalazsy Dec 3, 2026
2fd67f2
selftests: asahi: Follow the later hibernation changes in the host tests
fbalazsy Dec 3, 2026
c492ab2
dmaengine: apple-sio: boot the firmware after a restore only if staged
fbalazsy Dec 3, 2026
7a11806
net: usb: r8152: treat -ESHUTDOWN like -ENODEV on tx and interrupt re…
fbalazsy Dec 3, 2026
77aea2c
soc: apple: dockchannel, HID: dockchannel: restore IRQ masks and guar…
m0d16l14n1 Dec 2, 2026
c6f9db9
soc/apple: rtkit: restore mailbox hardware enables on reinit
m0d16l14n1 Dec 3, 2026
5f4a9fa
selftests: asahi: rtkit-oslog: Stub apple_mbox_restore()
fbalazsy Dec 3, 2026
e7d08ba
usb: hub: stop resetting a port once its host controller is gone
fbalazsy Dec 3, 2026
8d5d52f
HID: dockchannel: resynchronise the receive ring after a restore from…
fbalazsy Dec 3, 2026
37e46a2
irqchip/apple-aic: restore global config and boot CPU FIQ on cold hib…
m0d16l14n1 Dec 2, 2026
26cff0f
soc: apple: restore cluster power gates and MCC cache allocation afte…
m0d16l14n1 Dec 2, 2026
e5b2160
cpufreq/power: apple: restore DVFS state and battery charge limit aft…
m0d16l14n1 Dec 2, 2026
9b54770
PM: apple: add system sleep and hibernation restore for I2C, SPI, and…
m0d16l14n1 Dec 2, 2026
a3b8732
PCI: apple-msi: restore MSI doorbell and map after cold hibernation
m0d16l14n1 Dec 2, 2026
46c4d3c
thunderbolt: apple: clear keep-alive quirks on cold hibernation restore
m0d16l14n1 Dec 2, 2026
c502a77
soc: apple-sep: trigger hibernation rebind only on cold restore
m0d16l14n1 Dec 2, 2026
21b58c4
dmaengine: apple-admac: mark channels lost on cold hibernation restore
m0d16l14n1 Dec 2, 2026
6730a21
clk: apple-nco: save and restore channel state across hibernation
m0d16l14n1 Dec 2, 2026
e6bf32c
drm/apple: dcp: pause live-session DCP on freeze and preserve it acro…
m0d16l14n1 Dec 2, 2026
0393d67
accel/ane: H17: cycle the engine across hibernation as across suspend
m0d16l14n1 Dec 2, 2026
586d973
usb: typec: tipd: sn201202x: refresh LDCM and wake controller on hibe…
m0d16l14n1 Dec 2, 2026
860e890
pmdomain: apple: pmc: restore voter enables and floors after hibernation
m0d16l14n1 Dec 2, 2026
23f061f
ASoC: codecs: cs42l84, tas2764: restore codec and amp state after col…
m0d16l14n1 Dec 2, 2026
d56d797
ASoC: apple: mca: save and restore active clusters across hibernation
m0d16l14n1 Dec 2, 2026
1c1f352
soc/apple: pmp: replay report requests on cold hibernation restore
m0d16l14n1 Dec 3, 2026
ee3faca
drm/apple: avoid double suspend in hibernation poweroff and harden DC…
m0d16l14n1 Dec 2, 2026
c80d782
drm/asahi: g17: keep client VMs across a cold hibernation restore
fbalazsy Dec 4, 2026
7575b8e
PM: hibernate: Keep the image's swap pages until its signature is gone
fbalazsy Dec 4, 2026
60f0b4f
Merge branch 'main' into t6040-hibernation
fbalazsy Dec 4, 2026
fe23d01
drm/asahi: drop leftover no-op error closures on the hibernation paths
fbalazsy Dec 4, 2026
d806fb1
tools/asahi: hibernate-signature-tests: add SPDX tag and MAINTAINERS …
fbalazsy Dec 4, 2026
e5528b6
tools/asahi: apple-wdt-tests: expect the hibernation backstop on WD1-…
fbalazsy Dec 4, 2026
c06cbf3
Merge branch 'main' into t6040-hibernation
fbalazsy Dec 4, 2026
ebfde65
Merge branch 'main' into t6040-hibernation
fbalazsy Dec 4, 2026
1d642b9
Merge branch 'main' into t6040-hibernation
RyanTheTide Dec 4, 2026
f489a2f
tools/aurora-sep: give the diag host shim atomic64_set
RyanTheTide Dec 5, 2026
1f68426
Merge branch 'main' into t6040-hibernation
RyanTheTide Dec 5, 2026
3ae591c
Merge branch 'main' into t6040-hibernation
fbalazsy Dec 5, 2026
0a45b13
Fix KUnit builds and post-merge compute shared helper
fbalazsy Dec 5, 2026
86dd783
Merge branch 'main' (0b40c0518e62) into t6040-hibernation
fbalazsy Dec 5, 2026
eac0a07
Merge branch 'main' of https://github.com/aurora-silicon/linux into t…
fbalazsy Dec 6, 2026
2cb14af
soc: apple: align host tests, KUnit fixtures, and SEP hibernation log…
fbalazsy Dec 6, 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
7 changes: 5 additions & 2 deletions Documentation/arch/arm64/ctxr-execmem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ kexec and crash kernels
with a warning when a window is active.

Hibernate
Resume runs from a ``trans_pgd`` page outside the window. This is unchanged
and untested under a window.
A boot CPU that a system sleep restarted at its reset vector is confined
like the secondaries, so the code that writes the image back and jumps to
the restored kernel runs from a nosave page of the kernel image, inside the
window, instead of an ordinary page. The image's kernel must have run at the
same physical address; a restore of an image from elsewhere is refused.

Verifying confinement
=====================
Expand Down
64 changes: 64 additions & 0 deletions Documentation/devicetree/bindings/chosen/aura,hibernate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/chosen/aura,hibernate.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Memory layout a boot object keeps the same on every boot

maintainers:
- František Balázsy <frantisekbalazsy@gmail.com>

description: |
A hibernation image puts every saved page back into the frame it was taken
from, so the boot that resumes an image has to give the kernel the same RAM,
and keep the same ranges from it, as the boot that wrote the image. On Apple
silicon the boot firmware loads the boot object at an address that changes
from boot to boot, and what the boot object keeps alive after the hand-off
moves with it. A boot object that instead keeps everything from the start of
RAM up to a fixed end from the kernel, at the same addresses on every boot,
says so with aura,hibernate-layout. Without it the kernel neither hibernates
nor resumes.

The boot firmware still places some firmware segments anew on every boot,
inside that range, and a kernel restored from an image holds the device tree
of the boot that wrote the image. The boot object therefore puts the device
tree of every boot at one address inside the range, given in
aura,hibernate-dt. The image does not contain that memory, so the restored
kernel reads there what the resuming boot placed.

The properties are named after aura, the boot loader that defined them and
whose released versions publish them.

select:
properties:
$nodename:
const: chosen
required:
- $nodename

properties:
$nodename:
const: chosen

aura,hibernate-layout:
$ref: /schemas/types.yaml#/definitions/uint64-array
description:
The range of RAM that is kept from the kernel and laid out the same on
every boot.
items:
- description: Physical address of the start of RAM.
- description: Physical address of the end of the range, exclusive.

aura,hibernate-dt:
$ref: /schemas/types.yaml#/definitions/uint64
description:
Physical address, inside the range of aura,hibernate-layout, of the
device tree the kernel is started with. The kernel reads at most 2 MiB
there.

dependencies:
aura,hibernate-dt: [ 'aura,hibernate-layout' ]

additionalProperties: true
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/chosen/aurora,s2r-mailbox.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Suspend-to-RAM mailbox of the boot object

maintainers:
- Diljit Singh <hey@djdev.me>

description: |
On Apple silicon the boot object stays resident across a suspend-to-RAM and
owns the handshake that wakes the system. It tells the kernel where its
mailbox is in /chosen/aurora,s2r-mailbox: the kernel hands the wake there and
the boot object reads it on resume. The same object parks the "spin-table"
CPUs, so a kernel given this mailbox gets the spin-table CPU enable method.
The mailbox moves with the boot object on every boot, so a kernel restored
from a hibernation image reads this boot's address here, not the one the
image was written with.

select:
properties:
$nodename:
const: chosen
required:
- $nodename

properties:
$nodename:
const: chosen

aurora,s2r-mailbox:
$ref: /schemas/types.yaml#/definitions/uint64
description:
Physical address of the boot object's suspend-to-RAM mailbox. The kernel
checks a magic there before it uses the mailbox.

additionalProperties: true
...
9 changes: 9 additions & 0 deletions Documentation/devicetree/bindings/soc/apple/apple,sep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ properties:
description:
The SEP firmware carveout, added by the bootloader.

apple,sep-boot-timeout-ms:
description:
How long, in milliseconds, the enclave may take to finish booting its
firmware before the operating system gives up and leaves it unused. It
bounds both the first boot and a re-boot after a hibernation resume.
Depends on the SoC and the signed firmware; when absent the driver uses
a built-in default.
default: 5000

iboot-manifest:
$ref: /schemas/types.yaml#/definitions/uint8-array
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ description:
properties:
compatible:
enum:
- apple,t6040-aop
- apple,t6041-aop
- apple,t8132-aop

Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ patternProperties:
description: Atmel Corporation
"^auo,.*":
description: AU Optronics Corporation
"^aura,.*":
description: aura boot loader for Apple silicon
"^aurora,.*":
description: Aurora Silicon
"^auvidea,.*":
Expand Down
5 changes: 5 additions & 0 deletions Documentation/devicetree/bindings/watchdog/apple,wdt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,17 @@ properties:
items:
- description: Watchdog timer registers
- description: Simple-reconfig routing register
- description:
SMC AP deadline register. Where present, the SMC resets the AP
once its uptime passes the programmed deadline; this replaces the
WD2 route through the simple-reconfig register.

reg-names:
minItems: 1
items:
- const: wdt
- const: reconfig
- const: deadline

clocks:
maxItems: 1
Expand Down
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2104,7 +2104,9 @@ F: include/linux/mt7932.h
F: include/linux/soc/apple/pmp-report.h
F: Documentation/devicetree/bindings/chosen/apple,dcp-rtkit-quiesced.yaml
F: Documentation/devicetree/bindings/chosen/apple,dcp-rtkit-running.yaml
F: Documentation/devicetree/bindings/chosen/aura,hibernate.yaml
F: Documentation/devicetree/bindings/chosen/aurora,ctxr-exec-window.yaml
F: Documentation/devicetree/bindings/chosen/aurora,s2r-mailbox.yaml
F: Documentation/devicetree/bindings/display/apple,dcp.yaml
F: Documentation/devicetree/bindings/display/apple,display-subsystem.yaml
F: Documentation/devicetree/bindings/display/apple,t8140-display-power.yaml
Expand Down Expand Up @@ -2148,14 +2150,18 @@ F: drivers/pci/controller/pcie-apple-t8140-bootstrap*
F: drivers/phy/apple/atc-j700-dp.h
F: drivers/rtc/rtc-apple-pmu.c
F: drivers/soc/apple/aop.rs
F: drivers/soc/apple/aura-hibernate.c
F: drivers/soc/apple/mcc.c
F: drivers/soc/apple/rtkit-hib-handoff.c
F: drivers/soc/apple/sleep*.c
F: drivers/tty/serial/apple_dockchannel*
F: include/linux/soc/apple/aura-hibernate.h
F: include/linux/soc/apple/pci-apple-piodma.h
F: include/linux/soc/apple/sleep.h
F: rust/kernel/iio/common/aop_sensors.rs
F: rust/kernel/soc/apple/aop.rs
F: sound/soc/apple/aop_t8140.rs
F: tools/asahi/hibernate-signature-tests.py
F: tools/asahi/mt7932*
F: tools/testing/apple/
F: tools/testing/kunit/configs/apple_firmware.config
Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2706,6 +2706,10 @@ config ARCH_HIBERNATION_HEADER
def_bool y
depends on HIBERNATION

config ARCH_HIBERNATION_CLEAN_IMAGE
def_bool y
depends on HIBERNATION

config ARCH_SUSPEND_POSSIBLE
def_bool y

Expand Down
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/apple/t6040.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
};

&aop {
compatible = "apple,t6040-aop";
/* The calibration properties come from the bootloader. */
aop_accel: accel {
compatible = "apple,t6041-aop-accel", "apple,aop-accel";
Expand Down
5 changes: 4 additions & 1 deletion arch/arm64/boot/dts/apple/t604x.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,10 @@
*/
wdt: watchdog@50836c000 {
compatible = "apple,t6041-wdt", "apple,t8103-wdt";
reg = <0x5 0x0836c000 0x0 0x4000>;
reg = <0x5 0x0836c000 0x0 0x4000>,
<0x5 0x0833002c 0x0 0x4>,
<0x5 0x08330008 0x0 0x4>;
reg-names = "wdt", "reconfig", "deadline";
clocks = <&clkref>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 827 IRQ_TYPE_LEVEL_HIGH>;
Expand Down
23 changes: 23 additions & 0 deletions arch/arm64/include/asm/cpu_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ struct cpumask;

#ifdef CONFIG_HOTPLUG_CPU
int spin_table_set_power_ops(const struct spin_table_power_ops *ops);
#ifdef CONFIG_HIBERNATION
extern char spin_table_hibernate_pen[];
extern const struct cpu_operations smp_rvbar_spin_table_ops;
int spin_table_hibernate_pen_begin(phys_addr_t image_ttbr1, int primary);
void spin_table_hibernate_pen_end(bool frozen);
void spin_table_hibernate_restored(void);
bool spin_table_hibernate_cpus_stuck(void);
#endif
int spin_table_hold_parked(void);
void spin_table_unhold_parked(void);
int spin_table_stop_parked(void);
Expand Down Expand Up @@ -117,6 +125,21 @@ static inline bool spin_table_cpus_stuck(void)
}
#endif

#if !defined(CONFIG_HOTPLUG_CPU) || !defined(CONFIG_HIBERNATION)
static inline int spin_table_hibernate_pen_begin(phys_addr_t image_ttbr1, int primary)
{
return 0;
}

static inline void spin_table_hibernate_pen_end(bool frozen) {}
static inline void spin_table_hibernate_restored(void) {}

static inline bool spin_table_hibernate_cpus_stuck(void)
{
return false;
}
#endif

int __init init_cpu_ops(int cpu);
extern const struct cpu_operations *get_cpu_ops(int cpu);

Expand Down
32 changes: 32 additions & 0 deletions arch/arm64/include/asm/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,38 @@ int swsusp_arch_resume(void);
int arch_hibernation_header_save(void *addr, unsigned int max_size);
int arch_hibernation_header_restore(void *addr);

/**
* struct arm64_hibernate_layout - What a platform adds to the boot layout check.
* @ex: Ranges that this boot keeps out of the image and that the layout check
* leaves out of the memory it compares, in ascending order.
* @nex: Number of valid entries in @ex.
* @have_base: Whether CPU release addresses are compared as offsets from @base.
* @base: Base address for the release addresses, if @have_base.
*/
struct arm64_hibernate_layout {
u64 ex[2][2];
int nex;
bool have_base;
u64 base;
};

/**
* struct arm64_hibernate_platform - Platform hooks of arm64 hibernation.
* @pfn_nosave: Whether the platform keeps page frame @pfn out of the image.
* @layout: Mix the platform's boot facts into the layout cookie in @h with
* arm64_hibernate_layout_mix(), fill @lay, and return the new hash. The
* cookie is stored with an image and compared before it is restored: the
* boot that resumes an image must give the kernel the layout of the boot
* that wrote it.
*/
struct arm64_hibernate_platform {
bool (*pfn_nosave)(unsigned long pfn);
u64 (*layout)(u64 h, struct arm64_hibernate_layout *lay);
};

void arm64_hibernate_set_platform(const struct arm64_hibernate_platform *platform);
u64 arm64_hibernate_layout_mix(u64 h, const void *p, size_t len);

/* Used to resume on the CPU we hibernated on */
int hibernate_resume_nonboot_cpu_disable(void);

Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ obj-$(CONFIG_ARM64_ACPI_PARKING_PROTOCOL) += acpi_parking_protocol.o
obj-$(CONFIG_PARAVIRT) += paravirt.o
obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate-asm.o
ifdef CONFIG_HOTPLUG_CPU
obj-$(CONFIG_HIBERNATION) += smp_spin_table_pen.o
endif
obj-$(CONFIG_ELF_CORE) += elfcore.o
obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o relocate_kernel.o \
cpu-reset.o
Expand Down
11 changes: 8 additions & 3 deletions arch/arm64/kernel/hibernate-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,24 @@ SYM_CODE_START(swsusp_arch_suspend_exit)
copy_page x0, x1, x2, x3, x4, x5, x6, x7, x8, x9

add x1, x10, #PAGE_SIZE
/* Clean the copied page to PoU - based on caches_clean_inval_pou() */
/*
* Clean the copied page to PoC, not only PoU: non-coherent DMA
* masters (the coprocessors of some SoCs) read the restored pages
* from DRAM. Clean+invalidate to PoC also covers what
* caches_clean_inval_pou() did for the I-side.
*/
raw_dcache_line_size x2, x3
sub x3, x2, #1
bic x4, x10, x3
2: /* clean D line / unified line */
alternative_insn "dc cvau, x4", "dc civac, x4", ARM64_WORKAROUND_CLEAN_CACHE
dc civac, x4
add x4, x4, x2
cmp x4, x1
b.lo 2b

ldr x19, [x19, #HIBERN_PBE_NEXT]
cbnz x19, 1b
dsb ish /* wait for PoU cleaning to finish */
dsb ish /* wait for PoC cleaning to finish */

/* switch to the restored kernels page tables */
break_before_make_ttbr_switch x25, x21, x6, x8
Expand Down
Loading
Loading