# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: "http://devicetree.org/schemas/arm/msm/qcom,memshare.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: HLOS Memory Share Driver

maintainers:
  - Manoj Prabhu B <quic_bmanoj@quicinc.com>

description: |
  The Memshare driver implements a Kernel QMI service on the
  APSS responsible for providing contiguous physical memory
  to subsystems for use cases when additional memory is required.

properties:
  compatible:
    const: qcom,memshare
    description: Container of Memshare nodes

  child-node:
    description: Container of Memshare client nodes
    type: object
    properites:
        compatible:
            const: qcom,memshare-peripheral

patternProperties:
  '^qcom,[a-zA-Z]+$':
    type: object
    properties:
      qcom,peripheral-size:
        $ref: '/schemas/types.yaml#/definitions/uint32'
        description: |
            Indicates the size (in bytes) required for that child node

      qcom,client-id:
        $ref: '/schemas/types.yaml#/definitions/uint32'
        description: |
            Indicates the client id of the child node.

      qcom,allocate-boot-time:
        type: boolean
        description: |
            Indicates whether clients needs boot time memory allocation.

      qcom,allocate-on-request:
        type: boolean
        description: |
            Indicates memory allocation happens only upon client request.
            qcom,allocate-boot-time and qcom,allocate-on-request are mutually exclusive rite now.

      qcom,guard-band:
        type: boolean
        description: |
          Indicates addition of a guard band memory allocation in addition to the client's memory region.

      label:
        $ref: '/schemas/types.yaml#/definitions/string'
        description: |
          Indicates the peripheral information for the node.

    required:
      - compatible
      - qcom,peripheral-size
      - qcom,client-id

required:
  - compatible

examples:
  - |
    qcom,memshare {
        compatible = "qcom,memshare";

        qcom,client_1 {
            compatible = "qcom,memshare-peripheral";
            qcom,peripheral-size = <0x200000>;
            qcom,client-id = <0>;
            qcom,allocate-boot-time;
            label = "modem";
        };
    };