Skip to content
Draft
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
53 changes: 51 additions & 2 deletions Documentation/devicetree/bindings/iommu/apple,dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ properties:
- apple,t8103-usb4-dart
- apple,t8110-dart
- apple,t6000-dart
- apple,t8152-dart-gen3
- apple,t8152-avd-dart
- items:
- const: apple,t8140-ane-dart
- const: apple,t8140-dart
Expand Down Expand Up @@ -87,13 +89,16 @@ properties:
fabric filter (GAPF) that protects the power state of the
coprocessor CPU behind this DART, cleared to power that CPU down,
or the shared PS write-disable register that holds this DART's
bit for the same purpose (T8142)
bit for the same purpose (T8142), or on a T8152 Gen3 DART its
window in the SoC's TLB invalidation aperture (ADT
dart-tlbi-aperture plus tlbi-aperture-offset), which the Gen3
DARTs share

reg-names:
minItems: 1
items:
- const: dart
- enum: [dapf, gapf, ps-wr-dis, auxiliary]
- enum: [dapf, gapf, ps-wr-dis, auxiliary, tlbi]

interrupts:
maxItems: 1
Expand Down Expand Up @@ -350,6 +355,50 @@ allOf:
then:
required:
- reg-names
- if:
properties:
compatible:
contains:
enum:
- apple,t8152-dart-gen3
- apple,t8152-avd-dart
then:
description:
The T8152 Gen3 DARTs in front of the display coprocessors and their
display pipes belong to the SPTM. The bootloader hands them over
locked, and the operating system only adds page table entries in
root slots that are empty at handoff. Their TLB command register
answers translation queries; a stream is invalidated through the
TLB invalidation aperture instead. The T8152 AVD instance uses the
same invalidation aperture, but starts unlocked with inactive streams
and is initialized by the operating system after its PSD domain is on.
properties:
reg:
minItems: 2
reg-names:
items:
- const: dart
- const: tlbi
required:
- reg-names
else:
properties:
reg-names:
minItems: 1
items:
- const: dart
- enum: [dapf, gapf, ps-wr-dis, auxiliary]

- if:
properties:
compatible:
contains:
const: apple,t8152-avd-dart
then:
required:
- power-domains
- apple,dma-range
- apple,tunable

additionalProperties: false

Expand Down
73 changes: 73 additions & 0 deletions Documentation/devicetree/bindings/media/apple,t8152-avd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/apple,t8152-avd.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple T8152 Kopsia video decoder

maintainers:
- Thomas Glanzmann <thomas@glanzmann.de>

description:
Kopsia is the T8152 stateless video decoder. Its decoder, PIODMA and
auxiliary data streams share a Gen3 DART and a PSD power domain. The host
submits codec programs with the MCU halted and polls decoder status;
the PostOffice mailbox transport is not used by this implementation.

properties:
compatible:
const: apple,t8152-avd

reg:
items:
- description: MCU code memory
- description: MCU control registers
- description: Decoder control registers
- description: Decoder wrapper registers
- description: PIODMA registers

reg-names:
items:
- const: code
- const: mbox
- const: ctrl
- const: wrap
- const: dma

iommus:
items:
- description: Decoder stream
- description: PIODMA stream
- description: Auxiliary data stream

power-domains:
maxItems: 1

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

additionalProperties: false

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

video-codec@485400000 {
compatible = "apple,t8152-avd";
reg = <0x4 0x85400000 0x0 0x12000>,
<0x4 0x85500000 0x0 0x4000>,
<0x4 0x85100000 0x0 0x10000>,
<0x4 0x850c0000 0x0 0x4000>,
<0x4 0x85070000 0x0 0x4000>;
reg-names = "code", "mbox", "ctrl", "wrap", "dma";
iommus = <&avd_dart 0>, <&avd_dart 1>, <&avd_dart 2>;
power-domains = <&ps_avd>;
};
};
63 changes: 63 additions & 0 deletions Documentation/devicetree/bindings/power/apple,t8152-psd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/apple,t8152-psd.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple T8152 PMGR2 PSD service

maintainers:
- Thomas Glanzmann <thomas@glanzmann.de>

description:
On T8152 several blocks (the video decoder, the USB4 routers and their
PHYs, the USB controllers) are powered through PMGR2 PSD services rather
than through PMGR power-state registers. Each service has its own 0x100
byte register block at the PSD base plus 0x100 times the service number,
with a target-state request, an acknowledge bit and the current state
(0 powered, 6 cold). Reading the state consumes the acknowledge. One node
describes one service as a power domain.

allOf:
- $ref: power-domain.yaml#

properties:
compatible:
const: apple,t8152-psd

reg:
maxItems: 1

'#power-domain-cells':
const: 0

label:
description: The service's name, for the power domain.

apple,always-on:
type: boolean
description:
Keep the service powered. For a service whose consumers cannot yet
restore the state another agent set up in its blocks, such as a PHY
configured by the bootloader.

required:
- compatible
- reg
- '#power-domain-cells'

unevaluatedProperties: false

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

power-controller@303a13200 {
compatible = "apple,t8152-psd";
reg = <0x3 0x03a13200 0x0 0x100>;
#power-domain-cells = <0>;
label = "avd";
};
};
14 changes: 14 additions & 0 deletions arch/arm64/boot/dts/apple/t8152-j873-avd.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/* J873g: the Kopsia video decoder (described in t8152-peripherals.dtsi). */

&ps_avd {
status = "okay";
};

&avd_dart {
status = "okay";
};

&avd {
status = "okay";
};
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t8152-j873g.dts
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,5 @@
reg = <0x3 0x83020000 0x0 0xc000>,
<0x3 0x83040000 0x0 0xc000>;
};

#include "t8152-j873-avd.dtsi"
55 changes: 53 additions & 2 deletions arch/arm64/boot/dts/apple/t8152-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,62 @@
status = "disabled";
};

/* Kopsia decoder: PSD service 50, Gen3 DART streams 0..2. */
ps_avd: power-controller@303a13200 {
compatible = "apple,t8152-psd";
reg = <0x3 0x03a13200 0x0 0x100>;
#power-domain-cells = <0>;
label = "avd";
status = "disabled";
};

avd_dart: iommu@485020000 {
compatible = "apple,t8152-dart", "apple,t8110-dart";
reg = <0x4 0x85020000 0x0 0x20000>;
compatible = "apple,t8152-avd-dart";
reg = <0x4 0x85020000 0x0 0x20000>, <0x2 0x300 0x0 0x10>;
reg-names = "dart", "tlbi";
interrupts = <AIC_IRQ 1257 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
power-domains = <&ps_avd>;
/* A 64-GiB window within the ADT's 1..4-TiB DMA aperture. */
apple,dma-range = <0x100 0x0 0x10 0x0>;
apple,tunable = <
0x20c 0x80000121 0x80000121
0x220 0xf0f 0xf0f
0x224 0xffff 0x909
0x300 0x1f31 0x1
0x308 0x3ffffffc 0x10000000
0x310 0x3ffffffc 0x3ffffffc
0x800 0xf007f 0x10000
0x804 0xf007f 0x20002
0x808 0xf007f 0x50006
0x80c 0xf007f 0x20026
0x810 0xf007f 0x3002a
0x814 0xf007f 0x40032
0x818 0xf007f 0x0
0x81c 0xf007f 0x0
0x820 0xf007f 0x0
0x824 0xf007f 0x0
0x828 0xf007f 0x0
0x82c 0xf007f 0x0
0x830 0xf007f 0x0
0x834 0xf007f 0x0
0x838 0xf007f 0x0
0x83c 0xf007f 0x0
0x4600 0x2 0x2
>;
status = "disabled";
};

avd: video-codec@485400000 {
compatible = "apple,t8152-avd";
reg = <0x4 0x85400000 0x0 0x12000>,
<0x4 0x85500000 0x0 0x4000>,
<0x4 0x85100000 0x0 0x10000>,
<0x4 0x850c0000 0x0 0x4000>,
<0x4 0x85070000 0x0 0x4000>;
reg-names = "code", "mbox", "ctrl", "wrap", "dma";
power-domains = <&ps_avd>;
iommus = <&avd_dart 0>, <&avd_dart 1>, <&avd_dart 2>;
status = "disabled";
};

Expand Down
Loading