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
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/apple,pmp-v1-report-entry.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple PMPv1 Report Entry Power Domains

maintainers:
- Didi Nuk <dev@ydnuk.com>

description:
Apple PMPv1 report-entry nodes expose individual PMP-managed resources as
generic power domains. The PMP driver requires a report-entry node for each
SoC-specific PMP-managed resource.

properties:
compatible:
const: apple,t8103-pmp-v1-report-entry

reg:
maxItems: 1

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

power-domains:
maxItems: 1

label:
description:
Specifies the name of the SoC report entry domain. This is used to
name the report entry domains.

apple,always-on:
description:
Forces this power domain to always be powered up.
type: boolean

required:
- compatible
- reg
- label
- "#power-domain-cells"
- power-domains

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

title: Apple PMPv1 Power Domains

maintainers:
- Didi Nuk <dev@ydnuk.com>

description:
Apple PMPv1 power domains are controlled by the Apple Power Management
Processor (PMP).

properties:
compatible:
const: apple,t8103-pmp-v1

reg:
maxItems: 2

reg-names:
items:
- const: pmp
- const: asc

mboxes:
maxItems: 1

mbox-names:
items:
- const: mbox

iommus:
maxItems: 1

"#address-cells":
const: 1

"#size-cells":
const: 0

power-domains:
maxItems: 1

apple,init-ranges:
description:
List of PMP memory regions, represented as address and size pairs for
initializing PMP.
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 2

apple,init-dva:
description:
List of device virtual address with count pairs for initializing PMP.
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 2

required:
- compatible
- reg
- reg-names
- mboxes
- mbox-names
- "#address-cells"
- "#size-cells"
- iommus
- apple,init-ranges
- apple,init-dva

patternProperties:
"^report@[0-9a-f]+$":
$ref: apple,pmp-v1-report-entry.yaml#

additionalProperties: false
1 change: 1 addition & 0 deletions arch/arm64/Kconfig.platforms
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ config ARCH_APPLE
select APPLE_AIC
select APPLE_PMGR_PWRSTATE if PM
select HAVE_SHARED_GPIOS
select APPLE_USE_PMP_V1 if PM
help
This enables support for Apple's in-house ARM SoC family, such
as the Apple M1.
Expand Down
176 changes: 176 additions & 0 deletions arch/arm64/boot/dts/apple/t8103.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

aliases {
gpu = &gpu;
#ifdef APPLE_USE_PMP_V1
pmp = &pmp;
#endif
};

cpus {
Expand Down Expand Up @@ -480,7 +483,11 @@
<0x2 0x4000000 0 0x1000000>;
reg-names = "asc", "sgx";
mboxes = <&agx_mbox>;
#ifdef APPLE_USE_PMP_V1
power-domains = <&pmp_report_gfx>;
#else
power-domains = <&ps_gfx>;
#endif
memory-region = <&uat_ttbs>, <&uat_pagetables>, <&uat_handoff>,
<&gpu_hw_cal_a>, <&gpu_hw_cal_b>, <&gpu_globals>;
memory-region-names = "ttbs", "pagetables", "handoff",
Expand Down Expand Up @@ -553,7 +560,11 @@
reg = <0x2 0x28200000 0x0 0xc000>,
<0x2 0x28400000 0x0 0x4000>;
reg-names = "be", "fe";
#ifdef APPLE_USE_PMP_V1
power-domains = <&pmp_report_dispdfr>, <&ps_dispdfr_be>;
#else
power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
#endif
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 502 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 506 IRQ_TYPE_LEVEL_HIGH>;
Expand Down Expand Up @@ -613,7 +624,11 @@
#iommu-cells = <5>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 445 IRQ_TYPE_LEVEL_HIGH>;
#ifdef APPLE_USE_PMP_V1
power-domains = <&pmp_report_disp0>;
#else
power-domains = <&ps_disp0_cpu0>;
#endif
status = "disabled";
};

Expand Down Expand Up @@ -697,7 +712,11 @@
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 251 IRQ_TYPE_LEVEL_HIGH>;
#ifdef APPLE_USE_PMP_V1
power-domains = <&pmp_report_isp_sys>;
#else
power-domains = <&ps_isp_sys>;
#endif

status = "disabled";
};
Expand Down Expand Up @@ -1059,6 +1078,163 @@
#apple,bw-doorbell-cells = <2>;
};

pmp_dart: iommu@23b300000 {
compatible = "apple,t8103-dart";
reg = <0x2 0x3b300000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 515 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_pmp>;
};

pmp_mbox: mbox@23bc08000 {
compatible = "apple,t8103-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x2 0x3bc08000 0x0 0x4000>;
interrupt-parent = <&aic>;

interrupts = <AIC_IRQ 511 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 512 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 513 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 514 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "send-not-empty",
"recv-empty", "recv-not-empty";
#mbox-cells = <0>;
power-domains = <&ps_pmp>, <&ps_pms_sram>;
};

pmp: pmp@23b850000 {
compatible = "apple,t8103-pmp-v1";
reg = <0x2 0x3b850000 0x0 0x200000>,
<0x2 0x3bc00000 0x0 0x60000>;
reg-names = "pmp", "asc";
power-domains = <&ps_pmp>;

mboxes = <&pmp_mbox>;
mbox-names = "mbox";
#address-cells = <1>;
#size-cells = <0>;
iommus = <&pmp_dart 0>;

pmp_report_gfx: report@99 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-gfx";
reg = <99>;
#power-domain-cells = <0>;
power-domains = <&ps_gfx>;
};

pmp_report_ane_sys: report@104 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-ane-sys";
reg = <104>;
#power-domain-cells = <0>;
power-domains = <&ps_ane_sys>;
status = "disabled";
};

pmp_report_isp_sys: report@100 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-isp-sys";
reg = <0x64>;
#power-domain-cells = <0>;
power-domains = <&ps_isp_sys>;
};

pmp_report_disp0: report@84 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-disp0";
reg = <84>;
#power-domain-cells = <0>;
power-domains = <&ps_disp0_cpu0>;
apple,always-on;
};

pmp_report_dispext: report@85 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-dispext";
reg = <0x55>;
#power-domain-cells = <0>;
power-domains = <&ps_dispext_cpu0>;
};

pmp_report_venc_sys: report@101 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-venc-sys";
reg = <101>;
#power-domain-cells = <0>;
power-domains = <&ps_venc_sys>;
status = "disabled";
};

pmp_report_avd_sys: report@102 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-avd-sys";
reg = <102>;
#power-domain-cells = <0>;
power-domains = <&ps_avd_sys>;
status = "disabled";
};

pmp_report_msr: report@93 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-msr";
reg = <0x5d>;
#power-domain-cells = <0>;
power-domains = <&ps_msr>;
status = "disabled";
};

pmp_report_jpg: report@92 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-jpg";
reg = <0x5c>;
#power-domain-cells = <0>;
power-domains = <&ps_jpg>;
status = "disabled";
};

pmp_report_dispdfr: report@219 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-dispdfr";
reg = <219>;
#power-domain-cells = <0>;
power-domains = <&ps_dispdfr_fe>;
};

pmp_report_atc0_pcie: report@e {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-atc0_pcie";
reg = <0xe>;
#power-domain-cells = <0>;
power-domains = <&ps_atc0_pcie>;
status = "disabled";
};

pmp_report_atc1_pcie: report@62 {
compatible = "apple,t8103-pmp-v1-report-entry";
label = "pmp-atc1_pcie";
reg = <0x3e>;
#power-domain-cells = <0>;
power-domains = <&ps_atc1_pcie>;
status = "disabled";
};

// pmp_report_atc0_pcie_v: report@10 {
// compatible = "apple,t8103-pmp-v1-report-entry";
// label = "pmp-atc0_pcie-v";
// #power-domain-cells = <0>;
// power-domains = <&ps_atc0_pcie_v>;
// };

// pmp_report_atc1_pcie_v: report@11 {
// compatible = "apple,t8103-pmp-v1-report-entry";
// label = "pmp-atc1_pcie-v";
// #power-domain-cells = <0>;
// power-domains = <&ps_atc1_pcie_v>;
// };

};

cio_reset: reset-controller@23b784000 {
compatible = "apple,t8103-cio-reset";
reg = <0x2 0x3b784000 0x0 0x8000>;
Expand Down
6 changes: 6 additions & 0 deletions drivers/pmdomain/apple/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ config APPLE_PMP_REPORT
depends on PM
select PM_GENERIC_DOMAINS

config APPLE_PMP_V1_REPORT
bool
depends on OF
depends on PM
select PM_GENERIC_DOMAINS

endif
1 change: 1 addition & 0 deletions drivers/pmdomain/apple/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_APPLE_PMGR_PWRSTATE) += pmgr-pwrstate.o
obj-$(CONFIG_APPLE_PMP_REPORT) += pmp-report.o
obj-$(CONFIG_APPLE_PMP_V1_REPORT) += pmp_v1_report.o
Loading