dt-bindings: Add devicetree bindings

Add snapshot of device tree bindings from keystone common kernel, branch
"android-mainline-keystone-qcom-release" at c4c12103f9c0 ("Snap for 9228065
from e32903b9a63bb558df8b803b076619c53c16baad to
android-mainline-keystone-qcom-release").

Change-Id: I7682079615cbd9f29340a5c1f2a1d84ec441a1f1
Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
This commit is contained in:
Melody Olvera
2023-04-03 14:38:11 -07:00
parent c334acf377
commit 6f18ce8026
4878 changed files with 424312 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/reserved-memory/google,open-dice.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Open Profile for DICE
description: |
This binding represents a reserved memory region containing data
generated by the Open Profile for DICE protocol.
See https://pigweed.googlesource.com/open-dice/
maintainers:
- David Brazdil <dbrazdil@google.com>
allOf:
- $ref: "reserved-memory.yaml"
properties:
compatible:
const: google,open-dice
reg:
description: page-aligned region of memory containing DICE data
required:
- compatible
- reg
- no-map
unevaluatedProperties: false
examples:
- |
reserved-memory {
#address-cells = <2>;
#size-cells = <1>;
dice: dice@12340000 {
compatible = "google,open-dice";
reg = <0x00 0x12340000 0x2000>;
no-map;
};
};

View File

@@ -0,0 +1,40 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/reserved-memory/memory-region.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Reserved Memory Region
maintainers:
- devicetree-spec@vger.kernel.org
description: |
Regions in the /reserved-memory node may be referenced by other device
nodes by adding a memory-region property to the device node.
select: true
properties:
memory-region:
$ref: /schemas/types.yaml#/definitions/phandle-array
description: >
Phandle to a /reserved-memory child node assigned to the device.
memory-region-names:
$ref: /schemas/types.yaml#/definitions/string-array
description: >
A list of names, one for each corresponding entry in the
memory-region property
additionalProperties: true
examples:
- |
fb0: video@12300000 {
/* ... */
reg = <0x12300000 0x1000>;
memory-region = <&display_reserved>;
};
...

View File

@@ -0,0 +1,31 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra210-emc-table.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: NVIDIA Tegra210 EMC Frequency Table
maintainers:
- Thierry Reding <thierry.reding@gmail.com>
- Jon Hunter <jonathanh@nvidia.com>
description: On Tegra210, firmware passes a binary representation of the
EMC frequency table via a reserved memory region.
allOf:
- $ref: "reserved-memory.yaml"
properties:
compatible:
const: nvidia,tegra210-emc-table
reg:
description: region of memory reserved by firmware to pass the EMC
frequency table
unevaluatedProperties: false
required:
- compatible
- reg

View File

@@ -0,0 +1,47 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/reserved-memory/phram.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MTD/block device in RAM
description: |
Specifies that the reserved memory region can be used as an MTD or block
device.
The "phram" node is named after the "MTD in PHysical RAM" driver which
provides an implementation of this functionality in Linux.
maintainers:
- Vincent Whitchurch <vincent.whitchurch@axis.com>
allOf:
- $ref: "reserved-memory.yaml"
- $ref: "/schemas/mtd/mtd.yaml"
properties:
compatible:
const: phram
reg:
description: region of memory that can be used as an MTD/block device
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
phram: flash@12340000 {
compatible = "phram";
label = "rootfs";
reg = <0x12340000 0x00800000>;
};
};

View File

@@ -0,0 +1,46 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: "http://devicetree.org/schemas/reserved-memory/qcom,cmd-db.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
title: Qualcomm Command DB
description: |
Command DB is a database that provides a mapping between resource key and the
resource address for a system resource managed by a remote processor. The data
is stored in a shared memory region and is loaded by the remote processor.
Some of the Qualcomm Technologies Inc SoC's have hardware accelerators for
controlling shared resources. Depending on the board configuration the shared
resource properties may change. These properties are dynamically probed by the
remote processor and made available in the shared memory.
maintainers:
- Bjorn Andersson <bjorn.andersson@linaro.org>
allOf:
- $ref: "reserved-memory.yaml"
properties:
compatible:
const: qcom,cmd-db
required:
- reg
unevaluatedProperties: false
examples:
- |
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
reserved-memory@85fe0000 {
reg = <0x85fe0000 0x20000>;
compatible = "qcom,cmd-db";
no-map;
};
};

View File

@@ -0,0 +1,53 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: "http://devicetree.org/schemas/reserved-memory/qcom,rmtfs-mem.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
title: Qualcomm Remote File System Memory
description: |
This binding describes the Qualcomm remote filesystem memory, which serves the
purpose of describing the shared memory region used for remote processors to
access block device data using the Remote Filesystem protocol.
maintainers:
- Bjorn Andersson <bjorn.andersson@linaro.org>
allOf:
- $ref: "reserved-memory.yaml"
properties:
compatible:
const: qcom,rmtfs-mem
qcom,client-id:
$ref: /schemas/types.yaml#/definitions/uint32
description: >
identifier of the client to use this region for buffers
qcom,vmid:
$ref: /schemas/types.yaml#/definitions/uint32
description: >
vmid of the remote processor, to set up memory protection
required:
- qcom,client-id
unevaluatedProperties: false
examples:
- |
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
rmtfs@86700000 {
compatible = "qcom,rmtfs-mem";
reg = <0x86700000 0xe0000>;
no-map;
qcom,client-id = <1>;
};
};

View File

@@ -0,0 +1,144 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: "http://devicetree.org/schemas/reserved-memory/ramoops.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
title: Ramoops oops/panic logger
description: |
ramoops provides persistent RAM storage for oops and panics, so they can be
recovered after a reboot. This is a child-node of "/reserved-memory", and
is named "ramoops" after the backend, rather than "pstore" which is the
subsystem.
Parts of this storage may be set aside for other persistent log buffers, such
as kernel log messages, or for optional ECC error-correction data. The total
size of these optional buffers must fit in the reserved region.
Any remaining space will be used for a circular buffer of oops and panic
records. These records have a configurable size, with a size of 0 indicating
that they should be disabled.
At least one of "record-size", "console-size", "ftrace-size", or "pmsg-size"
must be set non-zero, but are otherwise optional as listed below.
maintainers:
- Kees Cook <keescook@chromium.org>
allOf:
- $ref: "reserved-memory.yaml"
properties:
compatible:
const: ramoops
reg:
description: region of memory that is preserved between reboots
ecc-size:
$ref: /schemas/types.yaml#/definitions/uint32
description: enables ECC support and specifies ECC buffer size in bytes
default: 0 # no ECC
record-size:
$ref: /schemas/types.yaml#/definitions/uint32
description: maximum size in bytes of each kmsg dump
default: 0
console-size:
$ref: /schemas/types.yaml#/definitions/uint32
description: size in bytes of log buffer reserved for kernel messages
default: 0
ftrace-size:
$ref: /schemas/types.yaml#/definitions/uint32
description: size in bytes of log buffer reserved for function tracing and profiling
default: 0
pmsg-size:
$ref: /schemas/types.yaml#/definitions/uint32
description: size in bytes of log buffer reserved for userspace messages
default: 0
mem-type:
$ref: /schemas/types.yaml#/definitions/uint32
description: if present, sets the type of mapping is to be used to map the reserved region.
default: 0
oneOf:
- const: 0
description: write-combined
- const: 1
description: unbuffered
- const: 2
description: cached
max-reason:
$ref: /schemas/types.yaml#/definitions/uint32
default: 2 # log oopses and panics
maximum: 0x7fffffff
description: |
If present, sets maximum type of kmsg dump reasons to store.
This can be set to INT_MAX to store all kmsg dumps.
See include/linux/kmsg_dump.h KMSG_DUMP_* for other kmsg dump reason values.
Setting this to 0 (KMSG_DUMP_UNDEF), means the reason filtering will be
controlled by the printk.always_kmsg_dump boot param.
If unset, it will be 2 (KMSG_DUMP_OOPS), otherwise 5 (KMSG_DUMP_MAX).
flags:
$ref: /schemas/types.yaml#/definitions/uint32
default: 0
description: |
If present, pass ramoops behavioral flags
(see include/linux/pstore_ram.h RAMOOPS_FLAG_* for flag values).
no-dump-oops:
deprecated: true
type: boolean
description: |
Use max_reason instead. If present, and max_reason is not specified,
it is equivalent to max_reason = 1 (KMSG_DUMP_PANIC).
unbuffered:
deprecated: true
type: boolean
description: |
Use mem_type instead. If present, and mem_type is not specified,
it is equivalent to mem_type = 1 and uses unbuffered mappings to map
the reserved region (defaults to buffered mappings mem_type = 0).
If both are specified -- "mem_type" overrides "unbuffered".
unevaluatedProperties: false
required:
- compatible
- reg
anyOf:
- required: [record-size]
- required: [console-size]
- required: [ftrace-size]
- required: [pmsg-size]
examples:
- |
/ {
compatible = "foo";
model = "foo";
#address-cells = <1>;
#size-cells = <1>;
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
ramoops@bfdf0000 {
compatible = "ramoops";
reg = <0xbfdf0000 0x10000>; /* 64kB */
console-size = <0x8000>; /* 32kB */
record-size = <0x400>; /* 1kB */
ecc-size = <16>;
};
};
};

View File

@@ -0,0 +1 @@
This file has been moved to reserved-memory.yaml.

View File

@@ -0,0 +1,100 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/reserved-memory/reserved-memory.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: /reserved-memory Child Node Common
maintainers:
- devicetree-spec@vger.kernel.org
description: >
Reserved memory is specified as a node under the /reserved-memory node. The
operating system shall exclude reserved memory from normal usage one can
create child nodes describing particular reserved (excluded from normal use)
memory regions. Such memory regions are usually designed for the special
usage by various device drivers.
Each child of the reserved-memory node specifies one or more regions
of reserved memory. Each child node may either use a 'reg' property to
specify a specific range of reserved memory, or a 'size' property with
optional constraints to request a dynamically allocated block of
memory.
Following the generic-names recommended practice, node names should
reflect the purpose of the node (ie. "framebuffer" or "dma-pool").
Unit address (@<address>) should be appended to the name if the node
is a static allocation.
properties:
reg: true
size:
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 2
description: >
Length based on parent's \#size-cells. Size in bytes of memory to
reserve.
alignment:
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 2
description: >
Length based on parent's \#size-cells. Address boundary for
alignment of allocation.
alloc-ranges:
$ref: /schemas/types.yaml#/definitions/uint32-array
description: >
Address and Length pairs. Specifies regions of memory that are
acceptable to allocate from.
no-map:
type: boolean
description: >
Indicates the operating system must not create a virtual mapping
of the region as part of its standard mapping of system memory,
nor permit speculative access to it under any circumstances other
than under the control of the device driver using the region.
reusable:
type: boolean
description: >
The operating system can use the memory in this region with the
limitation that the device driver(s) owning the region need to be
able to reclaim it back. Typically that means that the operating
system can use that region to store volatile or cached data that
can be otherwise regenerated or migrated elsewhere.
allOf:
- if:
required:
- no-map
then:
not:
required:
- reusable
- if:
required:
- reusable
then:
not:
required:
- no-map
oneOf:
- required:
- reg
- required:
- size
additionalProperties: true
...

View File

@@ -0,0 +1,97 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/reserved-memory/shared-dma-pool.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: /reserved-memory DMA pool node bindings
maintainers:
- devicetree-spec@vger.kernel.org
allOf:
- $ref: "reserved-memory.yaml"
properties:
compatible:
oneOf:
- const: shared-dma-pool
description: >
This indicates a region of memory meant to be used as a shared
pool of DMA buffers for a set of devices. It can be used by an
operating system to instantiate the necessary pool management
subsystem if necessary.
- const: restricted-dma-pool
description: >
This indicates a region of memory meant to be used as a pool
of restricted DMA buffers for a set of devices. The memory
region would be the only region accessible to those devices.
When using this, the no-map and reusable properties must not
be set, so the operating system can create a virtual mapping
that will be used for synchronization. The main purpose for
restricted DMA is to mitigate the lack of DMA access control
on systems without an IOMMU, which could result in the DMA
accessing the system memory at unexpected times and/or
unexpected addresses, possibly leading to data leakage or
corruption. The feature on its own provides a basic level of
protection against the DMA overwriting buffer contents at
unexpected times. However, to protect against general data
leakage and system memory corruption, the system needs to
provide way to lock down the memory access, e.g., MPU. Note
that since coherent allocation needs remapping, one must set
up another device coherent pool by shared-dma-pool and use
dma_alloc_from_dev_coherent instead for atomic coherent
allocation.
linux,cma-default:
type: boolean
description: >
If this property is present, then Linux will use the region for
the default pool of the contiguous memory allocator.
linux,dma-default:
type: boolean
description: >
If this property is present, then Linux will use the region for
the default pool of the consistent DMA allocator.
if:
properties:
compatible:
contains:
const: restricted-dma-pool
then:
properties:
no-map: false
reusable: false
unevaluatedProperties: false
examples:
- |
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
/* global autoconfigured region for contiguous allocations */
linux,cma {
compatible = "shared-dma-pool";
reusable;
size = <0x4000000>;
alignment = <0x2000>;
linux,cma-default;
};
display_reserved: framebuffer@78000000 {
reg = <0x78000000 0x800000>;
};
restricted_dma_reserved: restricted-dma-pool@50000000 {
compatible = "restricted-dma-pool";
reg = <0x50000000 0x4000000>;
};
};
...

View File

@@ -0,0 +1,24 @@
* Xen hypervisor reserved-memory binding
Expose one or more memory regions as reserved-memory to the guest
virtual machine. Typically, a region is configured at VM creation time
to be a shared memory area across multiple virtual machines for
communication among them.
For each of these pre-shared memory regions, a range is exposed under
the /reserved-memory node as a child node. Each range sub-node is named
xen-shmem@<address> and has the following properties:
- compatible:
compatible = "xen,shared-memory-v1"
- reg:
the base guest physical address and size of the shared memory region
- xen,offset: (borrower VMs only)
64 bit integer offset within the owner virtual machine's shared
memory region used for the mapping in the borrower VM.
- xen,id:
a string that identifies the shared memory region as specified in
the VM config file