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

title: An ISP block used in Apple products

maintainers:
- Sasha Finkelstein <[email protected]>

description:
The ISP in charge of webcams on ARM Apple laptops. Runs the camera
itself, and does not need to be linked to any other hardware

properties:
compatible:
items:
- enum:
- apple,t8103-isp
- apple,t8112-isp
- apple,t6000-isp
- apple,t6020-isp
- const: apple,isp

reg:
items:
- description: ASC coprocessor control
- description: Peripheral to host mailbox
- description: General-purpose ASC IO registers
- description: Host to peripheral mailbox

reg-names:
items:
- const: coproc
- const: mbox
- const: gpio
- const: mbox2

iommus:
description: All 3 must be kept in sync
maxItems: 3

interrupts:
maxItems: 1

power-domains:
minItems: 1
maxItems: 20
description: All necessary power domains. Driver will enable them in order

memory-region:
maxItems: 1

apple,platform-id:
description:
Platform id that is sent to firmware. Closer to a board id than to SoC id,
except several boards share same platform ids
$ref: /schemas/types.yaml#/definitions/uint32

apple,temporal-filter:
description:
Whether temporal filter should be enabled in firmware. Support varies
per-board, not per-SoC
$ref: /schemas/types.yaml#/definitions/uint32

required:
- compatible
- reg
- iommus
- interrupts
- power-domains
- memory-region
- apple,platform-id
- apple,temporal-filter

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/apple-aic.h>
isp: isp@2a000000 {
compatible = "apple,t8103-isp", "apple,isp";
reg = <0x2a000000 0x2000000>,
<0x2c104000 0x100>,
<0x2c104170 0x100>,
<0x2c1043f0 0x100>;
reg-names = "coproc", "mbox", "gpio", "mbox2";
iommus = <&isp_dart0 0>, <&isp_dart1 0>, <&isp_dart2 0>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 246 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_isp_sys>, <&ps_isp_set0>,
<&ps_isp_set1>, <&ps_isp_set2>, <&ps_isp_fe>,
<&ps_isp_set4>, <&ps_isp_set5>, <&ps_isp_set6>,
<&ps_isp_set7>, <&ps_isp_set8>, <&ps_isp_set9>,
<&ps_isp_set10>, <&ps_isp_set11>,
<&ps_isp_set12>;
memory-region = <&isp_heap>;
apple,platform-id = <1>;
apple,temporal-filter = <0>;
};
...
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ properties:
Forces this power domain to always be powered up.
type: boolean

apple,force-disable:
description:
Use the disable bit when turning the power off
type: boolean

apple,force-reset:
description:
Use the reset bit when turning the power off
type: boolean

apple,min-state:
description:
Specifies the minimum power state for auto-PM.
Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,7 @@ F: Documentation/devicetree/bindings/interrupt-controller/apple,*
F: Documentation/devicetree/bindings/iommu/apple,dart.yaml
F: Documentation/devicetree/bindings/iommu/apple,sart.yaml
F: Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
F: Documentation/devicetree/bindings/media/apple,isp.yaml
F: Documentation/devicetree/bindings/net/bluetooth/brcm,bcm4377-bluetooth.yaml
F: Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
F: Documentation/devicetree/bindings/nvmem/apple,efuses.yaml
Expand All @@ -2247,6 +2248,7 @@ F: drivers/i2c/busses/i2c-pasemi-platform.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/nvme/host/apple.c
F: drivers/nvmem/apple-efuses.c
F: drivers/pinctrl/pinctrl-apple-gpio.c
Expand Down
45 changes: 45 additions & 0 deletions arch/arm64/boot/dts/apple/isp-common.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* Common ISP configuration for Apple silicon platforms.
*
* Copyright The Asahi Linux Contributors
*/

/ {
aliases {
isp = &isp;
};

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

isp_heap: isp-heap {
/* Filled in by bootloder */
reg = <0 0 0 0>;
no-map;
};
};
};

&isp {
memory-region = <&isp_heap>;
status = "okay";
};

&isp_dart0 {
status = "okay";
};

&isp_dart1 {
status = "okay";
};

&isp_dart2 {
status = "okay";
};

&ps_isp_sys {
status = "okay";
};
50 changes: 50 additions & 0 deletions arch/arm64/boot/dts/apple/t600x-die0.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,56 @@
interrupts = <AIC_IRQ 0 631 IRQ_TYPE_LEVEL_HIGH>;
};

isp: isp@384000000 {
compatible = "apple,t6000-isp", "apple,isp";
reg = <0x3 0x84000000 0x0 0x2000000>,
<0x3 0x86104000 0x0 0x100>,
<0x3 0x86104170 0x0 0x100>,
<0x3 0x861043f0 0x0 0x100>;
reg-names = "coproc", "mbox", "gpio", "mbox2";
iommus = <&isp_dart0 0>, <&isp_dart1 0>, <&isp_dart2 0>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 538 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_isp_sys>, <&ps_isp_set0>,
<&ps_isp_set1>, <&ps_isp_fe>, <&ps_isp_set3>,
<&ps_isp_set4>, <&ps_isp_set5>, <&ps_isp_set6>,
<&ps_isp_set7>, <&ps_isp_set8>;
status = "disabled";
};

isp_dart0: iommu@3860e8000 {
compatible = "apple,t6000-dart";
reg = <0x3 0x860e8000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 543 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
power-domains = <&ps_isp_sys>;
apple,dma-range = <0x0 0x0 0x0 0xa0000000>;
status = "disabled";
};

isp_dart1: iommu@3860f4000 {
compatible = "apple,t6000-dart";
reg = <0x3 0x860f4000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 543 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
power-domains = <&ps_isp_sys>;
apple,dma-range = <0x0 0x0 0x0 0xa0000000>;
status = "disabled";
};

isp_dart2: iommu@3860fc000 {
compatible = "apple,t6000-dart";
reg = <0x3 0x860fc000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 543 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
power-domains = <&ps_isp_sys>;
apple,dma-range = <0x0 0x0 0x0 0xa0000000>;
status = "disabled";
};

sio_dart_0: iommu@39b004000 {
compatible = "apple,t6000-dart";
reg = <0x3 0x9b004000 0x0 0x4000>;
Expand Down
7 changes: 7 additions & 0 deletions arch/arm64/boot/dts/apple/t600x-j314-j316.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,10 @@
&fpwm0 {
status = "okay";
};

#include "isp-common.dtsi"

&isp {
apple,platform-id = <3>;
apple,temporal-filter = <0>;
};
81 changes: 81 additions & 0 deletions arch/arm64/boot/dts/apple/t600x-pmgr.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,7 @@
#reset-cells = <0>;
label = DIE_LABEL(isp_sys);
power-domains = <&DIE_NODE(ps_afnc2_lw1)>;
status = "disabled";
};

DIE_NODE(ps_venc_sys): power-controller@3b0 {
Expand Down Expand Up @@ -1456,6 +1457,86 @@
label = DIE_LABEL(venc_me1);
power-domains = <&DIE_NODE(ps_venc_me0)>;
};

/* There is a dependency tree involved with these PDs,
* but we do not express it here since the ISP driver
* is supposed to sequence them in the right order anyway
* (and we do not know the exact tree structure).
*
* This also works around spurious parent PD activation
* on machines with ISP disabled (desktops).
*/
DIE_NODE(ps_isp_set0): power-controller@4000 {
compatible = "apple,t6000-pmgr-pwrstate", "apple,pmgr-pwrstate";
reg = <0x4000 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "isp_set0";
};

DIE_NODE(ps_isp_set1): power-controller@4010 {
compatible = "apple,t6000-pmgr-pwrstate", "apple,pmgr-pwrstate";
reg = <0x4010 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "isp_set1";
};

DIE_NODE(ps_isp_fe): power-controller@4008 {
compatible = "apple,t6000-pmgr-pwrstate", "apple,pmgr-pwrstate";
reg = <0x4008 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "isp_set2";
};

DIE_NODE(ps_isp_set3): power-controller@4028 {
compatible = "apple,t6000-pmgr-pwrstate", "apple,pmgr-pwrstate";
reg = <0x4028 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "isp_set3";
};

DIE_NODE(ps_isp_set4): power-controller@4020 {
compatible = "apple,t6000-pmgr-pwrstate", "apple,pmgr-pwrstate";
reg = <0x4020 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "isp_set4";
};

DIE_NODE(ps_isp_set5): power-controller@4030 {
compatible = "apple,t6000-pmgr-pwrstate", "apple,pmgr-pwrstate";
reg = <0x4030 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "isp_set5";
};

DIE_NODE(ps_isp_set6): power-controller@4018 {
compatible = "apple,t6000-pmgr-pwrstate", "apple,pmgr-pwrstate";
reg = <0x4018 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "isp_set6";
};

DIE_NODE(ps_isp_set7): power-controller@4038 {
compatible = "apple,t6000-pmgr-pwrstate", "apple,pmgr-pwrstate";
reg = <0x4038 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "isp_set7";
};

DIE_NODE(ps_isp_set8): power-controller@4040 {
compatible = "apple,t6000-pmgr-pwrstate", "apple,pmgr-pwrstate";
reg = <0x4040 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "isp_set8";
};
};

&DIE_NODE(pmgr_south) {
Expand Down
7 changes: 7 additions & 0 deletions arch/arm64/boot/dts/apple/t8103-j293.dts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@
&fpwm1 {
status = "okay";
};

#include "isp-common.dtsi"

&isp {
apple,temporal-filter = <0>;
apple,platform-id = <1>;
};
7 changes: 7 additions & 0 deletions arch/arm64/boot/dts/apple/t8103-j313.dts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@
&fpwm1 {
status = "okay";
};

#include "isp-common.dtsi"

&isp {
apple,platform-id = <1>;
apple,temporal-filter = <0>;
};
7 changes: 7 additions & 0 deletions arch/arm64/boot/dts/apple/t8103-j456.dts
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,10 @@
&pcie0_dart_2 {
status = "okay";
};

#include "isp-common.dtsi"

&isp {
apple,platform-id = <2>;
apple,temporal-filter = <0>;
};
7 changes: 7 additions & 0 deletions arch/arm64/boot/dts/apple/t8103-j457.dts
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@
&pcie0_dart_2 {
status = "okay";
};

#include "isp-common.dtsi"

&isp {
apple,platform-id = <2>;
apple,temporal-filter = <0>;
};
Loading