162306a36Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/soc/qcom/qcom,rpm-master-stats.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: Qualcomm Technologies, Inc. (QTI) RPM Master Stats
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Konrad Dybcio <konrad.dybcio@linaro.org>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cidescription: |
1362306a36Sopenharmony_ci  The Qualcomm RPM (Resource Power Manager) architecture includes a concept
1462306a36Sopenharmony_ci  of "RPM Masters". They can be thought of as "the local gang leaders", usually
1562306a36Sopenharmony_ci  spanning a single subsystem (e.g. APSS, ADSP, CDSP). All of the RPM decisions
1662306a36Sopenharmony_ci  (particularly around entering hardware-driven low power modes: XO shutdown
1762306a36Sopenharmony_ci  and total system-wide power collapse) are first made at Master-level, and
1862306a36Sopenharmony_ci  only then aggregated for the entire system.
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci  The Master Stats provide a few useful bits that can be used to assess whether
2162306a36Sopenharmony_ci  our device has entered the desired low-power mode, how long it took to do so,
2262306a36Sopenharmony_ci  the duration of that residence, how long it took to come back online,
2362306a36Sopenharmony_ci  how many times a given sleep state was entered and which cores are actively
2462306a36Sopenharmony_ci  voting for staying awake.
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci  This scheme has been used on various SoCs in the 2013-2023 era, with some
2762306a36Sopenharmony_ci  newer or higher-end designs providing this information through an SMEM query.
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ciproperties:
3062306a36Sopenharmony_ci  compatible:
3162306a36Sopenharmony_ci    const: qcom,rpm-master-stats
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci  qcom,rpm-msg-ram:
3462306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/phandle-array
3562306a36Sopenharmony_ci    description: Phandle to an RPM MSG RAM slice containing the master stats
3662306a36Sopenharmony_ci    minItems: 1
3762306a36Sopenharmony_ci    maxItems: 5
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci  qcom,master-names:
4062306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/string-array
4162306a36Sopenharmony_ci    description:
4262306a36Sopenharmony_ci      The name of the RPM Master which owns the MSG RAM slice where this
4362306a36Sopenharmony_ci      instance of Master Stats resides
4462306a36Sopenharmony_ci    minItems: 1
4562306a36Sopenharmony_ci    maxItems: 5
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_cirequired:
4862306a36Sopenharmony_ci  - compatible
4962306a36Sopenharmony_ci  - qcom,rpm-msg-ram
5062306a36Sopenharmony_ci  - qcom,master-names
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ciadditionalProperties: false
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ciexamples:
5562306a36Sopenharmony_ci  - |
5662306a36Sopenharmony_ci    stats {
5762306a36Sopenharmony_ci      compatible = "qcom,rpm-master-stats";
5862306a36Sopenharmony_ci      qcom,rpm-msg-ram = <&apss_master_stats>,
5962306a36Sopenharmony_ci                         <&mpss_master_stats>,
6062306a36Sopenharmony_ci                         <&adsp_master_stats>,
6162306a36Sopenharmony_ci                         <&cdsp_master_stats>,
6262306a36Sopenharmony_ci                         <&tz_master_stats>;
6362306a36Sopenharmony_ci      qcom,master-names = "APSS",
6462306a36Sopenharmony_ci                          "MPSS",
6562306a36Sopenharmony_ci                          "ADSP",
6662306a36Sopenharmony_ci                          "CDSP",
6762306a36Sopenharmony_ci                          "TZ";
6862306a36Sopenharmony_ci    };
6962306a36Sopenharmony_ci...
70