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

title: QTI IMEM

maintainers:
  - Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>

description: |
  IMEM is fast on-chip memory used for various debug features and dma transactions.

properties:
  compatible:
    const: qcom,msm-imem

  reg:
    description: start address and size of imem memory

  '#address-cells':
    const: 1

  '#size-cells':
    const: 1

  ranges: true

patternProperties:
  "^[a-zA-Z0-9]@[a-z0-9]+$":
    type: object

    properties:
      compatible:
        enum:
          - qcom,msm-imem-pil
          - qcom,msm-imem-boot_stats
          - qcom,msm-imem-cache_erp
          - qcom,msm-imem-mem_dump_table
          - qcom,msm-imem-restart_reason
          - qcom,msm-imem-dload-type
          - qcom,msm-imem-download_mode
          - qcom,msm-imem-emergency_download_mode
          - qcom,msm-imem-kaslr_offset
          - qcom,msm-imem-minidump
          - qcom,msm-imem-diag-dload
          - qcom,msm-imem-pil-disable-timeout
          - qcom,msm-imem-mss-dsm
          - qcom,msm-imem-gpu-dump-skip

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    qcom,msm-imem {
      compatible = "qcom,msm-imem";
      reg = <0xdeadbeef 0x1000>; /* < start_address size > */
      ranges = <0x0 0xdeadbeef 0x1000>;
      #address-cells = <1>;
      #size-cells = <1>;

      download_mode@0 {
        compatible = "qcom,msm-imem-download_mode";
        reg = <0x0 8>;
      };

      restart_reason@65c {
        compatible = "qcom,msm-imem-restart_reason";
        reg = <0x65c 4>;
      };

      imem_cache_erp: cache_erp@6a4 {
        compatible = "qcom,msm-imem-cache_erp";
        reg = <0x6a4 4>;
      };

      boot_stats@6b0 {
        compatible = "qcom,msm-imem-boot_stats";
        reg = <0x6b0 32>;
      };

      kaslr_offset@6d0 {
        compatible = "qcom,msm-imem-kaslr_offset";
        reg = <0x6d0 12>;
      };


      pil@94c {
        compatible = "qcom,msm-imem-pil";
        reg = <0x94c 200>;
      };

      emergency_download_mode@fe0 {
        compatible = "qcom,msm-imem-emergency_download_mode";
        reg = <0xfe0 12>;
      };

      ss_mdump@b88 {
        compatible = "qcom,msm-imem-minidump";
        reg = <0xb88 28>;
      };
    };
