Skip to content
Open
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
1 change: 0 additions & 1 deletion arch/arm64/boot/dts/apple/t600x-die0.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
label = "pmp-avd-sys";
#power-domain-cells = <0>;
power-domains = <&ps_avd_sys>;
status = "disabled";
};

pmp_report_msr0: report@12 {
Expand Down
28 changes: 28 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,34 @@
#performance-domain-cells = <0>;
};

DIE_NODE(avd): avd@286000000 {
compatible = "apple,t6000-avd";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ DIE_NO 1011 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ DIE_NO 1012 IRQ_TYPE_LEVEL_HIGH>;
#ifdef APPLE_USE_PMP
power-domains = <&DIE_NODE(pmp_report_avd_sys)>;
#else
power-domains = <&DIE_NODE(ps_avd_sys)>;
#endif
resets = <&DIE_NODE(ps_avd_sys)>;
reg = <0x2 0x87080000 0x0 0x10000>,
<0x2 0x87090000 0x0 0x10000>,
<0x2 0x870a0000 0x0 0x4000>,
<0x2 0x87100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
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(dispext0_dart): iommu@289304000 {
compatible = "apple,t6000-dart";
reg = <0x2 0x89304000 0x0 0x4000>;
Expand Down
1 change: 0 additions & 1 deletion arch/arm64/boot/dts/apple/t602x-die0.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
label = "pmp-avd-sys";
#power-domain-cells = <0>;
power-domains = <&ps_avd_sys>;
status = "disabled";
};

pmp_report_msr0: report@12 {
Expand Down
28 changes: 28 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,34 @@
#performance-domain-cells = <0>;
};

DIE_NODE(avd): avd@286000000 {
compatible = "apple,t6020-avd";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ DIE_NO 1088 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ DIE_NO 1089 IRQ_TYPE_LEVEL_HIGH>;
#ifdef APPLE_USE_PMP
power-domains = <&DIE_NODE(pmp_report_avd_sys)>;
#else
power-domains = <&DIE_NODE(ps_avd_sys)>;
#endif
resets = <&DIE_NODE(ps_avd_sys)>;
reg = <0x2 0x87080000 0x0 0x10000>,
<0x2 0x87090000 0x0 0x10000>,
<0x2 0x870a0000 0x0 0x4000>,
<0x2 0x87100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
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(dispext0_dart): iommu@289304000 {
compatible = "apple,t6020-dart", "apple,t8110-dart";
reg = <0x2 0x89304000 0x0 0x4000>;
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 @@ -642,6 +642,30 @@
status = "disabled";
};

avd: avd@30a000000 {
compatible = "apple,t6030-avd", "apple,t8122-avd";
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>;
reg = <0x3 0x0b080000 0x0 0x12000>,
<0x3 0x0b092000 0x0 0x12000>,
<0x3 0x0b0a4000 0x0 0x4000>,
<0x3 0x0b100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
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 @@ -91,6 +91,30 @@
<AIC_IRQ DIE_NO 601 IRQ_TYPE_LEVEL_HIGH>;
};

DIE_NODE(avd): avd@2cc000000 {
compatible = "apple,t6031-avd", "apple,t8122-avd";
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)>;
reg = <0x2 0xcd080000 0x0 0x12000>,
<0x2 0xcd092000 0x0 0x12000>,
<0x2 0xcd0a4000 0x0 0x4000>,
<0x2 0xcd100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
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(sio_dart): iommu@391004000 {
compatible = "apple,t6031-dart", "apple,t8110-dart";
reg = <0x3 0x91004000 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 @@ -1406,6 +1406,30 @@
};
};

avd: avd@268000000 {
compatible = "apple,t8103-avd";
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>;
reg = <0x2 0x69080000 0x0 0xc000>,
<0x2 0x6908c000 0x0 0xc000>,
<0x2 0x69098000 0x0 0x4000>,
<0x2 0x69100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
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>;
};

dispext0_dart: iommu@271304000 {
compatible = "apple,t8103-dart";
reg = <0x2 0x71304000 0x0 0x4000>;
Expand Down
29 changes: 28 additions & 1 deletion arch/arm64/boot/dts/apple/t8112.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,6 @@
label = "pmp-avd-sys";
#power-domain-cells = <0>;
power-domains = <&ps_avd_sys>;
status = "disabled";
};

pmp_report_msr: report@b {
Expand Down Expand Up @@ -1665,6 +1664,34 @@
#mbox-cells = <0>;
};

avd: avd@268000000 {
compatible = "apple,t8112-avd";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 667 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 668 IRQ_TYPE_LEVEL_HIGH>;
#ifdef APPLE_USE_PMP
power-domains = <&pmp_report_avd_sys>;
#else
power-domains = <&ps_avd_sys>;
#endif
resets = <&ps_avd_sys>;
reg = <0x2 0x69080000 0x0 0x10000>,
<0x2 0x69090000 0x0 0x10000>,
<0x2 0x690a0000 0x0 0x4000>,
<0x2 0x69100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
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>;
};

dispext0_dart: iommu@271304000 {
compatible = "apple,t8112-dart", "apple,t8110-dart";
reg = <0x2 0x71304000 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 @@ -465,6 +465,30 @@
power-domains = <&ps_sio_cpu>;
};

avd: avd@288000000 {
compatible = "apple,t8122-avd";
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>;
reg = <0x2 0x89080000 0x0 0x12000>,
<0x2 0x89092000 0x0 0x12000>,
<0x2 0x890a4000 0x0 0x4000>,
<0x2 0x89100000 0x0 0x10000>;
reg-names = "code", "sram", "mbox", "ctrl";
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
2 changes: 2 additions & 0 deletions drivers/iommu/apple-dart.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,8 @@ apple_dart_setup_translation(struct apple_dart_domain *domain,
struct io_pgtable_cfg *pgtbl_cfg =
&io_pgtable_ops_to_pgtable(domain->pgtbl_ops)->cfg;

apple_dart_hw_reset(stream_map->dart);

for (i = 0; i < pgtbl_cfg->apple_dart_cfg.n_ttbrs; ++i) {
u64 ttbr = virt_to_phys(pgtbl_cfg->apple_dart_cfg.ttbr[i]);
apple_dart_hw_set_ttbr(stream_map, i, ttbr);
Expand Down
1 change: 1 addition & 0 deletions drivers/media/platform/apple/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
comment "Apple media platform drivers"

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

obj-y += isp/
obj-y += avd/
13 changes: 13 additions & 0 deletions drivers/media/platform/apple/avd/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-only

config VIDEO_APPLE_AVD
tristate "Apple Silicon Video Decoding driver"
depends on VIDEO_DEV
depends on MEDIA_CONTROLLER
depends on ARCH_APPLE || COMPILE_TEST
depends on OF_ADDRESS
depends on V4L_PLATFORM_DRIVERS
select V4L2_MEM2MEM_DEV
select VIDEOBUF2_DMA_CONTIG
select V4L2_H264
select V4L2_VP9
4 changes: 4 additions & 0 deletions drivers/media/platform/apple/avd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only

apple-avd-y := avd-drv.o avd-v4l2.o avd-hw.o avd-h264.o avd-vp9.o
obj-$(CONFIG_VIDEO_APPLE_AVD) += apple-avd.o
Loading