Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a0d642c
thunderbolt: apple: tear down T8112 ACIO routers for deep sleep
rjianwei Nov 26, 2026
a3d6716
arm64: dts: apple: t8112: add system sleep node and enable on J413
rjianwei Nov 26, 2026
b32895f
soc: apple: sleep: add T8112 dry-run profile and KUnit coverage
rjianwei Nov 26, 2026
46f535a
soc: apple: pmp: add T8112 SRAM backup fallback config
rjianwei Nov 26, 2026
e827507
soc: apple: sleep: wire T8112 PMU boot-stage and PMGR wake order
rjianwei Nov 26, 2026
31ee0d9
soc: apple: sleep: add T8112 HID4/EHID4 cache clean and CYC_OVRD deep…
rjianwei Nov 26, 2026
b95dc26
arm64: dts: apple: t8112: add power-domains to sep node for S2R
rjianwei Nov 26, 2026
163865d
soc: apple: sleep: wire verified T8112 pwrgate, cllt, cluster, and co…
rjianwei Nov 26, 2026
dee5df4
soc: apple: sleep: implement T8112 prepare, undo, ATC-off, commit, an…
rjianwei Nov 26, 2026
9f6478c
soc: apple: sleep: wire T8112 display-off, MCC, clk-mux, TVM, and DCS…
rjianwei Nov 26, 2026
60ab442
soc: apple: sleep: wire T8112 wake sources and drop PCIe-ANS gate
rjianwei Nov 26, 2026
f77b6e4
soc: apple: sleep: clean T8112 RAM, kernel image, page tables, and WF…
rjianwei Nov 26, 2026
65f4a9b
irqchip/apple-aic: enable firmware suspend save/restore on T8112
rjianwei Nov 27, 2026
303fadb
mfd: macsmc: enable deferred gen-1 sleep notice on T8112
rjianwei Nov 27, 2026
51ca820
soc: apple: sleep: complete T8112 hardware commit and wake sequences
rjianwei Nov 27, 2026
dd71217
drm/apple: dcp: add T8112 S2R display power and DART layout
rjianwei Nov 27, 2026
a23721b
soc: apple: sleep: fix T8112 SLC write-back and L2 cache clean across…
satchlj Nov 28, 2026
8aa6d28
iommu/apple-dart: save/restore T8112 display DART state across S2R
satchlj Nov 28, 2026
3d93877
soc: apple: sleep: log raw T8112 wake_status and wake_armed words on …
rjianwei Nov 28, 2026
7eb3ced
soc: apple: sleep: fix T8112 wake controller, DCS stepping, and GPU S…
satchlj Nov 29, 2026
e5c3ab7
soc: apple: sleep: only panic on GFX power-off timeout when GPU drive…
rjianwei Nov 29, 2026
dfcee6d
dt-bindings: describe the T8112 display power node and GPU power-cont…
satchlj Nov 29, 2026
c5a4237
arm64: dts: apple: t8112: enable system sleep on every T8112 board
satchlj Nov 29, 2026
cdbecbe
Merge branch 'main' into satchlj/t8112-s2r
RyanTheTide Dec 1, 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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ properties:
- items:
- const: apple,t6040-display-power
- const: apple,t6041-display-power
- items:
- const: apple,t8112-display-power
- const: apple,t8103-display-power

reg:
minItems: 1
Expand Down Expand Up @@ -116,7 +119,8 @@ allOf:
- if:
properties:
compatible:
const: apple,t8103-display-power
contains:
const: apple,t8103-display-power
then:
# T8103's display has no retention words and its PMC no count of the coprocessors.
properties:
Expand Down
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/gpu/apple,agx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,22 @@ properties:
Relative frequency of the populated A ladder above the base state,
in percent, followed by zeros for the five unused selectors.

apple,pwr-filter-time-constant:
$ref: /schemas/types.yaml#/definitions/uint32
description: Time constant of the GPU power controller's input filter, from the ADT

apple,pwr-integral-gain:
$ref: /schemas/types.yaml#/definitions/uint32
description: Integral gain of the GPU power controller, an IEEE 754 single from the ADT

apple,pwr-integral-min-clamp:
$ref: /schemas/types.yaml#/definitions/uint32
description: Lower clamp of the GPU power controller's integral term, from the ADT

apple,pwr-proportional-gain:
$ref: /schemas/types.yaml#/definitions/uint32
description: Proportional gain of the GPU power controller, an IEEE 754 single from the ADT

apple,core-leak-coef:
$ref: /schemas/types.yaml#/definitions/uint32-array
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ properties:
compatible:
enum:
- apple,t8103-sleep
- apple,t8112-sleep
- apple,t8122-sleep
- apple,t8132-sleep
- apple,t8140-sleep
Expand Down Expand Up @@ -129,6 +130,37 @@ allOf:
- const: cpu-start
- const: wdt
- const: spmi
- if:
properties:
compatible:
contains:
const: apple,t8112-sleep
then:
required:
- apple,pinctrl
properties:
reg:
minItems: 17
maxItems: 17
reg-names:
items:
- const: ps
- const: pwrgate
- const: cpu-start
- const: cllt
- const: cluster
- const: commit
- const: wdt
- const: spmi
- const: wake
- const: ps-aon
- const: clk-mux
- const: mcc-ctl
- const: mcc-a
- const: mcc-b
- const: mcc-c
- const: mcc-d
- const: mcc-e
- if:
properties:
compatible:
Expand Down
5 changes: 5 additions & 0 deletions arch/arm64/boot/dts/apple/t8112-j413.dts
Original file line number Diff line number Diff line change
Expand Up @@ -596,3 +596,8 @@
&hpm1 {
apple,sleep-ssps;
};

/* The SoC's wake sources plus the MTP's (keyboard and trackpad). */
&sleep {
apple,wake-enable = <14 26 27 44 51 53 54 58 69 73 81 86 147 154 155 156 157 229 231 248>;
};
48 changes: 48 additions & 0 deletions arch/arm64/boot/dts/apple/t8112.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,11 @@
apple,ppm-filter-time-constant-ms = <34>;
apple,ppm-ki = <205.0>;
apple,ppm-kp = <0.75>;
apple,pwr-filter-time-constant = <313>;
apple,pwr-integral-gain = <0.0202129>;
apple,pwr-integral-min-clamp = <0>;
apple,pwr-min-duty-cycle = <40>;
apple,pwr-proportional-gain = <5.2831855>;
apple,core-leak-coef = <1920.0>;
apple,sram-leak-coef = <74.0>;
};
Expand Down Expand Up @@ -792,6 +796,7 @@

dcp: dcp@231c00000 {
compatible = "apple,t8112-dcp", "apple,dcp";
apple,display-power = <&dcp_power>;
mboxes = <&dcp_mbox>;
mbox-names = "mbox";
iommus = <&dcp_dart 5 0x8 0x00000000 0x7 0xffff0000>;
Expand Down Expand Up @@ -1311,6 +1316,47 @@
/* child nodes are added in t8103-pmgr.dtsi */
};

dcp_power: display-power@23b700000 {
compatible = "apple,t8112-display-power", "apple,t8103-display-power";
reg = <0x2 0x3b700000 0x0 0x14000>;
reg-names = "ps";
};

sleep: sleep@23b700000 {
compatible = "apple,t8112-sleep";
reg = <0x2 0x3b700000 0x0 0x14000>,
<0x2 0x3b724000 0x0 0x4000>,
<0x2 0x3b734000 0x0 0x10>,
<0x2 0x3b760000 0x0 0x4000>,
<0x2 0x3b780000 0x0 0x8>,
<0x2 0x3d2d4000 0x0 0x4>,
<0x2 0x3d2b0000 0x0 0x30>,
<0x2 0x3d714000 0x0 0x100>,
<0x2 0x3d004000 0x0 0x48>,
<0x2 0x3d280000 0x0 0x4000>,
<0x2 0x3b000000 0x0 0x70000>,
<0x2 0x0001c000 0x0 0x4000>,
<0x2 0x00024000 0x0 0x1000>,
<0x2 0x00064000 0x0 0x1000>,
<0x2 0x000a4000 0x0 0x1000>,
<0x2 0x000e4000 0x0 0x1000>,
<0x2 0x01000000 0x0 0x1000>;
reg-names = "ps", "pwrgate", "cpu-start", "cllt",
"cluster", "commit", "wdt", "spmi",
"wake", "ps-aon", "clk-mux",
"mcc-ctl", "mcc-a", "mcc-b", "mcc-c",
"mcc-d", "mcc-e";
apple,display-coprocessors = <&dcp>;
apple,pinctrl = <&pinctrl_ap>;
/*
* The SoC's wake controller sources every T8112 board has: the AOP, NUB
* (PMU RTC alarm 58), SMC and both ATC ports. Boards with an MTP add its
* sources (229, 231, 248).
*/
apple,wake-enable = <14 26 27 44 51 53 54 58 69 73 81 86 147
154 155 156 157>;
};

cio_reset: reset-controller@23b790000 {
compatible = "apple,t8112-cio-reset", "apple,t8103-cio-reset";
reg = <0x2 0x3b790000 0x0 0x8000>;
Expand Down Expand Up @@ -1870,6 +1916,7 @@
mboxes = <&sep_mbox>;
mbox-names = "mbox";
iommus = <&sep_dart 0>;
power-domains = <&ps_sep>, <&ps_gpio>;
status = "disabled";
};

Expand Down Expand Up @@ -2006,6 +2053,7 @@

dcpext: dcp@271c00000 {
compatible = "apple,t8112-dcpext", "apple,dcpext";
apple,display-power = <&dcp_power>;
mboxes = <&dcpext_mbox>;
mbox-names = "mbox";
iommus = <&dcpext_dart 5 0x8 0x00000000 0x7 0xffff0000>;
Expand Down
31 changes: 31 additions & 0 deletions drivers/gpu/drm/apple/dcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9913,6 +9913,22 @@ static const struct dcp_s2r_layout dcp_s2r_t8103_ext = {
.disp_streams = BIT(0) | BIT(4),
};

static const struct dcp_s2r_layout dcp_s2r_t8112 = {
.disp_cpu = 0x10000,
.disp_fe = 0x378,
.disp_sys = 0x370,
.dcp_streams = BIT(5),
.disp_streams = BIT(0) | BIT(4),
};

static const struct dcp_s2r_layout dcp_s2r_t8112_ext = {
.disp_cpu = 0x3c8,
.disp_fe = 0x388,
.disp_sys = 0x380,
.dcp_streams = BIT(5),
.disp_streams = BIT(0) | BIT(4),
};

/* TEST: J813 external processors, ADT DISPEXT0/1 power words. */
static const struct dcp_s2r_layout dcp_s2r_t8142_ext[] = {
{ .disp_cpu = 0x428, .disp_fe = 0x418, .disp_sys = 0x308,
Expand Down Expand Up @@ -11922,6 +11938,20 @@ static const struct apple_dcp_hw_data apple_dcp_hw_t6020_dcpext = {

static const struct apple_dcp_hw_data apple_dcp_hw_t8112 = {
.num_dptx_ports = 2,
.s2r = true,
.s2r_no_secure_port = true,
.map_reg_dart = true,
.s2r_disp_dart_with_dcp = true,
.s2r_layout = &dcp_s2r_t8112,
};

static const struct apple_dcp_hw_data apple_dcp_hw_t8112_dcpext = {
.num_dptx_ports = 2,
.s2r_ext = true,
.s2r_no_secure_port = true,
.map_reg_dart = true,
.s2r_disp_dart_with_dcp = true,
.s2r_layout = &dcp_s2r_t8112_ext,
};

/* The internal T8140 endpoint uses the H17P method profile. */
Expand Down Expand Up @@ -12140,6 +12170,7 @@ static const struct of_device_id of_match[] = {
{ .compatible = "apple,t8103-dcp", .data = &apple_dcp_hw_t8103, },
{ .compatible = "apple,t8103-dcpext", .data = &apple_dcp_hw_t8103_dcpext, },
{ .compatible = "apple,t8112-dcp", .data = &apple_dcp_hw_t8112, },
{ .compatible = "apple,t8112-dcpext", .data = &apple_dcp_hw_t8112_dcpext, },
{ .compatible = "apple,t8140-dcp", .data = &apple_dcp_hw_t8140, },
{ .compatible = "apple,t8140-dcpext", .data = &apple_dcp_hw_t8140_external, },
{ .compatible = "apple,t8142-dcp", .data = &apple_dcp_hw_t8142, },
Expand Down
80 changes: 80 additions & 0 deletions drivers/iommu/apple-dart.c
Original file line number Diff line number Diff line change
Expand Up @@ -9090,6 +9090,84 @@ int apple_dart_display_keep(struct device *dev, u32 streams, bool save)
}
EXPORT_SYMBOL_GPL(apple_dart_display_keep);

static int apple_dart_t8112_display_streams(struct apple_dart *dart, u32 streams, bool on,
bool flush)
{
struct apple_dart_stream_map map = { .dart = dart };
unsigned long bits = streams;
unsigned int sid, idx;
u32 error;
int ret = 0;

if (on) {
if (!READ_ONCE(dart->host_off) && !READ_ONCE(dart->display_dark))
return 0;
if (dart->display_saved && !apple_dart_state_retained(dart)) {
if (apple_dart_is_locked(dart)) {
dev_err(dart->dev, "translations lost at the power-down, and locked\n");
return -EIO;
}
ret = apple_dart_hw_reset(dart);
if (ret && ret != -EBUSY)
dev_warn(dart->dev, "reset at power-on: %d\n", ret);
for_each_set_bit(sid, &bits, dart->num_streams)
writel(BIT(sid), dart->regs + DART_T8110_DISABLE_STREAMS);
for (sid = 0; sid < dart->num_streams; sid++) {
for (idx = 0; idx < dart->hw->ttbr_count; idx++)
writel(dart->save_ttbr[sid][idx],
dart->regs + DART_TTBR(dart, sid, idx));
writel(dart->save_tcr[sid], dart->regs + DART_TCR(dart, sid));
}
ret = 0;
dev_dbg(dart->dev, "translations put back at power-on\n");
}
error = readl(dart->regs + DART_T8110_ERROR);
if (error & DART_T8110_ERROR_FLAG)
writel(error, dart->regs + DART_T8110_ERROR);
scoped_guard(spinlock_irqsave, &dart->managed_lock)
WRITE_ONCE(dart->display_tlb_stale, true);
ret = apple_dart_display_dark_exit(dart);
if (ret)
return ret;
if (dart->display_saved)
writel(dart->display_enable & streams,
dart->regs + DART_T8110_ENABLE_STREAMS);
else
writel(streams, dart->regs + DART_T8110_ENABLE_STREAMS);
dart->host_off_slept = false;
dart->display_saved = false;
dart->sleep_flushed = false;
WRITE_ONCE(dart->host_off, false);
return 0;
}

if (READ_ONCE(dart->host_off))
return 0;
if (!READ_ONCE(dart->display_dark)) {
apple_dart_save_state(dart);
dart->display_enable = readl(dart->regs + DART_T8110_ENABLE_STREAMS);
dart->display_saved = true;
}
ret = apple_dart_display_dark_enter(dart);
if (ret)
return ret;
for_each_set_bit(sid, &bits, dart->num_streams)
writel(BIT(sid), dart->regs + DART_T8110_DISABLE_STREAMS);
if (flush) {
for_each_set_bit(sid, &bits, dart->num_streams)
set_bit(sid, map.sidmap);
ret = dart->hw->invalidate_tlb(&map);
if (ret) {
dev_err(dart->dev, "flush for a power-down failed: %d\n", ret);
return ret;
}
dart->sleep_flushed = true;
}
WRITE_ONCE(dart->host_off, true);

return 0;
}

int apple_dart_display_streams(struct device *dev, u32 streams, bool on, bool flush)
{
struct apple_dart *dart = dev_get_drvdata(dev);
Expand All @@ -9100,6 +9178,8 @@ int apple_dart_display_streams(struct device *dev, u32 streams, bool on, bool fl

if (dart->hw->type == DART_T8020)
return apple_dart_t8020_display_streams(dart, streams, on, flush);
if (of_device_is_compatible(dev->of_node, "apple,t8112-dart"))
return apple_dart_t8112_display_streams(dart, streams, on, flush);

if (on) {
apple_dart_gapf_protect(dart);
Expand Down
14 changes: 14 additions & 0 deletions drivers/irqchip/irq-apple-aic.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,16 @@ static const struct aic_info aic2_info __initconst = {
.local_fast_ipi = true,
};

static const struct aic_info aic2_t8112_info __initconst = {
.version = 2,

.irq_cfg = AIC2_IRQ_CFG,

.fast_ipi = true,
.local_fast_ipi = true,
.fw_suspend = true,
};

static const struct aic_info aic3_info __initconst = {
.version = 3,

Expand Down Expand Up @@ -412,6 +422,10 @@ static const struct of_device_id aic_info_match[] = {
.compatible = "apple,aic",
.data = &aic1_info,
},
{
.compatible = "apple,t8112-aic",
.data = &aic2_t8112_info,
},
{
.compatible = "apple,aic2",
.data = &aic2_info,
Expand Down
3 changes: 2 additions & 1 deletion drivers/mfd/macsmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,8 @@ static int apple_smc_probe(struct platform_device *pdev)
* its SMC hears last, after SEP and the other coprocessors stopped.
*/
if (of_machine_is_compatible("apple,j813") ||
of_device_is_compatible(dev->of_node, "apple,t8103-smc"))
of_device_is_compatible(dev->of_node, "apple,t8103-smc") ||
of_device_is_compatible(dev->of_node, "apple,t8112-smc"))
smc->saved_enabled = true;
smc->sram_base = devm_platform_get_and_ioremap_resource(pdev, 1, &smc->sram);
if (IS_ERR(smc->sram_base))
Expand Down
9 changes: 9 additions & 0 deletions drivers/soc/apple/pmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,14 @@ const HW_CFG_T6050: PmpHwConfig = PmpHwConfig {
confirm_ioreg_len: false,
};

/// T8112 (M2): the sleep engine reloads `__TEXT` from DRAM at the wake, and only `__DATA`
/// (the ADT's second segment, offset 0x2f000, size 0x46000 on J413) has to be kept. When the
/// boot loader supplies `apple,sram-keep`, both offset and size come from the DT instead.
const HW_CFG_T8112: PmpHwConfig = PmpHwConfig {
sram_backup: Some((0x2f000, 0x46000)),
..HW_CFG_DEFAULT
};

/// T8122: the sleep engine reloads `__TEXT` from DRAM at the wake, and only `__DATA`
/// (the ADT's second segment, offset 0x36000, size 0x47000) has to be kept. When the
/// boot loader supplies `apple,sram-keep`, both offset and size come from the DT instead.
Expand Down Expand Up @@ -1086,6 +1094,7 @@ kernel::of_device_table!(
OF_TABLE,
<PmpDriver as platform::Driver>::IdInfo,
[
(of::DeviceId::new(c"apple,t8112-pmp-v2"), &HW_CFG_T8112),
(of::DeviceId::new(c"apple,t8122-pmp-v2"), &HW_CFG_T8122),
(of::DeviceId::new(c"apple,t8132-pmp-v2"), &HW_CFG_T8132),
(of::DeviceId::new(c"apple,t8140-pmp-v2"), &HW_CFG_T8140),
Expand Down
Loading
Loading