From 689d4aef2eb2ed39085d540fe1a2e13a8c8c6c4b Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 13:30:44 +0700 Subject: [PATCH 1/8] dt-bindings: npu: apple,ane: Add apple,t8142-ane The M5's ANE is the H17 engine (ADT "ane,t8132exclave", ane-type 0x210) with four DAPF records, T8140's interrupts and a preload in reserved memory. Its PWGATE is a window of its own, so it takes the power domains the T6050 form does. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- .../devicetree/bindings/npu/apple,ane.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/npu/apple,ane.yaml b/Documentation/devicetree/bindings/npu/apple,ane.yaml index dded3c25fe216..1383ed8cdfe18 100644 --- a/Documentation/devicetree/bindings/npu/apple,ane.yaml +++ b/Documentation/devicetree/bindings/npu/apple,ane.yaml @@ -35,6 +35,7 @@ properties: - apple,t6050-ane - apple,t8112-ane - apple,t8140-ane + - apple,t8142-ane - items: - const: apple,t6001-ane - const: apple,ane @@ -226,12 +227,23 @@ allOf: const: 0x200 apple,dapf-ranges: maxItems: 4 + - if: + properties: + compatible: + const: apple,t8142-ane + then: + properties: + apple,ane-type: + const: 0x210 + apple,dapf-ranges: + maxItems: 4 - if: properties: compatible: enum: - apple,t6050-ane - apple,t8140-ane + - apple,t8142-ane then: properties: interrupts: @@ -266,6 +278,7 @@ allOf: - apple,t6041-ane - apple,t6050-ane - apple,t8140-ane + - apple,t8142-ane required: - memory-region then: @@ -339,6 +352,7 @@ allOf: - apple,t8140-ane - apple,t6041-ane - apple,t6050-ane + - apple,t8142-ane then: properties: interrupt-names: false @@ -440,6 +454,7 @@ allOf: - apple,t6041-ane - apple,t6050-ane - apple,t6001-ane + - apple,t8142-ane else: properties: power-domains: From 9658afea85bfecdeab861e1d152f19aa80ba0a42 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 13:30:44 +0700 Subject: [PATCH 2/8] dt-bindings: iommu: apple,dart: Add apple,t8142-ane-dart The M5's ANE DARTs are T8140's cold ANE DARTs at revision 0x204. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- Documentation/devicetree/bindings/iommu/apple,dart.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/apple,dart.yaml b/Documentation/devicetree/bindings/iommu/apple,dart.yaml index a462922f39c14..798a6e7f11e55 100644 --- a/Documentation/devicetree/bindings/iommu/apple,dart.yaml +++ b/Documentation/devicetree/bindings/iommu/apple,dart.yaml @@ -36,6 +36,10 @@ properties: - const: apple,t8140-ane-dart - const: apple,t8140-dart - const: apple,t8110-dart + - items: + - const: apple,t8142-ane-dart + - const: apple,t8142-dart + - const: apple,t8110-dart - items: - enum: - apple,t6000-dart From 79e1e9f88449f2ad8a9a97648f91df8c656157d2 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 13:30:44 +0700 Subject: [PATCH 3/8] accel/ane: Describe the T8142 (M5) ANE on the H17 staged backend The M5's ANE is the H17 engine again (ADT "ane,t8132exclave", ane-type 0x210), exclave-assigned and preloaded by iBoot. From the T8142 ADT: ANE_SYS at PMGR +0x2e8 (pmgr device 73), ANE_CPU +0xc000 and ANE_TDBASE +0xc008 as on T8140, four DAPF records, and a preload of TEXT 0xbc000 and DATA 0x2b0000 at 0x100_0000_0000 / 0x100_000b_c000. Its PWGATE window, scratch cells, DART revision and TEXT digest are not measured yet. Give ane_t8142_platform a zero TEXT pin that never matches: with a loader hand-off the driver only logs it and leaves the engine alone. The hand-off check now hashes the handed-over TEXT even when its layout is not the platform's, and logs that layout next to the digest, so one boot of a new SoC or firmware reports both. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- drivers/accel/ane/ane_fw_cold.c | 17 ++++++-- drivers/accel/ane/ane_fw_platform.c | 46 +++++++++++++++++++++ drivers/accel/ane/ane_fw_platform.h | 3 +- drivers/accel/ane/ane_t6021_rtclient_main.c | 5 +++ 4 files changed, 67 insertions(+), 4 deletions(-) diff --git a/drivers/accel/ane/ane_fw_cold.c b/drivers/accel/ane/ane_fw_cold.c index 6f447afa769e2..2dc8d2239b89c 100644 --- a/drivers/accel/ane/ane_fw_cold.c +++ b/drivers/accel/ane/ane_fw_cold.c @@ -2142,13 +2142,18 @@ static bool ane_fw_handoff_present(struct platform_device *pdev, !strcmp(name, i ? "firmware-data" : "firmware-text") && !ane_fw_preload_range(np, i, &h.phys[i], &h.size[i]); } - if (h.regions_ok && ane_fw_preload_ranges_valid(soc, h.phys, h.size, h.dva)) { + /* + * Hash what the loader handed over even when its layout is not this + * SoC's, so that one boot of a new firmware or SoC reports both. + */ + if (h.regions_ok) { void *text = memremap(h.phys[0], h.size[0], MEMREMAP_WB); if (text) { sha256(text, h.size[0], digest); memunmap(text); - h.text_ok = !memcmp(digest, soc->text_pin, sizeof(digest)); + h.text_ok = ane_fw_preload_ranges_valid(soc, h.phys, h.size, h.dva) && + !memcmp(digest, soc->text_pin, sizeof(digest)); } } *hp = h; @@ -2158,9 +2163,15 @@ static bool ane_fw_handoff_present(struct platform_device *pdev, !h.marker || strcmp(h.marker, ANE_FW_COLD_BOOT_EVIDENCE) ? "raw-boot marker" : !h.preloaded || !h.regions_ok ? "preload reservations" : !h.text_ok ? "firmware TEXT pin" : "preload layout"); - if (h.regions_ok && !h.text_ok) + if (h.regions_ok && !h.text_ok) { dev_info(&pdev->dev, "H17 ANE: preloaded TEXT sha256 %*phN\n", (int)sizeof(digest), digest); + dev_info(&pdev->dev, + "H17 ANE: preload TEXT %#llx+%#llx @%#llx, DATA %#llx+%#llx @%#llx (%s)\n", + h.phys[0], h.size[0], h.dva[0], h.phys[1], h.size[1], h.dva[1], + ane_fw_preload_ranges_valid(soc, h.phys, h.size, h.dva) ? + "layout as expected" : "layout differs"); + } return false; } diff --git a/drivers/accel/ane/ane_fw_platform.c b/drivers/accel/ane/ane_fw_platform.c index 5639f340d0a61..a6e3a88e47a0b 100644 --- a/drivers/accel/ane/ane_fw_platform.c +++ b/drivers/accel/ane/ane_fw_platform.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "ane_fw_cold.h" #include "ane_fw_platform.h" @@ -177,6 +178,51 @@ const struct ane_fw_platform ane_t6050_platform = { .text_pin = ane_t6050_text_pin_27_0, }; +/* + * The M5 (T8142, J813/J815) ANE: "ane,t8132exclave", ane-type 0x210, + * exclave-assigned and preloaded by iBoot. From the T8142 ADT: ANE_SYS at + * PMGR +0x2e8 (pmgr device 73, parent AFISOCNI3), ANE_CPU +0xc000 and + * ANE_TDBASE +0xc008 as on T8140; four DAPF records; TEXT 0xbc000 and DATA + * 0x2b0000 at 0x100_0000_0000 and 0x100_000b_c000 (the macOS 27.2 host's + * preload). Not measured yet: the PWGATE window, the scratch cells and the + * DART revision (T8140's values below), and the TEXT pin, so the zero pin + * never matches: the hand-off is checked and its TEXT digest logged, and the + * engine is left alone. + */ +static const u8 ane_t8142_text_pin_unmeasured[SHA256_DIGEST_SIZE]; + +const struct ane_fw_platform ane_t8142_platform = { + .soc = 0x8142, + .chip_family = 17, + .ane_type = 0x210, + .hwx_subtype = 9, + .task_generation = 19, + .interrupt_count = 2, + .owner = ANE_FW_OWNER_EXCLAVE, + .reg_names = ane_h17_reg_names, + .reg_sizes = ane_h17_reg_sizes, + .reg_count = ARRAY_SIZE(ane_h17_reg_names), + .wrapper = 0x1600000, + .mailbox = 0x1608000, + .scratch = 0x1880020, + .doorbell = 0x1884000, + .irq_status = 0x188c000, + .irq_ack = 0x1890000, + .preload_dva = { 0x10000000000, 0x100000bc000 }, + .preload_size = { 0xbc000, 0x2b0000 }, + .stream_mask = BIT(0), + .firmware_preloaded = true, + .safe_reset = false, + .sleep_warm = false, + .pmgr_sys = 0x2e8, + .pmgr_cpu = 0xc000, + .pmgr_subblock = 0xc008, + .dart_compatible = "apple,t8142-dart", + .dart_revision = 0x203, + .dapf_count = 4, + .text_pin = ane_t8142_text_pin_unmeasured, +}; + /* * The iBoot preload is firmware memory. Accept it only as a no-map child of * /reserved-memory that Linux does not manage as System RAM, whether the diff --git a/drivers/accel/ane/ane_fw_platform.h b/drivers/accel/ane/ane_fw_platform.h index e4afe348b30c1..dd5e3278c423d 100644 --- a/drivers/accel/ane/ane_fw_platform.h +++ b/drivers/accel/ane/ane_fw_platform.h @@ -145,7 +145,8 @@ ane_fw_sleep_path(const struct ane_fw_platform *platform) return platform ? ANE_SLEEP_FW_BACKEND : ANE_SLEEP_RTCLIENT; } -extern const struct ane_fw_platform ane_h16_platform, ane_h17_platform, ane_t6050_platform; +extern const struct ane_fw_platform ane_h16_platform, ane_h17_platform, ane_t6050_platform, + ane_t8142_platform; int ane_fw_platform_preflight(struct platform_device *pdev, const struct ane_fw_platform *soc); diff --git a/drivers/accel/ane/ane_t6021_rtclient_main.c b/drivers/accel/ane/ane_t6021_rtclient_main.c index 6dc0458bcbbd3..a4f0d6fd7e872 100644 --- a/drivers/accel/ane/ane_t6021_rtclient_main.c +++ b/drivers/accel/ane/ane_t6021_rtclient_main.c @@ -4422,6 +4422,10 @@ static const struct ane_t602x_soc ane_t6050_soc = { .platform = &ane_t6050_platform, }; +static const struct ane_t602x_soc ane_t8142_soc = { + .platform = &ane_t8142_platform, +}; + static const struct of_device_id ane_rtclient_of_match[] = { { .compatible = "apple,t6020-ane", .data = &ane_t6020_soc }, { .compatible = "apple,t6021-ane", .data = &ane_t6021_soc }, @@ -4430,6 +4434,7 @@ static const struct of_device_id ane_rtclient_of_match[] = { { .compatible = "apple,t6041-ane", .data = &ane_h16_soc }, { .compatible = "apple,t8140-ane", .data = &ane_h17_soc }, { .compatible = "apple,t6050-ane", .data = &ane_t6050_soc }, + { .compatible = "apple,t8142-ane", .data = &ane_t8142_soc }, { } }; MODULE_DEVICE_TABLE(of, ane_rtclient_of_match); From b0f0900a9af0fb561cd81e7f65e38a3cfc73e149 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 13:30:44 +0700 Subject: [PATCH 4/8] accel/ane: T8142: the macOS 27.0 stub preload, measured on a J815 Under aura on a J815 with the macOS 27.0 (26A428) stub, iBoot preloads the ANE TEXT 0xc0000 and DATA 0x2ac000 at 0x100_0000_0000 and 0x100_000c_0000, T8140's layout (the 27.2 host's ADT shows 0xbc000 and 0x2b0000). Use it, and keep the measured TEXT digest next to the zero pin until the PWGATE window, scratch cells and DART revision are known. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- drivers/accel/ane/ane_fw_platform.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/accel/ane/ane_fw_platform.c b/drivers/accel/ane/ane_fw_platform.c index a6e3a88e47a0b..2024aaf149e81 100644 --- a/drivers/accel/ane/ane_fw_platform.c +++ b/drivers/accel/ane/ane_fw_platform.c @@ -182,14 +182,22 @@ const struct ane_fw_platform ane_t6050_platform = { * The M5 (T8142, J813/J815) ANE: "ane,t8132exclave", ane-type 0x210, * exclave-assigned and preloaded by iBoot. From the T8142 ADT: ANE_SYS at * PMGR +0x2e8 (pmgr device 73, parent AFISOCNI3), ANE_CPU +0xc000 and - * ANE_TDBASE +0xc008 as on T8140; four DAPF records; TEXT 0xbc000 and DATA - * 0x2b0000 at 0x100_0000_0000 and 0x100_000b_c000 (the macOS 27.2 host's - * preload). Not measured yet: the PWGATE window, the scratch cells and the - * DART revision (T8140's values below), and the TEXT pin, so the zero pin - * never matches: the hand-off is checked and its TEXT digest logged, and the - * engine is left alone. + * ANE_TDBASE +0xc008 as on T8140; four DAPF records. The macOS 27.0 (26A428) + * stub's iBoot preloads TEXT 0xc0000 and DATA 0x2ac000 at T8140's IOVAs, + * measured on a J815 under aura with TEXT sha256 1212c260...b6d4e3 (the 27.2 + * host's preload is 0xbc000/0x2b0000 at 0x100_000b_c000). Not measured yet: + * the PWGATE window, the scratch cells and the DART revision (T8140's values + * below). Until they are, the zero pin never matches: the hand-off is checked + * and logged and the engine is left alone. ane_t8142_text_26a428 is the pin + * to use then. */ static const u8 ane_t8142_text_pin_unmeasured[SHA256_DIGEST_SIZE]; +static const u8 ane_t8142_text_26a428[] __maybe_unused = { + 0x12, 0x12, 0xc2, 0x60, 0x6e, 0xf8, 0xca, 0xce, + 0x51, 0xfd, 0x95, 0x1e, 0x60, 0xbc, 0xce, 0x75, + 0xbe, 0x8e, 0x65, 0xd5, 0xf0, 0xfe, 0x19, 0x37, + 0xac, 0x3b, 0x58, 0x07, 0x49, 0xd6, 0xb4, 0xe3, +}; const struct ane_fw_platform ane_t8142_platform = { .soc = 0x8142, @@ -208,8 +216,8 @@ const struct ane_fw_platform ane_t8142_platform = { .doorbell = 0x1884000, .irq_status = 0x188c000, .irq_ack = 0x1890000, - .preload_dva = { 0x10000000000, 0x100000bc000 }, - .preload_size = { 0xbc000, 0x2b0000 }, + .preload_dva = { 0x10000000000, 0x100000c0000 }, + .preload_size = { 0xc0000, 0x2ac000 }, .stream_mask = BIT(0), .firmware_preloaded = true, .safe_reset = false, From 6a90c759b756769676e25e513b7ed5c130784a4c Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 13:30:44 +0700 Subject: [PATCH 5/8] iommu: apple-dart: Take the T8142 ANE DARTs as cold ANE DARTs The M5's three ANE DARTs are T8140's: 16 streams, the exclave's streams inherited from iBoot, SID0 the only one the kernel attaches. They are revision 0x204 (PARAMS_8 0x2a2a0204, measured on a J815) where T8140's are 0x203. Give apple,t8142-ane-dart the cold ANE profile and check for its own revision. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- drivers/iommu/apple-dart.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 7cf99361bf796..a8b91c7e63316 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -5172,7 +5172,8 @@ static int apple_dart_probe(struct platform_device *pdev) dart->dev = dev; dart->hw = of_device_get_match_data(dev); dart->tunneled = tunneled; - dart->cold_ane = of_device_is_compatible(dev->of_node, "apple,t8140-ane-dart"); + dart->cold_ane = of_device_is_compatible(dev->of_node, "apple,t8140-ane-dart") || + of_device_is_compatible(dev->of_node, "apple,t8142-ane-dart"); if (dart->cold_ane && !IS_BUILTIN(CONFIG_APPLE_DART)) return -EOPNOTSUPP; dart->isp_host = of_device_is_compatible(dev->of_node, "apple,t6050-isp-dart"); @@ -5643,8 +5644,12 @@ static int apple_dart_probe(struct platform_device *pdev) /* No reset, TCR/TTBR clear, global enable, remap or IRQ ACK. * Cold acquisition is checked by the staged ANE backend before * it attaches a private SID0 domain. Even bypass SIDs stay intact. + * T8140's ANE DARTs are revision 0x203, T8142's 0x204. */ - if (dart->locked || dart->version != 0x203 || dart->num_streams != 16 || + u32 cold_version = of_device_is_compatible(dev->of_node, "apple,t8142-ane-dart") ? + 0x204 : 0x203; + + if (dart->locked || dart->version != cold_version || dart->num_streams != 16 || !bitmap_empty(dart->remapped, DART_MAX_STREAMS)) { ret = -EPERM; goto err_clk_disable; From f3dc931ecad9777e1eb4c1345df2f1c7f02d2bc8 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 13:30:44 +0700 Subject: [PATCH 6/8] accel/ane: T8142: Run the M5 Neural Engine Measured under aura's hypervisor on a J815 running macOS 27.2.1 (26B131), with a cold model load, the power-up, the first program and the power-down traced: - PWGATE is PMGR +0x27640 (the ADT's ane reg[2] + 0x3640): request +0xc (0 release, 3 gate), acknowledge +0x30, as on T8140. - The scratch cells start at +0x1880028, as on T6050. - The DARTs are revision 0x204 (PARAMS_8 0x2a2a0204), 16 streams; the ADT gives SIDs 1-7 to the exclave and bypasses 10 and 13. - Four DAPF records, the DT's. - macOS powers the engine down in T8140's order: sub-block, PWGATE request 3, acknowledge 0, CPU, then ANE_SYS. So T8142 runs as T8140 does: EXCLAVE_MODE_STOP before a clean stop, the engine parked until its first request and cycled cold across system sleep, the preload pinned by the 26A428 TEXT digest measured on a J815. Tested on a J815 (7.3.0, integration/aurora, iBoot preload of the 26A428 stub): the engine binds and parks behind its three cold DARTs, the firmware boots on the first request, and an H17 program from Apple's compiler loads and its process is created and torn down (H17 LOAD, CREATE, TERMINATE and UNLOAD all status 0, with the H17 HWX validator change for zin_ane_compiler 10.205 programs). The ANE KUnit suites pass but for program_add128_slots_test, which fails on integration/aurora already. A frame through the engine is not yet compared against a reference. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- drivers/accel/ane/ane_fw_platform.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/accel/ane/ane_fw_platform.c b/drivers/accel/ane/ane_fw_platform.c index 2024aaf149e81..411b1732e41aa 100644 --- a/drivers/accel/ane/ane_fw_platform.c +++ b/drivers/accel/ane/ane_fw_platform.c @@ -185,14 +185,17 @@ const struct ane_fw_platform ane_t6050_platform = { * ANE_TDBASE +0xc008 as on T8140; four DAPF records. The macOS 27.0 (26A428) * stub's iBoot preloads TEXT 0xc0000 and DATA 0x2ac000 at T8140's IOVAs, * measured on a J815 under aura with TEXT sha256 1212c260...b6d4e3 (the 27.2 - * host's preload is 0xbc000/0x2b0000 at 0x100_000b_c000). Not measured yet: - * the PWGATE window, the scratch cells and the DART revision (T8140's values - * below). Until they are, the zero pin never matches: the hand-off is checked - * and logged and the engine is left alone. ane_t8142_text_26a428 is the pin - * to use then. + * host's preload is 0xbc000/0x2b0000 at 0x100_000b_c000). + * + * Measured under aura's hypervisor on a J815 running macOS 27.2.1 (cold + * model load, power-up and power-down traced): the PWGATE window at PMGR + * +0x27640 (request +0xc, acknowledge +0x30, as on T8140), the scratch + * cells from +0x1880028 (as on T6050), DART revision 0x204 (PARAMS_8 + * 0x2a2a0204) and the four DAPF records. macOS powers the engine down in + * T8140's order: sub-block, PWGATE request 3, acknowledge 0, CPU, then + * ANE_SYS. So sleep and the parked start follow T8140. */ -static const u8 ane_t8142_text_pin_unmeasured[SHA256_DIGEST_SIZE]; -static const u8 ane_t8142_text_26a428[] __maybe_unused = { +static const u8 ane_t8142_text_26a428[] = { 0x12, 0x12, 0xc2, 0x60, 0x6e, 0xf8, 0xca, 0xce, 0x51, 0xfd, 0x95, 0x1e, 0x60, 0xbc, 0xce, 0x75, 0xbe, 0x8e, 0x65, 0xd5, 0xf0, 0xfe, 0x19, 0x37, @@ -212,7 +215,7 @@ const struct ane_fw_platform ane_t8142_platform = { .reg_count = ARRAY_SIZE(ane_h17_reg_names), .wrapper = 0x1600000, .mailbox = 0x1608000, - .scratch = 0x1880020, + .scratch = 0x1880028, .doorbell = 0x1884000, .irq_status = 0x188c000, .irq_ack = 0x1890000, @@ -221,14 +224,17 @@ const struct ane_fw_platform ane_t8142_platform = { .stream_mask = BIT(0), .firmware_preloaded = true, .safe_reset = false, + /* Exclave mode at boot, cold sleep cycle and parked start, as on T8140. */ + .exclave_mode_stop = true, + .macos_sleep = true, .sleep_warm = false, .pmgr_sys = 0x2e8, .pmgr_cpu = 0xc000, .pmgr_subblock = 0xc008, - .dart_compatible = "apple,t8142-dart", - .dart_revision = 0x203, + .dart_compatible = "apple,t8142-ane-dart", + .dart_revision = 0x204, .dapf_count = 4, - .text_pin = ane_t8142_text_pin_unmeasured, + .text_pin = ane_t8142_text_26a428, }; /* From b165b7b4041f05133bea40fd73347641ec6fb87a Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 13:30:45 +0700 Subject: [PATCH 7/8] arm64: dts: apple: t8142: Add the ANE Describe ANE_SYS (pmgr device 73, +0x2e8), the three ANE DARTs (0x421800000, 0x421820000, 0x421840000, IRQ 752, vm range 0x0-0x400_0000_0000) and the engine: its registers, the PMGR window and PWGATE (PMGR +0x27640), IRQs 751 and 764, the firmware IOVAs and four DAPF ranges, disabled. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- .../boot/dts/apple/t8142-peripherals.dtsi | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi index 350c7ab207a5f..caf5902393d51 100644 --- a/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi @@ -149,6 +149,73 @@ status = "disabled"; }; + /* + * The Neural Engine's three DARTs (ADT dart-ane, one interrupt for all): + * revision 0x204, 16 streams; SIDs 1-7 are the exclave's and 10/13 + * bypass. The cold profile leaves every inherited stream alone and + * gives the kernel only SID0. + */ + ane_dart0: iommu@421800000 { + compatible = "apple,t8142-ane-dart", "apple,t8142-dart", + "apple,t8110-dart"; + reg = <0x4 0x21800000 0x0 0xc000>; + #iommu-cells = <1>; + interrupts = ; + power-domains = <&ps_ane_sys>; + /* The firmware DVAs reach 0x100_xxxx_xxxx. */ + apple,dma-range = <0x0 0x0 0x400 0x0>; + status = "disabled"; + }; + + ane_dart1: iommu@421820000 { + compatible = "apple,t8142-ane-dart", "apple,t8142-dart", + "apple,t8110-dart"; + reg = <0x4 0x21820000 0x0 0xc000>; + #iommu-cells = <1>; + interrupts = ; + power-domains = <&ps_ane_sys>; + apple,dma-range = <0x0 0x0 0x400 0x0>; + status = "disabled"; + }; + + ane_dart2: iommu@421840000 { + compatible = "apple,t8142-ane-dart", "apple,t8142-dart", + "apple,t8110-dart"; + reg = <0x4 0x21840000 0x0 0xc000>; + #iommu-cells = <1>; + interrupts = ; + power-domains = <&ps_ane_sys>; + apple,dma-range = <0x0 0x0 0x400 0x0>; + status = "disabled"; + }; + + /* + * The Neural Engine (ADT /arm-io/ane, "ane,t8132exclave", ane-type 0x210): + * the H17 engine, exclave-assigned, with firmware that iBoot preloads; the + * boot loader hands the preload over as firmware-text and firmware-data. + * PWGATE is the ADT's reg[2] (PMGR +0x24000) + 0x3640, measured under + * macOS 27.2.1. + */ + ane: ane@420000000 { + compatible = "apple,t8142-ane"; + reg = <0x4 0x20000000 0x0 0x2000000>, + <0x3 0x80700000 0x0 0x18000>, + <0x3 0x80727640 0x0 0x34>; + reg-names = "engine", "pmgr", "pwgate"; + interrupts = , + ; + iommus = <&ane_dart0 0>, <&ane_dart1 0>, <&ane_dart2 0>; + power-domains = <&ps_ane_sys>; + apple,firmware-preloaded; + apple,firmware-iovas = /bits/ 64 <0x10000000000 0x100000c0000>; + /* Inclusive SID0 identity windows from the ADT's dart-ane dapf-instance-0. */ + apple,dapf-ranges = /bits/ 64 <0x4a1668000 0x4a1668003 + 0x3807002e8 0x3807002eb + 0x38070c008 0x38070c00b + 0x582668000 0x582668003>; + status = "disabled"; + }; + scaler0_dart: iommu@305260000 { compatible = "apple,t8142-dart", "apple,t8110-dart"; reg = <0x3 0x5260000 0x0 0x20000>; @@ -462,6 +529,16 @@ }; &pmgr { + /* ADT pmgr device ANE_SYS (id 73), parent AFISOCNI3 (no power state). */ + ps_ane_sys: power-controller@2e8 { + compatible = "apple,t8142-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x2e8 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "ane_sys"; + status = "disabled"; + }; + ps_msr: power-controller@2a8 { compatible = "apple,t8142-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2a8 4>; From 33d8f13414be9c300a463ff49681d9d680b87dbe Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 13:30:45 +0700 Subject: [PATCH 8/8] arm64: dts: apple: t8142-j815: Enable the ANE Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- arch/arm64/boot/dts/apple/t8142-j815.dts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8142-j815.dts b/arch/arm64/boot/dts/apple/t8142-j815.dts index 64edb6c4521f8..a11d808ff22a0 100644 --- a/arch/arm64/boot/dts/apple/t8142-j815.dts +++ b/arch/arm64/boot/dts/apple/t8142-j815.dts @@ -180,3 +180,27 @@ &ave { status = "okay"; }; + +/* + * The Neural Engine. It stays off until the first request: the firmware is + * started then, from the preload, and system sleep cycles it cold. + */ +&ps_ane_sys { + status = "okay"; +}; + +&ane_dart0 { + status = "okay"; +}; + +&ane_dart1 { + status = "okay"; +}; + +&ane_dart2 { + status = "okay"; +}; + +&ane { + status = "okay"; +};