Skip to content
Closed
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
16 changes: 12 additions & 4 deletions Documentation/admin-guide/media/apple-ave.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ The encoder runs firmware on its own coprocessor. The bootloader loads it into
two reserved, DART-mapped segments (TEXT and DATA) but does not start it. The
Aurora Stage 2 loader passes both regions in the device's ``memory-region``
property and records their CRC32 under ``/chosen`` as
``aurora,ave-text-crc32`` and ``aurora,ave-data-crc32``. The driver only binds
while DATA still matches the recorded checksum, and keeps a copy of DATA that
it restores before every firmware boot.
``aurora,ave-text-crc32`` and ``aurora,ave-data-crc32``. The loader may also
record each segment's CRC32 as ``aurora,crc32`` on its reservation, as it
must when two encoders' DATA differ, and a segment shared by two encoders
has one ``iommu-addresses`` entry per encoder; the driver prefers the
reservation's value. The driver only binds while DATA still matches the
recorded checksum, and keeps a copy of DATA that it restores before every
firmware boot.

No firmware files are needed. The driver builds every command itself,
including the two large session commands (Start and Process), from the
Expand Down Expand Up @@ -113,7 +117,7 @@ checkout, add ``--compare-baseline /path/to/old/drivers/media/platform/apple/ave
Private capture comparisons must keep captured images outside the source tree
and mask only addresses, session tokens, clocks and host bookkeeping fields.

With debugfs mounted, ``apple-ave/last_start_h264``,
With debugfs mounted, ``apple-ave-<device>/last_start_h264``,
``last_start_hevc``, ``last_process0_h264`` and ``last_process0_hevc`` hold the
last Start command built and the first Process command of the last session,
for comparison with reference captures.
Expand All @@ -125,6 +129,10 @@ The firmware boots when the first stream starts and is halted when the last
one ends, as macOS does; the next stream starts it from reset. Runtime PM
powers the encoder down two seconds after the last stream.

A stream's buffers are freed only after that power cycle. While one stream
stays open, up to four streams that ended keep their buffers; a further
stream then fails to start with ``EBUSY`` until every stream has closed.

Up to five frames per stream are inside the firmware at once (three without
B-frames). The firmware reorders B-frames itself, so CAPTURE buffers come
back in bitstream order, each with the timestamp of the frame it codes.
Expand Down
20 changes: 5 additions & 15 deletions arch/arm64/boot/dts/apple/t6020-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -613,13 +613,13 @@
status = "disabled";
};

m2_dart_ave0_2: iommu@40d020000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x4 0xd020000 0x0 0x4000>;
m2_ave0_dma: dma-controller@40d020000 {
compatible = "apple,t6000-ave-dma", "apple,ave-dma";
reg = <0x4 0xd020000 0x0 0x4000>,
<0x4 0xd044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys>;
#iommu-cells = <1>;
status = "disabled";
};

Expand All @@ -643,16 +643,6 @@
status = "disabled";
};

m2_dart_ave0_3: iommu@40d044000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x4 0xd044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys>;
#iommu-cells = <1>;
status = "disabled";
};

m2_ave0: video-codec@40d100000 {
compatible = "apple,t6020-ave", "apple,ave";
power-domain-names = "dma", "pipe4", "pipe5", "me0", "me1", "perf";
Expand All @@ -668,7 +658,7 @@
<AIC_IRQ 0 1103 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1106 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1105 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&m2_dart_ave0_0 0>, <&m2_dart_ave0_1 0>, <&m2_dart_ave0_2 0>, <&m2_dart_ave0_3 0>;
iommus = <&m2_dart_ave0_0 0>, <&m2_dart_ave0_1 0>;
power-domains = <&ps_venc_dma>, <&ps_venc_pipe4>, <&ps_venc_pipe5>, <&ps_venc_me0>, <&ps_venc_me1>, <&ps_afr>;
status = "disabled";
};
Expand Down
66 changes: 30 additions & 36 deletions arch/arm64/boot/dts/apple/t6021-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -791,13 +791,19 @@
status = "disabled";
};

m2_dart_ave0_2: iommu@40d020000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x4 0xd020000 0x0 0x4000>;
/*
* Stays disabled: apple-ave-dma has no runtime PM, so with it bound
* ps_venc_sys never powers off, the encoder's power cycle no longer
* resets the coprocessor, and after the first session's Halt the
* firmware does not boot again.
*/
m2_ave0_dma: dma-controller@40d020000 {
compatible = "apple,t6000-ave-dma", "apple,ave-dma";
reg = <0x4 0xd020000 0x0 0x4000>,
<0x4 0xd044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys>;
#iommu-cells = <1>;
status = "disabled";
};

Expand All @@ -808,7 +814,6 @@
interrupts = <AIC_IRQ 0 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys>;
#iommu-cells = <1>;
status = "disabled";
};

m2_dart_ave0_1: iommu@40d040000 {
Expand All @@ -818,19 +823,12 @@
interrupts = <AIC_IRQ 0 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys>;
#iommu-cells = <1>;
status = "disabled";
};

m2_dart_ave0_3: iommu@40d044000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x4 0xd044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys>;
#iommu-cells = <1>;
status = "disabled";
};

/*
* The boot loader hands this encoder the firmware iBoot preloaded, or
* disables it; without a handoff the driver does not bind.
*/
m2_ave0: video-codec@40d100000 {
compatible = "apple,t6021-ave", "apple,ave";
power-domain-names = "dma", "pipe4", "pipe5", "me0", "me1", "perf";
Expand All @@ -846,9 +844,8 @@
<AIC_IRQ 0 1103 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1106 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1105 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&m2_dart_ave0_0 0>, <&m2_dart_ave0_1 0>, <&m2_dart_ave0_2 0>, <&m2_dart_ave0_3 0>;
iommus = <&m2_dart_ave0_0 0>, <&m2_dart_ave0_1 0>;
power-domains = <&ps_venc_dma>, <&ps_venc_pipe4>, <&ps_venc_pipe5>, <&ps_venc_me0>, <&ps_venc_me1>, <&ps_afr>;
status = "disabled";
};

m2_dart_dispext2_1: iommu@48d300000 {
Expand Down Expand Up @@ -883,13 +880,19 @@
status = "disabled";
};

m2_dart_ave1_2: iommu@507020000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x5 0x7020000 0x0 0x4000>;
/*
* Stays disabled: apple-ave-dma has no runtime PM, so with it bound
* ps_venc1_sys never powers off, the encoder's power cycle no longer
* resets the coprocessor, and after the first session's Halt the
* firmware does not boot again.
*/
m2_ave1_dma: dma-controller@507020000 {
compatible = "apple,t6000-ave-dma", "apple,ave-dma";
reg = <0x5 0x7020000 0x0 0x4000>,
<0x5 0x7044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1119 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc1_sys>;
#iommu-cells = <1>;
status = "disabled";
};

Expand All @@ -900,7 +903,6 @@
interrupts = <AIC_IRQ 0 1119 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc1_sys>;
#iommu-cells = <1>;
status = "disabled";
};

m2_dart_ave1_1: iommu@507040000 {
Expand All @@ -910,19 +912,12 @@
interrupts = <AIC_IRQ 0 1119 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc1_sys>;
#iommu-cells = <1>;
status = "disabled";
};

m2_dart_ave1_3: iommu@507044000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x5 0x7044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1119 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc1_sys>;
#iommu-cells = <1>;
status = "disabled";
};

/*
* The boot loader hands this encoder the firmware iBoot preloaded, or
* disables it; without a handoff the driver does not bind.
*/
m2_ave1: video-codec@507100000 {
compatible = "apple,t6021-ave", "apple,ave";
power-domain-names = "dma", "pipe4", "pipe5", "me0", "me1", "perf";
Expand All @@ -938,9 +933,8 @@
<AIC_IRQ 0 1115 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1118 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1117 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&m2_dart_ave1_0 0>, <&m2_dart_ave1_1 0>, <&m2_dart_ave1_2 0>, <&m2_dart_ave1_3 0>;
iommus = <&m2_dart_ave1_0 0>, <&m2_dart_ave1_1 0>;
power-domains = <&ps_venc1_dma>, <&ps_venc1_pipe4>, <&ps_venc1_pipe5>, <&ps_venc1_me0>, <&ps_venc1_me1>, <&ps_afr>;
status = "disabled";
};

m2_dart_dispext3_1: iommu@50d300000 {
Expand Down
80 changes: 20 additions & 60 deletions arch/arm64/boot/dts/apple/t6022-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1153,13 +1153,13 @@
status = "disabled";
};

m2_dart_ave0_2: iommu@40d020000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x4 0xd020000 0x0 0x4000>;
m2_ave0_dma: dma-controller@40d020000 {
compatible = "apple,t6000-ave-dma", "apple,ave-dma";
reg = <0x4 0xd020000 0x0 0x4000>,
<0x4 0xd044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys>;
#iommu-cells = <1>;
status = "disabled";
};

Expand All @@ -1183,16 +1183,6 @@
status = "disabled";
};

m2_dart_ave0_3: iommu@40d044000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x4 0xd044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys>;
#iommu-cells = <1>;
status = "disabled";
};

m2_ave0: video-codec@40d100000 {
compatible = "apple,t6022-ave", "apple,ave";
power-domain-names = "dma", "pipe4", "pipe5", "me0", "me1", "perf";
Expand All @@ -1208,7 +1198,7 @@
<AIC_IRQ 0 1103 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1106 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1105 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&m2_dart_ave0_0 0>, <&m2_dart_ave0_1 0>, <&m2_dart_ave0_2 0>, <&m2_dart_ave0_3 0>;
iommus = <&m2_dart_ave0_0 0>, <&m2_dart_ave0_1 0>;
power-domains = <&ps_venc_dma>, <&ps_venc_pipe4>, <&ps_venc_pipe5>, <&ps_venc_me0>, <&ps_venc_me1>, <&ps_afr>;
status = "disabled";
};
Expand Down Expand Up @@ -1311,13 +1301,13 @@
status = "disabled";
};

m2_dart_ave1_2: iommu@507020000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x5 0x7020000 0x0 0x4000>;
m2_ave1_dma: dma-controller@507020000 {
compatible = "apple,t6000-ave-dma", "apple,ave-dma";
reg = <0x5 0x7020000 0x0 0x4000>,
<0x5 0x7044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1119 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc1_sys>;
#iommu-cells = <1>;
status = "disabled";
};

Expand All @@ -1341,16 +1331,6 @@
status = "disabled";
};

m2_dart_ave1_3: iommu@507044000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x5 0x7044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 1119 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc1_sys>;
#iommu-cells = <1>;
status = "disabled";
};

m2_ave1: video-codec@507100000 {
compatible = "apple,t6022-ave", "apple,ave";
power-domain-names = "dma", "pipe4", "pipe5", "me0", "me1", "perf";
Expand All @@ -1366,7 +1346,7 @@
<AIC_IRQ 0 1115 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1118 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1117 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&m2_dart_ave1_0 0>, <&m2_dart_ave1_1 0>, <&m2_dart_ave1_2 0>, <&m2_dart_ave1_3 0>;
iommus = <&m2_dart_ave1_0 0>, <&m2_dart_ave1_1 0>;
power-domains = <&ps_venc1_dma>, <&ps_venc1_pipe4>, <&ps_venc1_pipe5>, <&ps_venc1_me0>, <&ps_venc1_me1>, <&ps_afr>;
status = "disabled";
};
Expand Down Expand Up @@ -1966,13 +1946,13 @@
status = "disabled";
};

m2_dart_ave2_2: iommu@40d020000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x4 0xd020000 0x0 0x4000>;
m2_ave2_dma: dma-controller@40d020000 {
compatible = "apple,t6000-ave-dma", "apple,ave-dma";
reg = <0x4 0xd020000 0x0 0x4000>,
<0x4 0xd044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys_die1>;
#iommu-cells = <1>;
status = "disabled";
};

Expand All @@ -1996,16 +1976,6 @@
status = "disabled";
};

m2_dart_ave2_3: iommu@40d044000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x4 0xd044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1 1107 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc_sys_die1>;
#iommu-cells = <1>;
status = "disabled";
};

m2_ave2: video-codec@40d100000 {
compatible = "apple,t6022-ave", "apple,ave";
power-domain-names = "dma", "pipe4", "pipe5", "me0", "me1", "perf";
Expand All @@ -2021,7 +1991,7 @@
<AIC_IRQ 1 1103 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 1 1106 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 1 1105 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&m2_dart_ave2_0 0>, <&m2_dart_ave2_1 0>, <&m2_dart_ave2_2 0>, <&m2_dart_ave2_3 0>;
iommus = <&m2_dart_ave2_0 0>, <&m2_dart_ave2_1 0>;
power-domains = <&ps_venc_dma_die1>, <&ps_venc_pipe4_die1>, <&ps_venc_pipe5_die1>, <&ps_venc_me0_die1>, <&ps_venc_me1_die1>, <&ps_afr_die1>;
status = "disabled";
};
Expand Down Expand Up @@ -2124,13 +2094,13 @@
status = "disabled";
};

m2_dart_ave3_2: iommu@507020000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x5 0x7020000 0x0 0x4000>;
m2_ave3_dma: dma-controller@507020000 {
compatible = "apple,t6000-ave-dma", "apple,ave-dma";
reg = <0x5 0x7020000 0x0 0x4000>,
<0x5 0x7044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1 1119 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc1_sys_die1>;
#iommu-cells = <1>;
status = "disabled";
};

Expand All @@ -2154,16 +2124,6 @@
status = "disabled";
};

m2_dart_ave3_3: iommu@507044000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x5 0x7044000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1 1119 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_venc1_sys_die1>;
#iommu-cells = <1>;
status = "disabled";
};

m2_ave3: video-codec@507100000 {
compatible = "apple,t6022-ave", "apple,ave";
power-domain-names = "dma", "pipe4", "pipe5", "me0", "me1", "perf";
Expand All @@ -2179,7 +2139,7 @@
<AIC_IRQ 1 1115 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 1 1118 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 1 1117 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&m2_dart_ave3_0 0>, <&m2_dart_ave3_1 0>, <&m2_dart_ave3_2 0>, <&m2_dart_ave3_3 0>;
iommus = <&m2_dart_ave3_0 0>, <&m2_dart_ave3_1 0>;
power-domains = <&ps_venc1_dma_die1>, <&ps_venc1_pipe4_die1>, <&ps_venc1_pipe5_die1>, <&ps_venc1_me0_die1>, <&ps_venc1_me1_die1>, <&ps_afr_die1>;
status = "disabled";
};
Expand Down
Loading
Loading