Message ID | 20240118100433.3984196-3-arnaud.pouliquen@foss.st.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-29997-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp238557dyb; Thu, 18 Jan 2024 02:07:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUld90ucW19EzUQt1ECmN9ItevgrESj01RWv4JQgYlcMK5WiMWnzS9QLDY86abKjsc5tsv X-Received: by 2002:a05:6359:6104:b0:175:d3c6:a495 with SMTP id rz4-20020a056359610400b00175d3c6a495mr433795rwb.57.1705572475412; Thu, 18 Jan 2024 02:07:55 -0800 (PST) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o7-20020a634e47000000b005cdc5c9d6a2si1221764pgl.576.2024.01.18.02.07.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 02:07:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29997-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=LOhIt2e7; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-29997-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29997-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 207CE28653D for <ouuuleilei@gmail.com>; Thu, 18 Jan 2024 10:07:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E523C20B01; Thu, 18 Jan 2024 10:07:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b="LOhIt2e7" Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 5081A2030E; Thu, 18 Jan 2024 10:07:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.132.182.106 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705572455; cv=none; b=PPGIIhaqi2il59n0dDDtMpOEcaocOkoBkzWaMzl6k3xYWkFvWJKN3/k/1/NUEZfQyc7iWRx2mgf83ih2xMlJu30VQC34EM+8DtE5oF7L1zzJYAO7JhOKffmMRXb/F28ECZhZ/xBFUyTfTIfhyJ+3BCnyf5tKSSoT4AQsJbmq0DY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705572455; c=relaxed/simple; bh=40VPSU6AX02vAqlvOdfGbStxQT2t/I9uVKGR7e2jgQ8=; h=Received:DKIM-Signature:Received:Received:Received:Received:From: To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy:X-Proofpoint-Virus-Version; b=AmyNn48ao7Y//ss6NxLau+8n8R8meK7DtFjRy/RPxbDPzNu9/mYCg10/mRaDw32S2JKYe9ZVr3Dvu+Ng641bCMFeqOOFVMNBq9WmuQf3MzMTj2gzg22VnmAbAkDCR5JmcLxYIKr5czgUx6udqc6lEDiA1KjAhdRKdHKjJMRfrPA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b=LOhIt2e7; arc=none smtp.client-ip=185.132.182.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40I4Et6h017221; Thu, 18 Jan 2024 11:07:06 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=8S4qqZRLK56BR/uibHO2eixbPZSWZd1/08c0a5yZAKc=; b=LO hIt2e7LcKdlfpqPqKke/yLHvNtQzZFsDQU01IWsHs8sZOdEyczPwDTd/nZEqhbo5 VZEq1DTjo8NxF8VwmrbP3t02nU4ll3l0Mj7NRwkLfYAvB8ZGEtkNHwl+wWKNteGa zkxJNLBmRxm5FXCpiPxjHttZmA44Oc/4vfcidxMiXb26lwMUuybI7tTXpg31CEok id2WYlVC3jcMgpSX6SFuvTRXDbN2oLSdCyYzMippOtnr/2xl4aChj8XfyDw2zKTY YRbHvFUpUtqplIj+3YwbvyJhkMmqW6P+YPRrtTVzwnxtdU5b55sqkuJCPgKE5cVw ySGTSyDfPKVNPPEaiqhw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3vm4y5603s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jan 2024 11:07:06 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 483C010007D; Thu, 18 Jan 2024 11:07:05 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 408A921A22A; Thu, 18 Jan 2024 11:07:05 +0100 (CET) Received: from localhost (10.201.20.75) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 18 Jan 2024 11:07:04 +0100 From: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> To: Bjorn Andersson <andersson@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Jens Wiklander <jens.wiklander@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> CC: <linux-stm32@st-md-mailman.stormreply.com>, <linux-arm-kernel@lists.infradead.org>, <linux-remoteproc@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <op-tee@lists.trustedfirmware.org>, <devicetree@vger.kernel.org>, Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Subject: [PATCH v2 2/4] dt-bindings: remoteproc: Add compatibility for TEE support Date: Thu, 18 Jan 2024 11:04:31 +0100 Message-ID: <20240118100433.3984196-3-arnaud.pouliquen@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240118100433.3984196-1-arnaud.pouliquen@foss.st.com> References: <20240118100433.3984196-1-arnaud.pouliquen@foss.st.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-18_05,2024-01-17_01,2023-05-22_02 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788422363692746558 X-GMAIL-MSGID: 1788422363692746558 |
Series |
Introduction of a remoteproc tee to load signed firmware
|
|
Commit Message
Arnaud POULIQUEN
Jan. 18, 2024, 10:04 a.m. UTC
The "st,stm32mp1-m4-tee" compatible is utilized in a system configuration
where the Cortex-M4 firmware is loaded by the Trusted execution Environment
(TEE).
For instance, this compatible is used in both the Linux and OP-TEE
device-tree:
- In OP-TEE, a node is defined in the device tree with the
st,stm32mp1-m4-tee to support signed remoteproc firmware.
Based on DT properties, OP-TEE authenticates, loads, starts, and stops
the firmware.
- On Linux, when the compatibility is set, the Cortex-M resets should not
be declared in the device tree.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
---
V1 to V2 updates
- update "st,stm32mp1-m4" compatible description to generalize
- remove the 'reset-names' requirement in one conditional branch, as the
property is already part of the condition test.
---
.../bindings/remoteproc/st,stm32-rproc.yaml | 52 +++++++++++++++----
1 file changed, 43 insertions(+), 9 deletions(-)
Comments
On 18/01/2024 11:04, Arnaud Pouliquen wrote: > The "st,stm32mp1-m4-tee" compatible is utilized in a system configuration > where the Cortex-M4 firmware is loaded by the Trusted execution Environment > (TEE). > For instance, this compatible is used in both the Linux and OP-TEE > device-tree: > - In OP-TEE, a node is defined in the device tree with the > st,stm32mp1-m4-tee to support signed remoteproc firmware. > Based on DT properties, OP-TEE authenticates, loads, starts, and stops > the firmware. > - On Linux, when the compatibility is set, the Cortex-M resets should not > be declared in the device tree. > > Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> > --- > V1 to V2 updates > - update "st,stm32mp1-m4" compatible description to generalize > - remove the 'reset-names' requirement in one conditional branch, as the > property is already part of the condition test. > --- > .../bindings/remoteproc/st,stm32-rproc.yaml | 52 +++++++++++++++---- > 1 file changed, 43 insertions(+), 9 deletions(-) > > diff --git a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml > index 370af61d8f28..6af821b15736 100644 > --- a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml > +++ b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml > @@ -16,7 +16,12 @@ maintainers: > > properties: > compatible: > - const: st,stm32mp1-m4 > + enum: > + - st,stm32mp1-m4 > + - st,stm32mp1-m4-tee The patch looks good to me, but I wonder about this choice of two compatibles. Basically this is the same hardware with the same interface, but two compatibles to differentiate a bit different firmware setup. We have already such cases for Qualcomm [1] [2] and new ones will be coming. [3] I wonder whether this should be rather the same compatible with additional property, e.g. "st,tee-control" or "remote-control". [1] https://elixir.bootlin.com/linux/v6.7.1/source/Documentation/devicetree/bindings/dma/qcom,bam-dma.yaml#L54 [2] https://elixir.bootlin.com/linux/v6.7.1/source/Documentation/devicetree/bindings/net/qcom,ipa.yaml#L129 (that's a bit different) [3] https://lore.kernel.org/linux-devicetree/20240124103623.GJ4906@thinkpad/ @Rob, Any general guidance for this and Qualcomm? Best regards, Krzysztof
Hello Krzysztof, On 1/26/24 12:03, Krzysztof Kozlowski wrote: > On 18/01/2024 11:04, Arnaud Pouliquen wrote: >> The "st,stm32mp1-m4-tee" compatible is utilized in a system configuration >> where the Cortex-M4 firmware is loaded by the Trusted execution Environment >> (TEE). >> For instance, this compatible is used in both the Linux and OP-TEE >> device-tree: >> - In OP-TEE, a node is defined in the device tree with the >> st,stm32mp1-m4-tee to support signed remoteproc firmware. >> Based on DT properties, OP-TEE authenticates, loads, starts, and stops >> the firmware. >> - On Linux, when the compatibility is set, the Cortex-M resets should not >> be declared in the device tree. >> >> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> >> --- >> V1 to V2 updates >> - update "st,stm32mp1-m4" compatible description to generalize >> - remove the 'reset-names' requirement in one conditional branch, as the >> property is already part of the condition test. >> --- >> .../bindings/remoteproc/st,stm32-rproc.yaml | 52 +++++++++++++++---- >> 1 file changed, 43 insertions(+), 9 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml >> index 370af61d8f28..6af821b15736 100644 >> --- a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml >> +++ b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml >> @@ -16,7 +16,12 @@ maintainers: >> >> properties: >> compatible: >> - const: st,stm32mp1-m4 >> + enum: >> + - st,stm32mp1-m4 >> + - st,stm32mp1-m4-tee > > The patch looks good to me, but I wonder about this choice of two > compatibles. > > Basically this is the same hardware with the same interface, but two > compatibles to differentiate a bit different firmware setup. We have > already such cases for Qualcomm [1] [2] and new ones will be coming. [3] > > I wonder whether this should be rather the same compatible with > additional property, e.g. "st,tee-control" or "remote-control". Yes the point is valid, I asked myself the question. I proposed a compatibility solution for one main reason. On the STM32MP15, if the firmware is loaded by Linux, no driver is probed in OP-TEE. But if the firmware is authenticated and loaded by OP-TEE, a Op-TEE driver is probed to manage memory access rights. The drawback of a property is that we would need to probe the OP-TEE driver for the STM32MP1 platform even if it is not used, just to check this property. Thanks, Arnaud > > [1] > https://elixir.bootlin.com/linux/v6.7.1/source/Documentation/devicetree/bindings/dma/qcom,bam-dma.yaml#L54 > > [2] > https://elixir.bootlin.com/linux/v6.7.1/source/Documentation/devicetree/bindings/net/qcom,ipa.yaml#L129 > (that's a bit different) > > [3] https://lore.kernel.org/linux-devicetree/20240124103623.GJ4906@thinkpad/ > > @Rob, > Any general guidance for this and Qualcomm? > > Best regards, > Krzysztof >
On Fri, Jan 26, 2024 at 12:03:25PM +0100, Krzysztof Kozlowski wrote: > On 18/01/2024 11:04, Arnaud Pouliquen wrote: > > The "st,stm32mp1-m4-tee" compatible is utilized in a system configuration > > where the Cortex-M4 firmware is loaded by the Trusted execution Environment > > (TEE). > > For instance, this compatible is used in both the Linux and OP-TEE > > device-tree: > > - In OP-TEE, a node is defined in the device tree with the > > st,stm32mp1-m4-tee to support signed remoteproc firmware. > > Based on DT properties, OP-TEE authenticates, loads, starts, and stops > > the firmware. > > - On Linux, when the compatibility is set, the Cortex-M resets should not > > be declared in the device tree. > > > > Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> > > --- > > V1 to V2 updates > > - update "st,stm32mp1-m4" compatible description to generalize > > - remove the 'reset-names' requirement in one conditional branch, as the > > property is already part of the condition test. > > --- > > .../bindings/remoteproc/st,stm32-rproc.yaml | 52 +++++++++++++++---- > > 1 file changed, 43 insertions(+), 9 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml > > index 370af61d8f28..6af821b15736 100644 > > --- a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml > > +++ b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml > > @@ -16,7 +16,12 @@ maintainers: > > > > properties: > > compatible: > > - const: st,stm32mp1-m4 > > + enum: > > + - st,stm32mp1-m4 > > + - st,stm32mp1-m4-tee > > The patch looks good to me, but I wonder about this choice of two > compatibles. > > Basically this is the same hardware with the same interface, but two > compatibles to differentiate a bit different firmware setup. We have > already such cases for Qualcomm [1] [2] and new ones will be coming. [3] > > I wonder whether this should be rather the same compatible with > additional property, e.g. "st,tee-control" or "remote-control". > > [1] > https://elixir.bootlin.com/linux/v6.7.1/source/Documentation/devicetree/bindings/dma/qcom,bam-dma.yaml#L54 > > [2] > https://elixir.bootlin.com/linux/v6.7.1/source/Documentation/devicetree/bindings/net/qcom,ipa.yaml#L129 > (that's a bit different) > > [3] https://lore.kernel.org/linux-devicetree/20240124103623.GJ4906@thinkpad/ > > @Rob, > Any general guidance for this and Qualcomm? I think we have cases using compatible already as well. Either way is fine with me. Rob
On Thu, Jan 18, 2024 at 11:04:31AM +0100, Arnaud Pouliquen wrote: > The "st,stm32mp1-m4-tee" compatible is utilized in a system configuration > where the Cortex-M4 firmware is loaded by the Trusted execution Environment > (TEE). > For instance, this compatible is used in both the Linux and OP-TEE > device-tree: > - In OP-TEE, a node is defined in the device tree with the > st,stm32mp1-m4-tee to support signed remoteproc firmware. > Based on DT properties, OP-TEE authenticates, loads, starts, and stops > the firmware. > - On Linux, when the compatibility is set, the Cortex-M resets should not > be declared in the device tree. > > Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> > --- > V1 to V2 updates > - update "st,stm32mp1-m4" compatible description to generalize > - remove the 'reset-names' requirement in one conditional branch, as the > property is already part of the condition test. > --- > .../bindings/remoteproc/st,stm32-rproc.yaml | 52 +++++++++++++++---- > 1 file changed, 43 insertions(+), 9 deletions(-) > > diff --git a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml > index 370af61d8f28..6af821b15736 100644 > --- a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml > +++ b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml > @@ -16,7 +16,12 @@ maintainers: > > properties: > compatible: > - const: st,stm32mp1-m4 > + enum: > + - st,stm32mp1-m4 > + - st,stm32mp1-m4-tee > + description: > + Use "st,stm32mp1-m4" for the Cortex-M4 coprocessor management by non-secure context > + Use "st,stm32mp1-m4-tee" for the Cortex-M4 coprocessor management by secure context > > reg: > description: > @@ -142,21 +147,40 @@ properties: > required: > - compatible > - reg > - - resets > > allOf: > - if: > properties: > - reset-names: > - not: > - contains: > - const: hold_boot > + compatible: > + contains: > + const: st,stm32mp1-m4 > + then: > + if: > + properties: > + reset-names: > + not: > + contains: > + const: hold_boot Note that this is true when 'reset-names' is not present. If that is not desired, then you need 'required: [reset-names]'. Not really a new issue though. > + then: > + required: > + - st,syscfg-holdboot > + - resets > + else: > + properties: > + st,syscfg-holdboot: false > + required: > + - resets 'resets' is always required within the outer 'then' schema, so you can move this up a level. > + > + - if: > + properties: > + compatible: > + contains: > + const: st,stm32mp1-m4-tee > then: > - required: > - - st,syscfg-holdboot > - else: > properties: > st,syscfg-holdboot: false > + reset-names: false > + resets: false > > additionalProperties: false > > @@ -188,5 +212,15 @@ examples: > st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>; > st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>; > }; > + - | > + #include <dt-bindings/reset/stm32mp1-resets.h> > + m4@10000000 { > + compatible = "st,stm32mp1-m4-tee"; > + reg = <0x10000000 0x40000>, > + <0x30000000 0x40000>, > + <0x38000000 0x10000>; > + st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>; > + st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>; > + }; > > ... > -- > 2.25.1 >
Hello Rob, On 1/30/24 18:51, Rob Herring wrote: > On Thu, Jan 18, 2024 at 11:04:31AM +0100, Arnaud Pouliquen wrote: >> The "st,stm32mp1-m4-tee" compatible is utilized in a system configuration >> where the Cortex-M4 firmware is loaded by the Trusted execution Environment >> (TEE). >> For instance, this compatible is used in both the Linux and OP-TEE >> device-tree: >> - In OP-TEE, a node is defined in the device tree with the >> st,stm32mp1-m4-tee to support signed remoteproc firmware. >> Based on DT properties, OP-TEE authenticates, loads, starts, and stops >> the firmware. >> - On Linux, when the compatibility is set, the Cortex-M resets should not >> be declared in the device tree. >> >> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> >> --- >> V1 to V2 updates >> - update "st,stm32mp1-m4" compatible description to generalize >> - remove the 'reset-names' requirement in one conditional branch, as the >> property is already part of the condition test. >> --- >> .../bindings/remoteproc/st,stm32-rproc.yaml | 52 +++++++++++++++---- >> 1 file changed, 43 insertions(+), 9 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml >> index 370af61d8f28..6af821b15736 100644 >> --- a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml >> +++ b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml >> @@ -16,7 +16,12 @@ maintainers: >> >> properties: >> compatible: >> - const: st,stm32mp1-m4 >> + enum: >> + - st,stm32mp1-m4 >> + - st,stm32mp1-m4-tee >> + description: >> + Use "st,stm32mp1-m4" for the Cortex-M4 coprocessor management by non-secure context >> + Use "st,stm32mp1-m4-tee" for the Cortex-M4 coprocessor management by secure context >> >> reg: >> description: >> @@ -142,21 +147,40 @@ properties: >> required: >> - compatible >> - reg >> - - resets >> >> allOf: >> - if: >> properties: >> - reset-names: >> - not: >> - contains: >> - const: hold_boot >> + compatible: >> + contains: >> + const: st,stm32mp1-m4 >> + then: >> + if: >> + properties: >> + reset-names: >> + not: >> + contains: >> + const: hold_boot > > Note that this is true when 'reset-names' is not present. If that is not > desired, then you need 'required: [reset-names]'. Not really a new issue > though. > Yes that corresponds to my expectation, for compatibility with legacy DT. If the hold_boot reset was not used, reset-names was not mandatory I will add the 'required: [reset-names]' in the else Thanks, Arnaud >> + then: >> + required: >> + - st,syscfg-holdboot >> + - resets >> + else: >> + properties: >> + st,syscfg-holdboot: false >> + required: >> + - resets > > 'resets' is always required within the outer 'then' schema, so you can > move this up a level. > >> + >> + - if: >> + properties: >> + compatible: >> + contains: >> + const: st,stm32mp1-m4-tee >> then: >> - required: >> - - st,syscfg-holdboot >> - else: >> properties: >> st,syscfg-holdboot: false >> + reset-names: false >> + resets: false >> >> additionalProperties: false >> >> @@ -188,5 +212,15 @@ examples: >> st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>; >> st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>; >> }; >> + - | >> + #include <dt-bindings/reset/stm32mp1-resets.h> >> + m4@10000000 { >> + compatible = "st,stm32mp1-m4-tee"; >> + reg = <0x10000000 0x40000>, >> + <0x30000000 0x40000>, >> + <0x38000000 0x10000>; >> + st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>; >> + st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>; >> + }; >> >> ... >> -- >> 2.25.1 >>
diff --git a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml index 370af61d8f28..6af821b15736 100644 --- a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml +++ b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml @@ -16,7 +16,12 @@ maintainers: properties: compatible: - const: st,stm32mp1-m4 + enum: + - st,stm32mp1-m4 + - st,stm32mp1-m4-tee + description: + Use "st,stm32mp1-m4" for the Cortex-M4 coprocessor management by non-secure context + Use "st,stm32mp1-m4-tee" for the Cortex-M4 coprocessor management by secure context reg: description: @@ -142,21 +147,40 @@ properties: required: - compatible - reg - - resets allOf: - if: properties: - reset-names: - not: - contains: - const: hold_boot + compatible: + contains: + const: st,stm32mp1-m4 + then: + if: + properties: + reset-names: + not: + contains: + const: hold_boot + then: + required: + - st,syscfg-holdboot + - resets + else: + properties: + st,syscfg-holdboot: false + required: + - resets + + - if: + properties: + compatible: + contains: + const: st,stm32mp1-m4-tee then: - required: - - st,syscfg-holdboot - else: properties: st,syscfg-holdboot: false + reset-names: false + resets: false additionalProperties: false @@ -188,5 +212,15 @@ examples: st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>; st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>; }; + - | + #include <dt-bindings/reset/stm32mp1-resets.h> + m4@10000000 { + compatible = "st,stm32mp1-m4-tee"; + reg = <0x10000000 0x40000>, + <0x30000000 0x40000>, + <0x38000000 0x10000>; + st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>; + st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>; + }; ...