Skip to content
Merged
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
8 changes: 8 additions & 0 deletions Documentation/devicetree/bindings/display/apple,dcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ properties:
$ref: /schemas/types.yaml#/definitions/uint32
description: Height in pixels reserved for the display notch.

apple,pmc-interface:
$ref: /schemas/types.yaml#/definitions/phandle
description:
The PMC interface enables of this coprocessor's display pipe, an
apple,consumer-switched interface node. The coprocessor clears them
before it powers its display domains down while the display is off,
and restores them after it powers them up again.

apple,pmp-report:
$ref: /schemas/types.yaml#/definitions/phandle
description:
Expand Down
13 changes: 13 additions & 0 deletions Documentation/devicetree/bindings/iommu/apple,dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ properties:
handoff. Linux retains occupied root slots and excludes their entire
IOVA spans from allocation. This does not assert immutable descendants.

apple,clock-protection:
$ref: /schemas/types.yaml#/definitions/phandle-array
items:
- items:
- description: PS_PROT (clock protection) register bank
- description: Index of this DART's slice in the bank
description: >
The clock protection slice that guards a power state register of the
power domain of this DART. Its consumer may power that domain down: the
DART's streams are then disabled and flushed, and the slice disabled,
before the domain powers off, and the slice is enabled again when it
powers up. Only the J713 internal display DARTs use it.

apple,tunable:
$ref: /schemas/types.yaml#/definitions/uint32-matrix
items:
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/mfd/syscon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ properties:
- apm,xgene-mcb
- apm,xgene-rb
- apm,xgene-scu
- apple,t8132-ps-prot
- atmel,sama5d2-sfrbu
- atmel,sama5d3-nfc-io
- atmel,sama5d3-sfrbu
Expand Down
20 changes: 18 additions & 2 deletions Documentation/devicetree/bindings/power/apple,pmc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,28 @@ patternProperties:
maximum: 31
description: Bit of the pipe in the boost interface enable word.

apple,consumer-switched:
type: boolean
description: |
Not a power domain. The pipe's power is firmware-owned, and the
display coprocessor that refers to this node (apple,pmc-interface)
clears the bits before it powers the pipe down and gives them back
the values they had after it powers the pipe up again.

required:
- '#power-domain-cells'
- power-domains
- apple,bwr-bit
- apple,boost-bit

oneOf:
- required:
- '#power-domain-cells'
- power-domains
- required:
- apple,consumer-switched
properties:
'#power-domain-cells': false
power-domains: false

'^performance-controller@[0-9a-f]+$':
type: object
description: The host performance controller's voter agent.
Expand Down
39 changes: 39 additions & 0 deletions Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ allOf:
apple,force-disable: false
apple,force-reset: false
apple,externally-clocked: false
apple,consumer-switched: false
- if:
required:
- apple,consumer-switched
then:
required:
- apple,firmware-owned
- if:
required:
- apple,retention-workaround
then:
required:
- apple,consumer-switched

description: |
Apple SoCs include PMGR blocks responsible for power management,
Expand Down Expand Up @@ -132,6 +145,32 @@ properties:
the power-state register.
type: boolean

apple,consumer-switched:
description:
With apple,firmware-owned, the consumer of this domain may power it
off and on again around stopping its coprocessor, through the PMGR
driver, which then writes the state register. The OS otherwise treats
the domain as firmware-owned and always on. A chain of such domains
(this one and its consumer-switched parents) is powered off child first
and on parent first.
type: boolean

apple,retention-workaround:
description:
PMGR registers to set while this consumer-switched domain is off, and
to restore afterwards, as triplets of the offset in the PMGR register
block, a mask and the masked value while the domain is off. They are
set after automatic power management of the domain is disabled and
before it powers off, and restored after it powers on and before
automatic power management is enabled again.
$ref: /schemas/types.yaml#/definitions/uint32-matrix
items:
items:
- description: register offset
- description: mask
- description: value while the domain is off
maxItems: 4

apple,inherited-on:
description: |
On T8132, the boot loader hands over an active domain whose state
Expand Down
6 changes: 6 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-j713-pmgr.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,16 @@
status = "disabled";
};

/* The DCP powers these down while the display is off. */
&ps_disp_sys {
apple,firmware-owned;
apple,consumer-switched;
status = "okay";
};

&ps_disp_fe {
apple,firmware-owned;
apple,consumer-switched;
status = "okay";
};

Expand Down Expand Up @@ -531,6 +534,9 @@

&ps_disp_cpu {
apple,firmware-owned;
apple,consumer-switched;
/* Power-gate retention workaround, as macOS sets it while off. */
apple,retention-workaround = <0x2504c 0x3 0x3>, <0x25070 0x1 0x0>;
status = "okay";
};

Expand Down
16 changes: 16 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-j713.dts
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,19 @@
firmware-name = "apple/mesacal-j713.bin", "apple/msrk-j713.bin";
};

/*
* The DCP powers its display domains down while blanked
* (appledrm.power_gate_ms): the clock protection slices of its DARTs, as the
* ADT has them, and the internal pipe's PMC interface.
*/
&dcp_dart {
apple,clock-protection = <&ps_prot 42>;
};

&disp0_dart {
apple,clock-protection = <&ps_prot 8>;
};

&dcp {
apple,pmc-interface = <&pmc_disp0>;
};
12 changes: 12 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-memory.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
* boost interface enables. The PMC ignores a pipe's bandwidth
* and display clock votes while they are clear.
*/
/*
* The internal display pipe's enables. Its power states are
* firmware-owned, so they are not a power domain: its DCP
* clears them before powering the pipe down and restores them.
*/
pmc_disp0: interface-disp0 {
label = "disp0-interface";
apple,consumer-switched;
apple,bwr-bit = <0>;
apple,boost-bit = <0>;
};

pmc_dispext0: interface-dispext0 {
label = "dispext0-interface";
#power-domain-cells = <0>;
Expand Down
9 changes: 8 additions & 1 deletion arch/arm64/boot/dts/apple/t8132.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,17 @@
compatible = "apple,t8132-pmgr", "apple,t8103-pmgr", "syscon", "simple-mfd";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x3 0x80700000 0 0x14000>;
/* Up to the display CPU's power-gate retention registers. */
reg = <0x3 0x80700000 0 0x26000>;
/* child nodes are added in t8132-pmgr.dtsi */
};

/* Clock protection slices guarding power states of DART domains. */
ps_prot: syscon@38079c000 {
compatible = "apple,t8132-ps-prot", "syscon";
reg = <0x3 0x8079c000 0 0x4000>;
};

aic: interrupt-controller@381000000 {
compatible = "apple,t8132-aic3", "apple,t8122-aic3";
#interrupt-cells = <3>;
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/apple/dcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -6683,7 +6683,9 @@ static int dcp_platform_suspend(struct device *dev)

/*
* T8132: setPowerState powers the display down; the coprocessor keeps
* running and its power domains stay on, as below.
* running and its power domains stay on, as below, unless the internal
* display is blanked with appledrm.power_gate_ms set: then the
* coprocessor and its domains are powered down too (iomfb_m4_suspend()).
*/
if (iomfb_is_m4(dcp)) {
int ret = iomfb_m4_suspend(dcp);
Expand Down
Loading
Loading