diff --git a/arch/arm64/boot/dts/apple/t6040-j616s.dts b/arch/arm64/boot/dts/apple/t6040-j616s.dts index 760840b14e37a..25cded4aa83df 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -4512,6 +4512,43 @@ }; }; +/* The video encoder, its DARTs and its power domains. */ +&ps_venc0_sys { + status = "okay"; +}; + +&ps_venc0_dma { + status = "okay"; +}; + +&ps_venc0_pipe4 { + status = "okay"; +}; + +&ps_venc0_pipe5 { + status = "okay"; +}; + +&ps_venc0_me0 { + status = "okay"; +}; + +&ps_venc0_me1 { + status = "okay"; +}; + +&ave0_dart0 { + status = "okay"; +}; + +&ave0_dart1 { + status = "okay"; +}; + +&ave { + status = "okay"; +}; + #include "t6040-j616s-usb3.dtsi" /* External display chain, all disabled: the gate in drivers/soc/apple/display-gate.c enables it. */ diff --git a/arch/arm64/boot/dts/apple/t6040.dtsi b/arch/arm64/boot/dts/apple/t6040.dtsi index 8377a06f610f2..a33ef2e0abf83 100644 --- a/arch/arm64/boot/dts/apple/t6040.dtsi +++ b/arch/arm64/boot/dts/apple/t6040.dtsi @@ -1885,7 +1885,7 @@ compatible = "apple,t6041-dart", "apple,t8110-dart"; reg = <0x2 0x83080000 0x0 0xc000>; #iommu-cells = <1>; - apple,dma-range = <0x100 0x0 0x300 0x0>; + apple,dma-range = <0x100 0x00004000 0x0 0xffffc000>; interrupt-parent = <&aic>; interrupts = ; power-domains = <&ps_venc0_sys>; @@ -1896,7 +1896,7 @@ compatible = "apple,t6041-dart", "apple,t8110-dart"; reg = <0x2 0x830a0000 0x0 0xc000>; #iommu-cells = <1>; - apple,dma-range = <0x100 0x0 0x300 0x0>; + apple,dma-range = <0x100 0x00004000 0x0 0xffffc000>; interrupt-parent = <&aic>; interrupts = ; power-domains = <&ps_venc0_sys>; diff --git a/drivers/media/platform/apple/ave/ave-drv.c b/drivers/media/platform/apple/ave/ave-drv.c index 908ada4ce87a1..246d49d91b864 100644 --- a/drivers/media/platform/apple/ave/ave-drv.c +++ b/drivers/media/platform/apple/ave/ave-drv.c @@ -81,11 +81,23 @@ const struct ave_variant ave_t8112 = { .boot_qualified = true, }; -/* CRC, boot-config words and coprocessor start registers remain unqualified. */ +/* + * The M4 Pro (T6040 in the ADT, apple,t6041 in the DT) starts its encoder + * like the A18 Pro: same coprocessor registers and boot sequence, its own + * device ID and type. + */ static const struct ave_variant ave_t6041 = { + .regs = &ave_coproc_v40, .fw_text_size = 0x14c000, .fw_data_size = 0x12c000, + .boot_device_id = 27, + .boot_arg_value = AVE_COPROC_BOOT_ARG_VALUE, + .timebase_multiplier = 1, + .vcbar_mask = U64_MAX, + .vcbar_flags = AVE_COPROC_VCBAR_VALID, + .device_type = 25, .lfs_ref_scale = 2, + .boot_qualified = true, }; static const struct ave_variant ave_t8140 = { diff --git a/drivers/media/platform/apple/ave/ave-fw.c b/drivers/media/platform/apple/ave/ave-fw.c index 705588b918ce7..4311e8874a6c1 100644 --- a/drivers/media/platform/apple/ave/ave-fw.c +++ b/drivers/media/platform/apple/ave/ave-fw.c @@ -36,6 +36,7 @@ static const u32 ave_known_text_crc[] = { 0x2ce7359e, /* AppleAVE2FW 9003.78.0 */ 0x69c54454, /* AppleAVE2FW 9003.78.0 (macOS 26.0.x) */ + AVE_FW_TEXT_CRC_T6040_25G83, /* AppleAVE2FW 9003.78.0 / T6040 */ 0x460c7a7c, /* AppleAVE2FW 6070.11.1 / T6000 */ 0x25bfd039, /* AppleAVE2FW 6070.11.1 / T8112 */ }; diff --git a/drivers/media/platform/apple/ave/ave-layout.c b/drivers/media/platform/apple/ave/ave-layout.c index 91c50ea083f70..30d4d07d3abbd 100644 --- a/drivers/media/platform/apple/ave/ave-layout.c +++ b/drivers/media/platform/apple/ave/ave-layout.c @@ -529,7 +529,11 @@ const struct ave_fw_layout ave_layout_6070_11_1 = { const struct ave_fw_layout *ave_layout_for_crc(u32 crc) { - if (crc == AVE_FW_TEXT_CRC_9003_78_0) + /* + * The M4 Pro gets the same 25G83 firmware build as the A18 Pro, built + * for its own chip, and speaks the same command layout. + */ + if (crc == AVE_FW_TEXT_CRC_9003_78_0 || crc == AVE_FW_TEXT_CRC_T6040_25G83) return &ave_layout_9003_78_0; if (crc == 0x460c7a7c || crc == 0x25bfd039) return &ave_layout_6070_11_1; diff --git a/drivers/media/platform/apple/ave/ave.h b/drivers/media/platform/apple/ave/ave.h index 47a8de278011c..8358e7d26fe3e 100644 --- a/drivers/media/platform/apple/ave/ave.h +++ b/drivers/media/platform/apple/ave/ave.h @@ -127,6 +127,8 @@ enum ave_opcode { /* The firmware build whose command layouts the driver generates */ #define AVE_FW_TEXT_CRC_9003_78_0 0x69c54454 +/* The M4 Pro (T6040) build of the same 25G83 firmware. */ +#define AVE_FW_TEXT_CRC_T6040_25G83 0x68d5f9f6 struct ave_ctx;