From 57deb4ccdc5c094201608aa5e7c315fd10a09479 Mon Sep 17 00:00:00 2001 From: Connor Chan Date: Fri, 4 Dec 2026 04:05:09 -0700 Subject: [PATCH 1/3] media: apple: ave: admit T6000/T6001 macOS 27.2 (26B123) firmware Admit the M1 Pro/Max (T6000/T6001) video encoder firmware preloaded by the macOS 27.2 (26B123) stub (shared TEXT 0x13c000, per-engine DATA 0x134000, link cell at TEXT 0x423c, TEXT CRC 0x24812842 using ave_layout_26b123). Also scan all 5-cell entries in iommu-addresses inside ave_fw_segment() so dual-encoder SoCs (T6001 ave0/ave1) sharing the preloaded TEXT carveout match their own phandle entry instead of failing with -EINVAL. Verified live on MacBook Pro 16" M1 Max (J316c / T6001, OS FW 27.2 26B123). Signed-off-by: Connor Chan --- drivers/media/platform/apple/ave/ave-drv.c | 27 +++++++++++++++++++ drivers/media/platform/apple/ave/ave-fw.c | 23 +++++++++++++--- drivers/media/platform/apple/ave/ave-layout.c | 3 ++- drivers/media/platform/apple/ave/ave.h | 6 +++++ 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/apple/ave/ave-drv.c b/drivers/media/platform/apple/ave/ave-drv.c index 04472e89e1540..0cb3211c72c06 100644 --- a/drivers/media/platform/apple/ave/ave-drv.c +++ b/drivers/media/platform/apple/ave/ave-drv.c @@ -51,6 +51,32 @@ static const struct ave_coproc_regs ave_coproc_6070 = { .keep_mappings = 0x400808, }; +/* + * The M1 Pro/Max (T6000/T6001) with the macOS 27.2 (26B123) stub, as on the + * MacBook Pro (J316c): iBoot preloads shared TEXT 0x13c000 and per-engine + * DATA 0x134000, filling the 64-bit link cell at TEXT 0x423c with the DATA + * alias (low 32 bits 0x13c000); with that cell zeroed the TEXT CRC is + * 0x24812842. Starts like the M1 (T8103) 27.2 build with device/type 11. + */ +static const struct ave_variant ave_t6000_26b123 = { + .regs = &ave_coproc_6070, + .fw_text_size = 0x13c000, + .fw_data_size = 0x134000, + .boot_device_id = 11, + .boot_arg_value = AVE_COPROC_BOOT_ARG_VALUE, + .timebase_multiplier = 1000000, + .vcbar_mask = GENMASK_ULL(41, 11), + .vcbar_flags = AVE_COPROC_VCBAR_VALID | AVE_COPROC_VCBAR_M1_LOADER, + .vcbar_text_phys = true, + .device_type = 11, + .lfs_ref_scale = 2, + .text_crc = AVE_FW_TEXT_CRC_T6000_26B123, + .text_link_cell = 0x423c, + .mbox_idle = 0x38, + .restore_data_first = true, + .boot_qualified = true, +}; + const struct ave_variant ave_t6000 = { .regs = &ave_coproc_6070, .fw_text_size = 0xd0000, @@ -66,6 +92,7 @@ const struct ave_variant ave_t6000 = { .extra0_size = 0x24, .boot_qualified = true, + .next_build = &ave_t6000_26b123, }; /* diff --git a/drivers/media/platform/apple/ave/ave-fw.c b/drivers/media/platform/apple/ave/ave-fw.c index 49419b14a7186..0a064b3c87c8d 100644 --- a/drivers/media/platform/apple/ave/ave-fw.c +++ b/drivers/media/platform/apple/ave/ave-fw.c @@ -50,6 +50,7 @@ static const u32 ave_known_text_crc[] = { AVE_FW_TEXT_CRC_T8122_26B123, /* encoder firmware macOS 27.2 26B123 / T8122 */ AVE_FW_TEXT_CRC_T8112_26B123, /* encoder firmware macOS 27.2 26B123 / T8112 */ AVE_FW_TEXT_CRC_T8103_26B123, /* encoder firmware 9013.55.1, macOS 27.2 / T8103 */ + AVE_FW_TEXT_CRC_T6000_26B123, /* encoder firmware macOS 27.2 26B123 / T6000/T6001 */ AVE_FW_TEXT_CRC_T8132_26B123, /* encoder firmware macOS 27.2 26B123 / T8132 */ AVE_FW_TEXT_CRC_T8142_26B123, /* encoder firmware 9013.55.1, macOS 27.2 26B123 / T8142 */ 0x460c7a7c, /* encoder firmware 6070.11.1 / T6000 */ @@ -99,13 +100,29 @@ static int ave_fw_segment(struct ave_dev *ave, unsigned int index, if (ret) goto out; - /* iommu-addresses = <&ave iova-hi iova-lo size-hi size-lo> */ + /* iommu-addresses = <&ave iova-hi iova-lo size-hi size-lo>, ... */ prop = of_get_property(np, "iommu-addresses", &len); - if (!prop || len != 5 * sizeof(u32) || - be32_to_cpup(prop) != ave->dev->of_node->phandle) { + if (!prop || len < 5 * sizeof(u32) || len % (5 * sizeof(u32))) { ret = -EINVAL; goto out; } + { + const __be32 *match = NULL; + int entries = len / (5 * sizeof(u32)); + + for (int i = 0; i < entries; i++) { + if (be32_to_cpup(prop + i * 5) == + ave->dev->of_node->phandle) { + match = prop + i * 5; + break; + } + } + if (!match) { + ret = -EINVAL; + goto out; + } + prop = match; + } seg->phys = res.start; seg->size = resource_size(&res); seg->iova = of_read_number(prop + 1, 2); diff --git a/drivers/media/platform/apple/ave/ave-layout.c b/drivers/media/platform/apple/ave/ave-layout.c index d44c2b68487b5..9f09b2e997123 100644 --- a/drivers/media/platform/apple/ave/ave-layout.c +++ b/drivers/media/platform/apple/ave/ave-layout.c @@ -1047,7 +1047,8 @@ const struct ave_fw_layout *ave_layout_for_crc(u32 crc) crc == AVE_FW_TEXT_CRC_T6041_26B123 || crc == AVE_FW_TEXT_CRC_T8122_26B123 || crc == AVE_FW_TEXT_CRC_T8112_26B123 || - crc == AVE_FW_TEXT_CRC_T8103_26B123) + crc == AVE_FW_TEXT_CRC_T8103_26B123 || + crc == AVE_FW_TEXT_CRC_T6000_26B123) return &ave_layout_26b123; /* * The M5's macOS 27.2 build (9013.55.1), between 26A428 and the 27.3 diff --git a/drivers/media/platform/apple/ave/ave.h b/drivers/media/platform/apple/ave/ave.h index c58098d734ed9..5644fbd68d979 100644 --- a/drivers/media/platform/apple/ave/ave.h +++ b/drivers/media/platform/apple/ave/ave.h @@ -202,6 +202,12 @@ enum ave_opcode { #define AVE_FW_TEXT_CRC_T8142_26A428 0x8a3784bd /* The M4 (T8132) build preloaded by the macOS 27.2 (26B123) stub. */ #define AVE_FW_TEXT_CRC_T8132_26B123 0x99fc929a +/* + * The M1 Pro/Max (T6000/T6001) build preloaded by the macOS 27.2 (26B123) + * stub: TEXT 0x13c000, DATA 0x134000, with the DATA link cell at TEXT 0x423c + * zeroed. + */ +#define AVE_FW_TEXT_CRC_T6000_26B123 0x24812842 /* * The M4 (T8132) build of encoder firmware 9003.78.0, preloaded by the * 26.6.2 (25G83) stub, with the per-boot word at TEXT 0x4224 zeroed. From af0feb11bdc520474fd5e62aed65f6a7e8a4496b Mon Sep 17 00:00:00 2001 From: Connor Chan Date: Fri, 4 Dec 2026 04:05:10 -0700 Subject: [PATCH 2/3] arm64: dts: apple: t6001: extend pmgr_south reg past ps_prores T6001's South PMGR places ps_prores at offset 0xc000 (verified from live J316c 27.2 ADT /arm-io/pmgr reg[3] size 0x74000, ps-reg[18] offset 0xc000). Extend &pmgr_south's reg length from 0xc000 to 0xc004 so ps_prores and apr1 probe cleanly on T6001. Signed-off-by: Connor Chan --- arch/arm64/boot/dts/apple/t6001.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6001.dtsi b/arch/arm64/boot/dts/apple/t6001.dtsi index 783348570df7f..f511d630be437 100644 --- a/arch/arm64/boot/dts/apple/t6001.dtsi +++ b/arch/arm64/boot/dts/apple/t6001.dtsi @@ -161,6 +161,15 @@ }; #ifndef APPLE_T6000_SUBSET +/* + * T6001 South PMGR includes ps_prores at offset 0xc000 (ADT /arm-io/pmgr + * reg[3] size 0x74000, ps-reg[18] offset 0xc000); extend past the shared + * 0xc000 base size so ps_prores and apr1 probe cleanly. + */ +&pmgr_south { + reg = <0x2 0x8e680000 0 0xc004>; +}; + /* * DRAM interface class for M1 Max: 512-bit LPDDR5-6400, the 400 GB/s class. * As on T6000, width and maximum rate are inferred from topology and the From fa82a989cb5cf0fe285d9a1efab6f150963fc66e Mon Sep 17 00:00:00 2001 From: Connor Chan Date: Fri, 4 Dec 2026 04:05:11 -0700 Subject: [PATCH 3/3] pmdomain/dts: apple: t600x: fix South pmp_report indices and honor apple,no-ack Live J316c (T6001) 27.2 ADT /arm-io/pmp/iop-pmp-nub soc-device records index South devices three slots lower than the prior T600x DT entries (afnc4_ioa=0x1a, afnc5_ioa=0x1b, dispext2=0x1d, dispext3=0x1e, venc1=0x1f, msr1=0x20, prores=0x21). Previously afnc4_ioa/afnc5_ioa occupied 0x1d/0x1e, inadvertently keeping dispext2/dispext3 requested. Additionally, soc-device-ps-group (0x0ffff803f1fffe00) has bits 26 and 27 (afnc4_ioa/afnc5_ioa) cleared (just like IOA0..IOA3), so PMP never acknowledges them in SOC-DEV-PS-ACK. Mark pmp_report_afnc4_ioa and pmp_report_afnc5_ioa with apple,no-ack and read apple,no-ack in apple_pmp_report_entry_probe() for non-start reports as well, eliminating the 1000 ms PMP acknowledgment timeout warning on wake (reducing early resume from ~1013 ms to ~11 ms on J316c). Signed-off-by: Connor Chan --- arch/arm64/boot/dts/apple/t600x-die0.dtsi | 30 ++++++++++++----------- drivers/pmdomain/apple/pmp-report.c | 2 ++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t600x-die0.dtsi b/arch/arm64/boot/dts/apple/t600x-die0.dtsi index 6d14d3e3f9701..8a319dd583ca5 100644 --- a/arch/arm64/boot/dts/apple/t600x-die0.dtsi +++ b/arch/arm64/boot/dts/apple/t600x-die0.dtsi @@ -244,61 +244,63 @@ status = "disabled"; }; - pmp_report_afnc4_ioa: report@1d { + pmp_report_afnc4_ioa: report@1a { compatible = "apple,t6000-pmp-v2-report-entry"; - reg = <0x1d>; + reg = <0x1a>; label = "pmp-afnc4-ioa"; #power-domain-cells = <0>; apple,always-on; + apple,no-ack; }; - pmp_report_afnc5_ioa: report@1e { + pmp_report_afnc5_ioa: report@1b { compatible = "apple,t6000-pmp-v2-report-entry"; - reg = <0x1e>; + reg = <0x1b>; label = "pmp-afnc5-ioa"; #power-domain-cells = <0>; apple,always-on; + apple,no-ack; }; - pmp_report_dispext2: report@20 { + pmp_report_dispext2: report@1d { compatible = "apple,t6000-pmp-v2-report-entry"; - reg = <0x20>; + reg = <0x1d>; label = "pmp-dispext2"; #power-domain-cells = <0>; power-domains = <&ps_dispext2_cpu0>; status = "disabled"; }; - pmp_report_dispext3: report@21 { + pmp_report_dispext3: report@1e { compatible = "apple,t6000-pmp-v2-report-entry"; - reg = <0x21>; + reg = <0x1e>; label = "pmp-dispext3"; #power-domain-cells = <0>; power-domains = <&ps_dispext3_cpu0>; status = "disabled"; }; - pmp_report_venc1: report@22 { + pmp_report_venc1: report@1f { compatible = "apple,t6000-pmp-v2-report-entry"; - reg = <0x22>; + reg = <0x1f>; label = "pmp-venc1"; #power-domain-cells = <0>; power-domains = <&ps_venc1_sys>; status = "disabled"; }; - pmp_report_msr1: report@23 { + pmp_report_msr1: report@20 { compatible = "apple,t6000-pmp-v2-report-entry"; - reg = <0x23>; + reg = <0x20>; label = "pmp-msr1"; #power-domain-cells = <0>; power-domains = <&ps_msr1>; status = "disabled"; }; - pmp_report_prores: report@24 { + pmp_report_prores: report@21 { compatible = "apple,t6000-pmp-v2-report-entry"; - reg = <0x24>; + reg = <0x21>; label = "pmp-prores"; #power-domain-cells = <0>; power-domains = <&ps_prores>; diff --git a/drivers/pmdomain/apple/pmp-report.c b/drivers/pmdomain/apple/pmp-report.c index c790606badd8a..a246c260f85d0 100644 --- a/drivers/pmdomain/apple/pmp-report.c +++ b/drivers/pmdomain/apple/pmp-report.c @@ -3622,6 +3622,8 @@ static int apple_pmp_report_entry_probe(struct platform_device *pdev) goto err_free; } ent->no_ack = of_property_read_bool(node, "apple,no-ack"); + } else { + ent->no_ack = of_property_read_bool(node, "apple,no-ack"); } ent->sleep_release = of_property_read_bool(node, "apple,release-for-sleep"); if (of_property_present(node, "apple,dvfs")) {