From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA11A13D8B1; Wed, 1 Jul 2026 14:05:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782914714; cv=none; b=NafnWZ5T6sqsVnnxxYOotcz7vOXLHh84Lud9Uaa9DX+DsDz0TNuCAl8EjttGWU6veI8k4fjGDgf4UdWMVj1r4THsartnOP29ZqPYn50bv6fwf6fj4WQqXbBFMIep+skpF3NYzFUJ6tbN5kViMKi9b5CdXryrFEdK15gXcg594do= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782914714; c=relaxed/simple; bh=0nvsHBmf2FE5rKBPPsN+DZAsBkoyqvfDWlJWrgesl9A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=u+4x1bK75VK2Fmb3FZkQV2f0cwn8cdhb7OXWGOxxgK76uQ44BXhqkrhrYHVAEQuxXtisvwjv+qeW+HxTolgGSUJFLzQt9mDWpANmbf/nIZYFAFXlxBvH5FuSA+uxYYj4Ah3yUhfdebXkOeVLFY6SymP/9AKtJBhTIp0dqjowSyc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HkdidmL8; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HkdidmL8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60A6B1F000E9; Wed, 1 Jul 2026 14:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782914712; bh=KN1ZZoShUes6sGFwycYM2qI4rRpQvujeGBBYwd462qg=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=HkdidmL8i7jVnVEjIIcgCKSXScek/60dRiwAAP4oj30EEDyou9nVafCvtV0b4RP5P 6onzkAjRbCfPb+7nwMtEcqM11iptMzCwQddnSVo3pbpwJbuJSuxkJ6irwsfaosg3H8 GEDGaZH8D1YX8evg5Hr0wbpPaL22jF0c2eBjNDroBmoZAuhg+AYByAFvS0bOCGtafy xzbTcAvQRWGD0mivnctUacPxws5yxqWSHTpw1rI92Wa6W1690Y2FNWtUiTvGNIBWLJ T2jxlffovycLkIGQ62LA/zrL2J/YDc1YECLvNM2/zsHFENrUJbUr5LxWbk0rxtvG/4 fq79uJdC33FWg== Message-ID: <70068ae8-ede1-41d2-899b-98ed11e19953@kernel.org> Date: Wed, 1 Jul 2026 16:05:05 +0200 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] dt-bindings: firmware: add mbedtee,rpc binding To: Xing Loong , Jens Wiklander Cc: Krzysztof Kozlowski , Conor Dooley , Rob Herring , Sumit Garg , op-tee@lists.trustedfirmware.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260701132514.186953-1-xing.xl.loong@gmail.com> <20260701132514.186953-3-xing.xl.loong@gmail.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplN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tBYpsFAmna YUkACgkQG5NDfTtBYptX+BAApg32CkxwNucNEi8WfWA8oKkW0y8YDuY6ORMo9FWNGiT/OTy0 vyJrLocrpn86zwfjVp+eCrssPYh8eqJfnWqmYv6ACQtHPYzPZQ3mSo8H97Z01oUxITzCxpXm ZkLgPIqtDPcC2E3dPM/fVxcyowM8XsaMA9wcsaUYrta8toOq2b9tKcjleKMfMrm0gQ9u7wUc QbLkwj6TCLOwucb07GXzLTNF9PZmaDUpKAZjMjmrW+le+SFvQbhamx0rxLWPR0NWntXpbCn+ +ACch03p/JyTBVktxFsFyCt7pTPE1kEaeuXBTe/a2D9iQvRxRW19LvuO2e59/u1wYUiH/orz wbIC2S4dBsPAPihL3ztOU1yE86GPyQtSE0kU+/7snnLt4QGi6PChf3t5gnNjAzjUUovO8rgI c+5yN5heq5loYHgK6OQ9OlHzsPHO9e9MOQcKlFycs1pyijFGzDwdNUm/SchK8iWT2QApTx4A K9bCVaboTA2T77QYkRcRJYSsO1alGX0ome/hMLD1daXlkrNUp1HWa3K4iytLRXjCSIorWiGs n+q3krnpXu3TFkA8qtOFZMdnIiFuiq1yLT8hptsV5xh1TA2nsVvSYiaCr3q4s4BKjS/KrLDb qoxzw8ISjdUp4pA85vb6YLCmb39NgidD+7PmAr65lBNveIFynTgsja1rRQ4= In-Reply-To: <20260701132514.186953-3-xing.xl.loong@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 01/07/2026 15:25, Xing Loong wrote: > Add YAML devicetree binding for the MbedTEE Trusted Execution Drop YAML, there is no such thing as YAML binding. > Environment driver. We don't take bindings for drivers but for hardware or firmware. Please describe these instead. > > The binding covers two platform configurations: > - ARM/AArch64 (TrustZone, SMC): two reserved-memory regions > (rpc-t2r-ring and rpc-t2r-shm) plus a GIC SPI edge interrupt > for TEE-to-REE notifications. > - RISC-V (IMSIC): three reserved-memory regions, adding > rpc-r2t-ring for REE-to-TEE command submissions; no interrupts > property (T2R notifications use IMSIC MSI allocated at runtime). > > Signed-off-by: Xing Loong > --- > .../bindings/firmware/mbedtee,rpc.yaml | 221 ++++++++++++++++++ > 1 file changed, 221 insertions(+) > create mode 100644 Documentation/devicetree/bindings/firmware/mbedtee,rpc.yaml > > diff --git a/Documentation/devicetree/bindings/firmware/mbedtee,rpc.yaml b/Documentation/devicetree/bindings/firmware/mbedtee,rpc.yaml > new file mode 100644 > index 0000000..08ae255 > --- /dev/null > +++ b/Documentation/devicetree/bindings/firmware/mbedtee,rpc.yaml > @@ -0,0 +1,221 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/firmware/mbedtee,rpc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: MbedTEE Trusted Execution Environment > + > +maintainers: > + - Xing Loong > + > +description: | > + MbedTEE is a Trusted Execution Environment for embedded systems. > + This binding describes the shared-memory regions used for RPC Describe firmware, not the binding. It's redundant to say what the binding is about, just say what is the hardware. > + communication between the Linux REE driver and MbedTEE OS. > + > + The REE and TEE CPUs sharing the RPC memory must be in a > + hardware-coherent domain (same CPU cluster, coherent caches). > + > + Two or three reserved-memory regions are required: > + > + rpc-t2r-ring ring buffer for TEE-to-REE notifications (all platforms) > + rpc-t2r-shm shared memory for TEE-to-REE RPC payloads (all platforms) > + rpc-r2t-ring ring buffer for REE-to-TEE command submissions (RISC-V only) > + > + On ARM/AArch64 the transport uses SMC calls; TEE-to-REE > + notifications use a GIC SPI edge interrupt. > + > + On RISC-V the TEE notifies the REE via IMSIC MSI; the REE submits > + commands via shared-memory rpc-r2t-ring that the TEE polls. No > + REE-to-TEE interrupt is used. No SBI ecall is involved. > + > +properties: > + $nodename: > + const: mbedtee Drop, why would it be relevant? > + > + compatible: > + const: mbedtee,rpc Feels way too generic. First, Google results on mbedtee are basically non-existing, so what sort of company is that? Second, rpc is just not specific enough. Please carefully read writing bindings doc. > + > + interrupts: > + description: > + GIC interrupt used by the TEE to notify the REE of pending RPC > + responses (ARM/AArch64 only). Not present on RISC-V platforms which > + use IMSIC platform MSI interrupts allocated dynamically at runtime. Please read writing bindings doc. > + > + msi-parent: > + maxItems: 1 > + description: > + IMSIC MSI controller used by the Linux driver to allocate the Again drivers... > + TEE-to-REE notification interrupt on RISC-V platforms. Not present on > + ARM/AArch64 platforms, which use the interrupts property. > + > + memory-region: > + minItems: 2 > + maxItems: 3 > + description: > + References to reserved-memory regions for REE<->TEE communication. > + Entries must match memory-region-names order. Obvious. Please do not come with your own style of bindings. > + > + memory-region-names: > + minItems: 2 > + maxItems: 3 Why is this flexible? > + items: > + enum: > + - rpc-t2r-ring rpc is redundant, drop > + - rpc-t2r-shm > + - rpc-r2t-ring > + > +required: > + - compatible > + > +allOf: > + - if: > + required: > + - interrupts > + then: > + required: > + - interrupts > + - memory-region > + - memory-region-names > + properties: > + msi-parent: false > + memory-region: > + minItems: 2 > + maxItems: 2 > + memory-region-names: > + items: > + - const: rpc-t2r-ring > + - const: rpc-t2r-shm > + else: > + required: > + - msi-parent > + - memory-region > + - memory-region-names So memory-region is always required? > + properties: > + memory-region: > + minItems: 3 > + maxItems: 3 > + memory-region-names: > + items: > + - const: rpc-t2r-ring > + - const: rpc-t2r-shm > + - const: rpc-r2t-ring Your top level schema said that. You only need minItems. > + > +additionalProperties: false > + > +examples: > + - | > + /* ARM TrustZone (SMC) */ > + #include > + / { > + #address-cells = <2>; > + #size-cells = <2>; > + > + gic: interrupt-controller@2f000000 { > + compatible = "arm,gic-v3"; > + reg = <0 0x2f000000 0 0x10000>, > + <0 0x2f100000 0 0x200000>; > + interrupt-controller; > + #interrupt-cells = <3>; > + }; > + > + reserved-memory { > + #address-cells = <2>; > + #size-cells = <2>; > + ranges; > + > + mbedtee_t2r_ring: rpc-t2r-ring@85f10000 { > + reg = <0 0x85f10000 0 0x20000>; > + no-map; > + }; > + > + mbedtee_t2r_shm: rpc-t2r-shm@85f30000 { > + reg = <0 0x85f30000 0 0x40000>; > + no-map; > + }; > + }; None of the above is relevant, drop. > + > + firmware { > + mbedtee { > + compatible = "mbedtee,rpc"; > + interrupt-parent = <&gic>; > + interrupts = ; > + memory-region = <&mbedtee_t2r_ring>, <&mbedtee_t2r_shm>; > + memory-region-names = "rpc-t2r-ring", "rpc-t2r-shm"; > + }; > + }; > + }; > + Best regards, Krzysztof