# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/fsl/fsl,rcpm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Run Control and Power Management

description:
  The RCPM performs all device-level tasks associated with device run control
  and power management.

maintainers:
  - Frank Li <Frank.Li@nxp.com>

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - fsl,p2041-rcpm
              - fsl,p3041-rcpm
              - fsl,p4080-rcpm
              - fsl,p5020-rcpm
              - fsl,p5040-rcpm
          - const: fsl,qoriq-rcpm-1.0
      - items:
          - enum:
              - fsl,b4420-rcpm
              - fsl,b4860-rcpm
              - fsl,t4240-rcpm
          - const: fsl,qoriq-rcpm-2.0
      - items:
          - enum:
              - fsl,t1040-rcpm
          - const: fsl,qoriq-rcpm-2.1
      - items:
          - enum:
              - fsl,ls1012a-rcpm
              - fsl,ls1021a-rcpm
              - fsl,ls1028a-rcpm
              - fsl,ls1043a-rcpm
              - fsl,ls1046a-rcpm
              - fsl,ls1088a-rcpm
              - fsl,ls208xa-rcpm
              - fsl,lx2160a-rcpm
          - const: fsl,qoriq-rcpm-2.1+

  reg:
    maxItems: 1

  "#fsl,rcpm-wakeup-cells":
    description: |
      The number of IPPDEXPCR register cells in the
      fsl,rcpm-wakeup property.

      Freescale RCPM Wakeup Source Device Tree Bindings

      Required fsl,rcpm-wakeup property should be added to a device node if
      the device can be used as a wakeup source.

      fsl,rcpm-wakeup: Consists of a phandle to the rcpm node and the IPPDEXPCR
      register cells. The number of IPPDEXPCR register cells is defined in
      "#fsl,rcpm-wakeup-cells" in the rcpm node. The first register cell is
      the bit mask that should be set in IPPDEXPCR0, and the second register
      cell is for IPPDEXPCR1, and so on.

      Note: IPPDEXPCR(IP Powerdown Exception Control Register) provides a
      mechanism for keeping certain blocks awake during STANDBY and MEM, in
      order to use them as wake-up sources.

  little-endian:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      RCPM register block is Little Endian. Without it RCPM
      will be Big Endian (default case).

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    global-utilities@e2000 {
          compatible = "fsl,t4240-rcpm", "fsl,qoriq-rcpm-2.0";
          reg = <0xe2000 0x1000>;
          #fsl,rcpm-wakeup-cells = <2>;
    };
