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
112 changes: 112 additions & 0 deletions Documentation/devicetree/bindings/media/apple,avd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/apple,avd.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple Video Decoder (AVD)

description: |
AVD is a stateless video decode IP block present on Apple devices.
Notably it includes an ARM Cortex-M3 and associated DMA controller.
AVD is capable of decoding H264, H265, VP9 and AV1 on never SoCs.

The IP does not change much, with changes being mostly the CM3 having more
memory and interrupts.

maintainers:
- Sofus <[email protected]>

properties:
compatible:
oneOf:
- items:
- enum:
- apple,t6030-avd
- apple,t6031-avd
- const: apple,t8122-avd
- enum:
- apple,t8103-avd
- apple,t8112-avd
- apple,t8122-avd
- apple,t6000-avd
- apple,t6020-avd

reg:
minItems: 4
items:
- description: Cortex-M3 code (unsigned)
- description: Cortex-M3 sram
- description: Mailbox
- description: Video decode control
- description: DMA control

reg-names:
items:
- const: code
- const: sram
- const: mbox
- const: ctrl

iommus:
minItems: 1
maxItems: 3
description: |
The block contains 3 iommus, one for decode operations, one the DMA
controller can use and the last for decoding drm-protected content.

power-domains:
maxItems: 1

resets:
maxItems: 1

interrupts:
minItems: 2
items:
- description: mailbox 0
- description: mailbox 1
- description: mailbox 2
- description: mailbox 3
- description: flag 0
- description: flag 1
- description: DMA status
description: |
Notably there are no decode related interrupts. All decode related
interrupts are sent to the CM3.

required:
- compatible
- reg
- interrupts
- reg-names
- iommus
- power-domains
- resets

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/apple-aic.h>
#include <dt-bindings/interrupt-controller/irq.h>

soc {
#address-cells = <2>;
#size-cells = <2>;

avd: avd@289080000 {
compatible = "apple,t8122-avd";
reg = <0x2 0x89080000 0x0 0x12000>,
<0x2 0x89092000 0x0 0x12000>,
<0x2 0x890a4000 0x0 0x4000>,
<0x2 0x89100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 679 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 680 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_avd_sys>;
resets = <&ps_avd_sys>;
iommus = <&avd_dart 0>;
};
};
10 changes: 9 additions & 1 deletion Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ All components are stored with the same number of bits per component.
- Cb, Cr
- No
- Linear
* - V4L2_PIX_FMT_P210
- 'P210'
- 10
- 4:2:2
- Cb, Cr
- Yes
- Linear
* - V4L2_PIX_FMT_NV15
- 'NV15'
- 10
Expand Down Expand Up @@ -834,8 +841,9 @@ number of lines as the luma plane.

.. _V4L2_PIX_FMT_P010:
.. _V4L2-PIX-FMT-P010-4L4:
.. _V4L2-PIX-FMT-P210:

P010 and tiled P010
P010, tiled P010 and P210
-------------------

P010 is like NV12 with 10 bits per component, expanded to 16 bits.
Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,7 @@ F: Documentation/devicetree/bindings/iommu/apple,dart.yaml
F: Documentation/devicetree/bindings/iommu/apple,sart.yaml
F: Documentation/devicetree/bindings/leds/backlight/apple,dwi-bl.yaml
F: Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
F: Documentation/devicetree/bindings/media/apple,avd.yaml
F: Documentation/devicetree/bindings/mfd/apple,smc.yaml
F: Documentation/devicetree/bindings/net/bluetooth/brcm,bcm4377-bluetooth.yaml
F: Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
Expand Down Expand Up @@ -2675,6 +2676,7 @@ F: drivers/input/touchscreen/apple_z2.c
F: drivers/iommu/apple-dart.c
F: drivers/iommu/io-pgtable-dart.c
F: drivers/irqchip/irq-apple-aic.c
F: drivers/media/platform/apple/*
F: drivers/mfd/macsmc.c
F: drivers/nvme/host/apple.c
F: drivers/nvmem/apple-efuses.c
Expand Down
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/apple/t600x-dieX.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,30 @@
#performance-domain-cells = <0>;
};

DIE_NODE(avd): avd@287080000 {
compatible = "apple,t6000-avd";
reg = <0x2 0x87080000 0x0 0x10000>,
<0x2 0x87090000 0x0 0x10000>,
<0x2 0x870a0000 0x0 0x4000>,
<0x2 0x87100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ DIE_NO 1011 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ DIE_NO 1012 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&DIE_NODE(ps_avd_sys)>;
resets = <&DIE_NODE(ps_avd_sys)>;
iommus = <&DIE_NODE(avd_dart) 0>;
};

DIE_NODE(avd_dart): iommu@287010000 {
compatible = "apple,t8110-dart";
reg = <0x2 0x87010000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ DIE_NO 1018 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&DIE_NODE(ps_avd_sys)>;
};

DIE_NODE(pmgr): power-management@28e080000 {
compatible = "apple,t6000-pmgr", "apple,pmgr", "syscon", "simple-mfd";
#address-cells = <1>;
Expand Down
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/apple/t602x-dieX.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@
#performance-domain-cells = <0>;
};

DIE_NODE(avd): avd@287080000 {
compatible = "apple,t6020-avd";
reg = <0x2 0x87080000 0x0 0x10000>,
<0x2 0x87090000 0x0 0x10000>,
<0x2 0x870a0000 0x0 0x4000>,
<0x2 0x87100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ DIE_NO 1088 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ DIE_NO 1089 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&DIE_NODE(ps_avd_sys)>;
resets = <&DIE_NODE(ps_avd_sys)>;
iommus = <&DIE_NODE(avd_dart) 0>;
};

DIE_NODE(avd_dart): iommu@287010000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x2 0x87010000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ DIE_NO 1095 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&DIE_NODE(ps_avd_sys)>;
};

DIE_NODE(pmgr): power-management@28e080000 {
compatible = "apple,t6020-pmgr", "apple,t8103-pmgr", "syscon", "simple-mfd";
#address-cells = <1>;
Expand Down
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/apple/t6030.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,30 @@
/* child nodes are added in t6030-pmgr.dtsi */
};

avd: avd@30b080000 {
compatible = "apple,t6030-avd", "apple,t8122-avd";
reg = <0x3 0x0b080000 0x0 0x12000>,
<0x3 0x0b092000 0x0 0x12000>,
<0x3 0x0b0a4000 0x0 0x4000>,
<0x3 0x0b100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 788 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 789 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_avd_sys>;
resets = <&ps_avd_sys>;
iommus = <&avd_dart 0>;
};

avd_dart: iommu@30b010000 {
compatible = "apple,t6030-dart", "apple,t8110-dart";
reg = <0x3 0x0b010000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 795 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_avd_sys>;
};

pinctrl_ap: pinctrl@347100000 {
compatible = "apple,t6030-pinctrl", "apple,t8103-pinctrl";
reg = <0x3 0x47100000 0x0 0x4000>;
Expand Down
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/apple/t6031-dieX.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,30 @@
<AIC_IRQ DIE_NO 601 IRQ_TYPE_LEVEL_HIGH>;
};

DIE_NODE(avd): avd@2cd080000 {
compatible = "apple,t6031-avd", "apple,t8122-avd";
reg = <0x2 0xcd080000 0x0 0x12000>,
<0x2 0xcd092000 0x0 0x12000>,
<0x2 0xcd0a4000 0x0 0x4000>,
<0x2 0xcd100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ DIE_NO 1185 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ DIE_NO 1186 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&DIE_NODE(ps_avd_sys)>;
resets = <&DIE_NODE(ps_avd_sys)>;
iommus = <&DIE_NODE(avd_dart) 0>;
};

DIE_NODE(avd_dart): iommu@2cd010000 {
compatible = "apple,t6031-dart", "apple,t8110-dart";
reg = <0x2 0xcd010000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ DIE_NO 1192 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&DIE_NODE(ps_avd_sys)>;
};

DIE_NODE(pinctrl_ap): pinctrl@2b3000000 {
compatible = "apple,t6031-pinctrl", "apple,t8103-pinctrl";
reg = <0x2 0xb3000000 0x0 0x4000>;
Expand Down
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/apple/t8103.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,30 @@
<AIC_IRQ 274 IRQ_TYPE_LEVEL_HIGH>;
};

avd: avd@269080000 {
compatible = "apple,t8103-avd";
reg = <0x2 0x69080000 0x0 0xc000>,
<0x2 0x6908c000 0x0 0xc000>,
<0x2 0x69098000 0x0 0x4000>,
<0x2 0x69100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 540 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 541 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_avd_sys>;
resets = <&ps_avd_sys>;
iommus = <&avd_dart 0>;
};

avd_dart: iommu@269010000 {
compatible = "apple,t8103-dart";
reg = <0x2 0x69010000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 547 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_avd_sys>;
};

ans_mbox: mbox@277408000 {
compatible = "apple,t8103-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x2 0x77408000 0x0 0x4000>;
Expand Down
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/apple/t8112.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,30 @@
<AIC_IRQ 307 IRQ_TYPE_LEVEL_HIGH>;
};

avd: avd@269080000 {
compatible = "apple,t8112-avd";
reg = <0x2 0x69080000 0x0 0x10000>,
<0x2 0x69090000 0x0 0x10000>,
<0x2 0x690a0000 0x0 0x4000>,
<0x2 0x69100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 667 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 668 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_avd_sys>;
resets = <&ps_avd_sys>;
iommus = <&avd_dart 0>;
};

avd_dart: iommu@269010000 {
compatible = "apple,t8110-dart";
reg = <0x2 0x69010000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 674 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_avd_sys>;
};

ans_mbox: mbox@277408000 {
compatible = "apple,t8112-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x2 0x77408000 0x0 0x4000>;
Expand Down
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/apple/t8122.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,30 @@
status = "disabled";
};

avd: avd@289080000 {
compatible = "apple,t8122-avd";
reg = <0x2 0x89080000 0x0 0x12000>,
<0x2 0x89092000 0x0 0x12000>,
<0x2 0x890a4000 0x0 0x4000>,
<0x2 0x89100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 679 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 680 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_avd_sys>;
resets = <&ps_avd_sys>;
iommus = <&avd_dart 0>;
};

avd_dart: iommu@289010000 {
compatible = "apple,t8122-dart", "apple,t8110-dart";
reg = <0x2 0x89010000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 686 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_avd_sys>;
};

fpwm1: pwm@2a1044000 {
compatible = "apple,t8122-fpwm", "apple,s5l-fpwm";
reg = <0x2 0xa1044000 0x0 0x4000>;
Expand Down
1 change: 1 addition & 0 deletions drivers/media/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ source "drivers/media/platform/allegro-dvt/Kconfig"
source "drivers/media/platform/amd/Kconfig"
source "drivers/media/platform/amlogic/Kconfig"
source "drivers/media/platform/amphion/Kconfig"
source "drivers/media/platform/apple/Kconfig"
source "drivers/media/platform/arm/Kconfig"
source "drivers/media/platform/aspeed/Kconfig"
source "drivers/media/platform/atmel/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/media/platform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ obj-y += allegro-dvt/
obj-y += amd/
obj-y += amlogic/
obj-y += amphion/
obj-y += apple/
obj-y += arm/
obj-y += aspeed/
obj-y += atmel/
Expand Down
5 changes: 5 additions & 0 deletions drivers/media/platform/apple/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only

comment "Apple media platform drivers"

source "drivers/media/platform/apple/avd/Kconfig"
3 changes: 3 additions & 0 deletions drivers/media/platform/apple/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only

obj-y += avd/
Loading