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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/display/apple,t8140-display-power.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple T8140 display power words
title: Apple T8140 and T8142 display power words

maintainers:
- Diljit Singh <hey@djdev.me>
Expand All @@ -17,25 +17,56 @@ description:

properties:
compatible:
const: apple,t8140-display-power
enum:
- apple,t8140-display-power
- apple,t8142-display-power

reg:
items:
- description: the display PMC word that counts the powered coprocessors
- description: the power manager's power state words
- description: the power manager's power gate words
minItems: 2
maxItems: 3

reg-names:
items:
- const: pmc-dcp
- const: ps
- const: pwrgate
minItems: 2
maxItems: 3

required:
- compatible
- reg
- reg-names

allOf:
- if:
properties:
compatible:
const: apple,t8140-display-power
then:
properties:
reg:
items:
- description: the display PMC word that counts the powered coprocessors
- description: the power manager's power state words
- description: the power manager's power gate words
reg-names:
items:
- const: pmc-dcp
- const: ps
- const: pwrgate
- if:
properties:
compatible:
const: apple,t8142-display-power
then:
# T8142's PMC keeps no count of the powered coprocessors: no pmc-dcp word.
properties:
reg:
items:
- description: the power manager's power gate words
- description: the power manager's power state words
reg-names:
items:
- const: pwrgate
- const: ps

additionalProperties: false

examples:
Expand All @@ -52,3 +83,16 @@ examples:
reg-names = "pmc-dcp", "ps", "pwrgate";
};
};

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

display-power@380724000 {
compatible = "apple,t8142-display-power";
reg = <0x3 0x80724000 0x0 0x2000>,
<0x3 0x80700000 0x0 0x14000>;
reg-names = "pwrgate", "ps";
};
};
14 changes: 12 additions & 2 deletions Documentation/devicetree/bindings/iommu/apple,dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ properties:
Address filter (DAPF) registers, which restrict the physical
addresses the DART lets its masters reach, or the slice of the
fabric filter (GAPF) that protects the power state of the
coprocessor CPU behind this DART, cleared to power that CPU down
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)

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

interrupts:
maxItems: 1
Expand Down Expand Up @@ -234,6 +236,14 @@ properties:
present and the word reads one of the two; otherwise it refuses the
sleep. Set by the boot loader.

apple,ps-wr-dis-bit:
$ref: /schemas/types.yaml#/definitions/uint32
maximum: 31
description: >
This DART's bit in the ps-wr-dis register: set, the fabric rejects
writes to the power state of the coprocessor CPU behind it. Required
with a ps-wr-dis register; only that bit of the register is changed.

apple,manual-availability:
type: boolean
description: >
Expand Down
27 changes: 27 additions & 0 deletions arch/arm64/boot/dts/apple/t8142-j813-display.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@
#mbox-cells = <0>;
};

/*
* The internal display's power words for a DCP firmware stop (DPMS off):
* /arm-io/pmgr reg[34] (pwrgate: DISP_CPU's retention words 0x11cc and
* 0x11f0, the pmgr's retention_config_ff/_mem) and reg[32] (ps: DISP_CPU
* 0x10000, DISP_FE 0x318, DISP_SYS 0x290). T8142's PMC keeps no count of
* powered DCPs, so there is no pmc-dcp word.
*/
dcp_power: display-power@380724000 {
compatible = "apple,t8142-display-power";
reg = <3 0x80724000 0 0x2000>,
<3 0x80700000 0 0x14000>;
reg-names = "pwrgate", "ps";
};

dcp: dcp@286e00000 {
compatible = "apple,t8142-dcp", "apple,dcp";
mboxes = <&dcp_mbox>;
Expand All @@ -66,6 +80,7 @@
<2 0x86850000 0 0x4000>;
apple,bw-scratch = <&pmgr_dcp 0 5 0>;
apple,bw-doorbell = <&pmgr_dcp 1 6>;
apple,display-power = <&dcp_power>;
/* Scan out the primary plane on IOMFB surface 2. */
apple,iomfb-surfaces = <0 0 1 0>;
/*
Expand Down Expand Up @@ -108,7 +123,19 @@
apple,dma-range = <0x100 0x0 0x10 0x0>;
};

/*
* ps-wr-dis: the DCP DART's PS write-disable bit, which T8142 has instead
* of T8140's GAPF slice. ADT dart-dcp clock-protection-wr-dis-id
* <0x1f 0xff>, /chosen/dart-ps-wr-dis-entries[0x1f] = offset 0x3fdc in
* /arm-io/pmgr reg[1] (0x380714000), bit 6. Set, the fabric rejects writes
* to DISP_CPU's power word; the DART driver clears it while the DCP is
* stopped.
*/
&dcp_dart {
reg = <2 0x86340000 0 0x20000>,
<3 0x80717fdc 0 0x4>;
reg-names = "dart", "ps-wr-dis";
apple,ps-wr-dis-bit = <6>;
apple,dma-range = <0x100 0x0 0x10 0x0>;
status = "okay";
};
Expand Down
27 changes: 27 additions & 0 deletions drivers/gpu/drm/apple/dcp-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,24 @@ struct dcp_panel {
const struct dcp_color_space *color_target;
};

/*
* The internal display's power words for hw.s2r, see dcp_s2r_domains_off(): its domains'
* offsets in "ps", its retention controls in "pwrgate" (the PMGR's per-device "retention"
* words: flip-flops 3 off / 0 on, memories 0 off / 1 on), and the DART streams its firmware
* and scanout use.
*/
struct dcp_s2r_layout {
u32 disp_cpu;
u32 disp_fe;
u32 disp_sys;
u32 ret_ff;
u32 ret_mem;
u32 dcp_streams;
u32 disp_streams;
/* "pmc-dcp" counts the powered DCPs: T8132 and T8140 only */
bool pmc_dcp;
};

/*
* Identity of a fixed internal panel, for the EDID published on its
* connector. Any processor with an internal panel allocates it; the boot
Expand Down Expand Up @@ -298,6 +316,15 @@ struct apple_dcp_hw_data {
/* A firmware 27 sleep in progress, and how it ended */
bool v27_sleep_protocol;
bool v27_sleep_recovery;
/* Required with @s2r */
const struct dcp_s2r_layout *s2r_layout;
/* @s2r with derived power words: off unless appledrm.s2r_untested is set */
bool s2r_untested;
/*
* @s2r without a secure mailbox: the SoC's ADT has no dcp-exclave-mailbox (T8142, on
* firmware 27.0 and 27.2.1), so there is no secure port to idle before the IOP.
*/
bool s2r_no_secure_port;
};

enum dcp_test_point {
Expand Down
Loading
Loading