From: Xing Loong <xing.xl.loong@gmail.com>
To: Jens Wiklander <jenswi@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Rob Herring <robh@kernel.org>,
Sumit Garg <sumit.garg@kernel.org>,
op-tee@lists.trustedfirmware.org, devicetree@vger.kernel.org,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
Xing Loong <xing.xl.loong@gmail.com>
Subject: [PATCH v3 2/3] dt-bindings: firmware: add mbedtee,tee binding
Date: Mon, 20 Jul 2026 15:35:56 +0800 [thread overview]
Message-ID: <20260720073558.799755-3-xing.xl.loong@gmail.com> (raw)
In-Reply-To: <20260720073558.799755-1-xing.xl.loong@gmail.com>
MbedTEE is a Trusted Execution Environment for embedded
systems (https://github.com/mbedtee). It communicates with
the REE via shared-memory ring buffers using a fixed RPC
protocol. Two platform configurations are supported:
- ARM/AArch64 (TrustZone, SMC): two reserved-memory
regions (t2r-ring and t2r-shm) plus a GIC SPI edge
interrupt for TEE-to-REE notifications.
- RISC-V (IMSIC): three reserved-memory regions, adding
r2t-ring for REE-to-TEE command submissions; no
interrupts property (T2R notifications use IMSIC MSI
allocated at runtime).
Signed-off-by: Xing Loong <xing.xl.loong@gmail.com>
---
Changes in v3:
- Drop all phandle stub nodes from examples.
- Remove redundant required: - interrupts from then branch.
- Simplify title and description.
Changes in v2:
- Fix DT binding review comments from Krzysztof Kozlowski:
- Drop $nodename, "YAML devicetree binding" wording, property descriptions
- Rename compatible string to mbedtee,tee
- Rename memory regions: rpc-t2r-ring -> t2r-ring, rpc-t2r-shm -> t2r-shm,
rpc-r2t-ring -> r2t-ring
- Add memory-region / memory-region-names to required
- Simplify allOf constraints (drop redundant else-branch items)
- Rewrite description to describe hardware/firmware, not the binding or driver
- Drop all irrelevant platform nodes (gic, cpus, reserved-memory)
- Add maxItems: 1 constraint to interrupts property (Sashiko AI review)
---
.../bindings/firmware/mbedtee,tee.yaml | 109 ++++++++++++++++++
1 file changed, 109 insertions(+)
create mode 100644 Documentation/devicetree/bindings/firmware/mbedtee,tee.yaml
diff --git a/Documentation/devicetree/bindings/firmware/mbedtee,tee.yaml b/Documentation/devicetree/bindings/firmware/mbedtee,tee.yaml
new file mode 100644
index 0000000..a8f1201
--- /dev/null
+++ b/Documentation/devicetree/bindings/firmware/mbedtee,tee.yaml
@@ -0,0 +1,109 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/firmware/mbedtee,tee.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MbedTEE
+
+maintainers:
+ - Xing Loong <xing.xl.loong@gmail.com>
+
+description: |
+ MbedTEE is a Trusted Execution Environment for embedded systems.
+ It communicates with the REE (Linux) via shared-memory ring
+ buffers using a fixed RPC protocol.
+
+ We're using "mbedtee" as the vendor prefix for the open-source TEE
+ project at https://github.com/mbedtee.
+
+ The REE and TEE CPUs sharing the RPC memory must be in a
+ hardware-coherent domain.
+
+ Two or three reserved-memory regions are required:
+ t2r-ring: ring buffer for TEE-to-REE notifications
+ t2r-shm: shared memory for TEE-to-REE RPC payloads
+ r2t-ring: ring buffer for REE-to-TEE command submissions (RISC-V)
+
+ On ARM the transport uses SMC and a GIC SPI interrupt. On RISC-V
+ the transport uses shared-memory rings and IMSIC MSI; the TEE
+ polls r2t-ring for commands from the REE.
+
+properties:
+ compatible:
+ const: mbedtee,tee
+
+ interrupts:
+ maxItems: 1
+
+ msi-parent:
+ maxItems: 1
+
+ memory-region:
+ minItems: 2
+ maxItems: 3
+
+ memory-region-names:
+ minItems: 2
+ maxItems: 3
+ items:
+ enum:
+ - t2r-ring
+ - t2r-shm
+ - r2t-ring
+
+required:
+ - compatible
+ - memory-region
+ - memory-region-names
+
+allOf:
+ - if:
+ required:
+ - interrupts
+ then:
+ properties:
+ msi-parent: false
+ memory-region:
+ maxItems: 2
+ memory-region-names:
+ items:
+ - const: t2r-ring
+ - const: t2r-shm
+ else:
+ required:
+ - msi-parent
+ properties:
+ interrupts: false
+ memory-region:
+ minItems: 3
+ memory-region-names:
+ items:
+ - const: t2r-ring
+ - const: t2r-shm
+ - const: r2t-ring
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ firmware {
+ mbedtee {
+ compatible = "mbedtee,tee";
+ interrupts = <GIC_SPI 72 IRQ_TYPE_EDGE_RISING>;
+ memory-region = <&t2r_ring>, <&t2r_shm>;
+ memory-region-names = "t2r-ring", "t2r-shm";
+ };
+ };
+
+ - |
+ firmware {
+ mbedtee {
+ compatible = "mbedtee,tee";
+ msi-parent = <&imsic>;
+ memory-region = <&t2r_ring>, <&t2r_shm>, <&r2t_ring>;
+ memory-region-names = "t2r-ring", "t2r-shm", "r2t-ring";
+ };
+ };
--
2.43.0
next prev parent reply other threads:[~2026-07-20 7:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 7:35 [PATCH v3 0/3] tee: add MbedTEE driver Xing Loong
2026-07-20 7:35 ` [PATCH v3 1/3] dt-bindings: vendor-prefixes: add mbedtee Xing Loong
2026-07-20 7:35 ` Xing Loong [this message]
2026-07-20 7:48 ` [PATCH v3 2/3] dt-bindings: firmware: add mbedtee,tee binding sashiko-bot
2026-07-20 7:35 ` [PATCH v3 3/3] tee: add MbedTEE driver Xing Loong
2026-07-20 7:55 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260720073558.799755-3-xing.xl.loong@gmail.com \
--to=xing.xl.loong@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jenswi@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=op-tee@lists.trustedfirmware.org \
--cc=robh@kernel.org \
--cc=sumit.garg@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox