Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions arch/arm64/boot/dts/apple/t6040-j616s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/boot/dts/apple/t6040.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <AIC_IRQ 1461 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc0_sys>;
Expand All @@ -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 = <AIC_IRQ 1461 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc0_sys>;
Expand Down
14 changes: 13 additions & 1 deletion drivers/media/platform/apple/ave/ave-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions drivers/media/platform/apple/ave/ave-fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
};
Expand Down
6 changes: 5 additions & 1 deletion drivers/media/platform/apple/ave/ave-layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/platform/apple/ave/ave.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down