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 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/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. 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")) {