linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] dt-bindings: Introduce feature-domain-controller
@ 2022-10-26 17:51 Oleksii Moisieiev
  2022-10-26 17:51 ` [PATCH v5 2/2] dt-bindings: Document common device controller bindings Oleksii Moisieiev
  2022-10-26 17:51 ` [PATCH v5 1/2] dt-bindings: Update scmi node description Oleksii Moisieiev
  0 siblings, 2 replies; 6+ messages in thread
From: Oleksii Moisieiev @ 2022-10-26 17:51 UTC (permalink / raw)
  To: robh+dt
  Cc: Oleksii Moisieiev, mcoquelin.stm32, alexandre.torgue,
	linus.walleij, gregkh, devicetree, tomase, benjamin.gaignard,
	broonie, arnd, shawnguo, fabio.estevam, loic.pallardy,
	mark.rutland, Sudeep Holla, Cristian Marussi, Stefano Stabellini,
	a.fatoum, peng.fan, linux-kernel

Introducing the feature domain controller provider/consumenr bindngs which
allow to divided system on chip into multiple feature domains that can be used
to select by who hardware blocks could be accessed.
A feature-domain could be a cluster of CPUs, a group of hardware blocks or the
set of devices, passed-through to the Guest in the virtualized systems.

Feature domains controllers are typically used to set the permissions of the
hardware block. The contents of the feature domain configuration properties
are defined by the binding for the individual feature domain controller device.

The feature device controller conception in the virtualized systems is to set
the device configuration for SCMI (System Control and Management
Interface) which controls clocks/power-domains/resets etc from the
Firmware. This configuratio sets the device_id to set the device permissions
for the Fimware using BASE_SET_DEVICE_PERMISSIONS message (see 4.2.2.10 of [0]).
There is no BASE_GET_DEVICE_PERMISSIONS call in SCMI and the way to
determine device_id is not covered by the specification.
Device permissions management described in DEN 0056, Section 4.2.2.10 [0].
Given parameter should set the device_id, needed to set device
permissions in the Firmware.
This property is used by trusted Agent (which is hypervisor in our case)
to set permissions for the devices, passed-through to the non-trusted
Agents. Trusted Agent will use device-perms to set the Device
permissions for the Firmware (See Section 4.2.2.10 [0] for details).
Agents concept is described in Section 4.2.1 [0].

Feature-Domains in Device-tree node example:
usb@e6590000
{
    feature-domains = <&scmi 19>; //Set domain id 19 to usb node
    feature-domain-names = "scmi";
    clocks = <&scmi_clock 3>, <&scmi_clock 2>;
    resets = <&scmi_reset 10>, <&scmi_reset 9>;
    power-domains = <&scmi_power 0>;
};

&scmi {
    feature-domain-controller;
    #feature-domain-cells = <1>;
}

All mentioned bindings are going to be processed by XEN SCMI mediator
feature, which is responsible to redirect SCMI calls from guests to the
firmware, and not going be passed to the guests.

Feature-domain-controller provider/consumenr concept was taken from the bus
controller framework patch series, provided in the following thread:
[1].

I think we can cooperate with the bus controller framework developers
and produce the common binding, which will fit the requirements of both
features

Also, I think that binding can also be used for STM32 ETZPC bus
controller feature, proposed in the following thread: [2].

Looking forward for your thoughts and ideas.

[0] https://developer.arm.com/documentation/den0056/latest
[1] https://lore.kernel.org/all/20190318100605.29120-1-benjamin.gaignard@st.com/
[2] https://lore.kernel.org/all/20200701132523.32533-1-benjamin.gaignard@st.com/

---
Changes v1 -> V2:
   - update parameter name, made it xen-specific
   - add xen vendor bindings

Changes V2 -> V3:
   - update parameter name, make it generic
   - update parameter format, add link to controller
   - do not include xen vendor bindings as already upstreamed

Changes V3 -> V4:
   - introduce domain controller provider/consumer device tree bindings
   - making scmi node to act as domain controller provider when the
     device permissions should be configured

Changes V4 -> V5:
   - rename domain-controller to feature-domain-controller
   - feature-domains format fixes

Oleksii Moisieiev (2):
  dt-bindings: Update scmi node description
  dt-bindings: Document common device controller bindings

 .../feature-domain-controller.yaml            | 80 +++++++++++++++++++
 .../bindings/firmware/arm,scmi.yaml           | 28 +++++++
 2 files changed, 108 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml

-- 
2.34.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v5 1/2] dt-bindings: Update scmi node description
  2022-10-26 17:51 [PATCH v5 0/2] dt-bindings: Introduce feature-domain-controller Oleksii Moisieiev
  2022-10-26 17:51 ` [PATCH v5 2/2] dt-bindings: Document common device controller bindings Oleksii Moisieiev
@ 2022-10-26 17:51 ` Oleksii Moisieiev
  1 sibling, 0 replies; 6+ messages in thread
From: Oleksii Moisieiev @ 2022-10-26 17:51 UTC (permalink / raw)
  To: robh+dt
  Cc: Oleksii Moisieiev, mcoquelin.stm32, alexandre.torgue,
	linus.walleij, gregkh, devicetree, tomase, benjamin.gaignard,
	broonie, arnd, shawnguo, fabio.estevam, loic.pallardy,
	mark.rutland, Sudeep Holla, Cristian Marussi, Stefano Stabellini,
	a.fatoum, peng.fan, linux-kernel

Add '#feature-domain-cells' property description to the scmi node.
This property makes scmi node as feature-domain-controller provider, which
allows consumers to provide scmi node with the device_ids of the devices, which
are using scmi protocols to control clocks/resets/power-domains etc.
The device_ids could be used to set the device permissions for the
Fimware using BASE_SET_DEVICE_PERMISSIONS message (see 4.2.2.10 of [0]).
Device permissions management described in DEN 0056, Section 4.2.2.10 [0].

For SCMI this property is used by Trusted Agent to set the device permissions
for the Non-Trusted Agents.
Trusted and non-trusted Agent terms described in Section 4.1.1 [0].

[0] https://developer.arm.com/documentation/den0056/latest

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
---
Changes v1 -> V2:
   - update parameter name, made it xen-specific
   - add xen vendor bindings

Changes V2 -> V3:
   - update parameter name, make it generic
   - update parameter format, add link to controller
   - do not include xen vendor bindings as already upstreamed

Changes V3 -> V4:
   - introduce domain controller provider/consumer device tree bindings
   - making scmi node to act as domain controller provider when the
     device permissions should be configured

Changes V4 -> V5:
   - rename domain-controller to feature-domain-controller
   - feature-domains format fixes
---
 .../bindings/firmware/arm,scmi.yaml           | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
index 1c0388da6721..bb5aa49e88fd 100644
--- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
+++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
@@ -89,6 +89,16 @@ properties:
       atomic mode of operation, even if requested.
     default: 0
 
+  '#feature-domain-cells':
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Number of cells in a domain controller specifier.
+      Set const to 1 here for nodes providing the device id, needed for
+      the BASE_SET_DEVICE_PERMISSIONS message (see 4.2.2.10 of [0]).
+    const: 1
+
+  feature-domain-controller: true
+
   arm,smc-id:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
@@ -429,4 +439,22 @@ examples:
         };
     };
 
+  - |
+    firmware {
+        scmi_link: scmi {
+            compatible = "arm,scmi-smc";
+            shmem = <&cpu_scp_lpri0 &cpu_scp_lpri1>;
+            arm,smc-id = <0xc3000001>;
+
+            #address-cells = <1>;
+            #size-cells = <0>;
+            feature-domain-controller;
+            #feature-domain-cells = <1>;
+        };
+    };
+
+    foo@0 {
+      reg = <0x0 0x10>;
+      feature-domains = <&scmi_link 1>;
+    };
 ...
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v5 2/2] dt-bindings: Document common device controller bindings
  2022-10-26 17:51 [PATCH v5 0/2] dt-bindings: Introduce feature-domain-controller Oleksii Moisieiev
@ 2022-10-26 17:51 ` Oleksii Moisieiev
  2022-10-26 21:51   ` Rob Herring
  2022-10-26 17:51 ` [PATCH v5 1/2] dt-bindings: Update scmi node description Oleksii Moisieiev
  1 sibling, 1 reply; 6+ messages in thread
From: Oleksii Moisieiev @ 2022-10-26 17:51 UTC (permalink / raw)
  To: robh+dt
  Cc: Oleksii Moisieiev, mcoquelin.stm32, alexandre.torgue,
	linus.walleij, gregkh, devicetree, tomase, benjamin.gaignard,
	broonie, arnd, shawnguo, fabio.estevam, loic.pallardy,
	mark.rutland, Sudeep Holla, Cristian Marussi, Stefano Stabellini,
	a.fatoum, peng.fan, linux-kernel

Introducing of the common device controller bindings for the controller
provider and consumer devices. Those bindings are intended to allow
divided system on chip into muliple domains, that can be used to
configure hardware permissions.

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
---
 .../feature-domain-controller.yaml            | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml

diff --git a/Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml b/Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml
new file mode 100644
index 000000000000..431382099012
--- /dev/null
+++ b/Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/feature-domains/feature-domain-controller.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic Domain Controller bindings
+
+maintainers:
+  - Oleksii Moisieiev <oleksii_moisieiev@epam.com>
+
+description: |+
+  Common Feature Domains Controller bindings properties
+
+  Domain controllers allow to divided system on chip into multiple feature
+  domains that can be used to select by who hardware blocks could be accessed.
+  A feature domain could be a cluster of CPUs (or coprocessors), a range of
+  addresses or a group of hardware blocks.
+
+  This device tree bindings can be used to bind feature domain consumer devices
+  with their feature domains provided by feature-domains controllers.
+  Feature omain controller provider can be represened by any node in the
+  device tree and can provide one or more configuration parameters, needed to
+  control parameters of the consumer device. A consumer node can refer to the
+  provider by phandle and a set of phandle arguments, specified by
+  '#feature-domain-cells' property in the device controller provider node.
+
+  Device controllers are typically used to set the permissions of the hardware
+  block. The contents of the feature-domains configuration properties are
+  defined by the binding for the individual feature-domains controller device.
+
+  Each node can be a consumer for the several providers. The first
+  configuration of 'feature-domains' or the one named 'default' is applied
+  before probing the device itself.
+
+# always select the core schema
+select: true
+
+properties:
+  '#feature-domain-cells':
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Number of cells in a feature-domains controller specifier;
+      Can be any value as specified by device tree binding documentation
+      of a particular provider.
+
+  feature-domain-names:
+    $ref: '/schemas/types.yaml#/definitions/string-array'
+    minItems: 1
+    description:
+      A list of feature-domains names, sorted in the same order as
+      feature-domains entries. Consumer drivers will use feature-domain-names
+      to match with existing feature-domains entries.
+
+  feature-domains:
+    $ref: "/schemas/types.yaml#/definitions/phandle-array"
+    description:
+      A list of feature-domains controller specifiers, as defined by the
+      bindings of the feature-domain-controller provider.
+
+additionalProperties: true
+
+examples:
+  - |
+    ctrl0: ctrl@100 {
+        feature-domain-controller;
+        reg = <0x100 0x10>;
+        #feature-domain-cells = <2>;
+    };
+
+    ctrl1: ctrl@110 {
+        feature-domain-controller;
+        reg = <0x110 0x10>;
+        #feature-domain-cells = <3>;
+    };
+
+    foo@0 {
+        reg = <0x0 0x1>;
+        feature-domains = <&ctrl0 1 2>, <&ctrl1 3 4 5>;
+        feature-domain-names = "default", "unbind";
+    };
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v5 2/2] dt-bindings: Document common device controller bindings
  2022-10-26 17:51 ` [PATCH v5 2/2] dt-bindings: Document common device controller bindings Oleksii Moisieiev
@ 2022-10-26 21:51   ` Rob Herring
  2022-10-27  6:35     ` Oleksii Moisieiev
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2022-10-26 21:51 UTC (permalink / raw)
  To: Oleksii Moisieiev
  Cc: fabio.estevam, alexandre.torgue, peng.fan, linux-kernel,
	linus.walleij, mark.rutland, mcoquelin.stm32, broonie, arnd,
	a.fatoum, shawnguo, Stefano Stabellini, tomase,
	benjamin.gaignard, loic.pallardy, Cristian Marussi, devicetree,
	gregkh, robh+dt, Sudeep Holla

On Wed, 26 Oct 2022 17:51:27 +0000, Oleksii Moisieiev wrote:
> Introducing of the common device controller bindings for the controller
> provider and consumer devices. Those bindings are intended to allow
> divided system on chip into muliple domains, that can be used to
> configure hardware permissions.
> 
> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> ---
>  .../feature-domain-controller.yaml            | 80 +++++++++++++++++++
>  1 file changed, 80 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/feature-domains/feature-domain-controller.example.dtb: foo@0: feature-domain-names: ['default', 'unbind'] is too long
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml

doc reference errors (make refcheckdocs):


See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/ab68324eea3c788a369260f5a1e5da843a960cde.1666806317.git.oleksii_moisieiev@epam.com/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5 2/2] dt-bindings: Document common device controller bindings
  2022-10-26 21:51   ` Rob Herring
@ 2022-10-27  6:35     ` Oleksii Moisieiev
  2022-10-28 17:39       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Oleksii Moisieiev @ 2022-10-27  6:35 UTC (permalink / raw)
  To: Rob Herring
  Cc: fabio.estevam, alexandre.torgue, peng.fan, linux-kernel,
	linus.walleij, mark.rutland, mcoquelin.stm32, broonie, arnd,
	a.fatoum, shawnguo, Stefano Stabellini, tomase,
	benjamin.gaignard, loic.pallardy, Cristian Marussi, devicetree,
	gregkh, robh+dt, Sudeep Holla

On Wed, Oct 26, 2022 at 04:51:15PM -0500, Rob Herring wrote:
> On Wed, 26 Oct 2022 17:51:27 +0000, Oleksii Moisieiev wrote:
> > Introducing of the common device controller bindings for the controller
> > provider and consumer devices. Those bindings are intended to allow
> > divided system on chip into muliple domains, that can be used to
> > configure hardware permissions.
> > 
> > Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> > ---
> >  .../feature-domain-controller.yaml            | 80 +++++++++++++++++++
> >  1 file changed, 80 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml
> > 
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/feature-domains/feature-domain-controller.example.dtb: foo@0: feature-domain-names: ['default', 'unbind'] is too long
> 	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml
> 
> doc reference errors (make refcheckdocs):
> 
> 
> See https://urldefense.com/v3/__https://patchwork.ozlabs.org/project/devicetree-bindings/patch/ab68324eea3c788a369260f5a1e5da843a960cde.1666806317.git.oleksii_moisieiev@epam.com/__;!!GF_29dbcQIUBPA!y6dnIrQEa4gr2RDYPf2_Oc7JsKHJrAKtl69xg0Jlf-Qri5BP9kBzqIknprWXaikX5y2Yz_UWCW5yYv_9Hw$  [patchwork[.]ozlabs[.]org]
> 
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
> 
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
> 
> pip3 install dtschema --upgrade
> 
> Please check and re-submit.
> 

Hello,

Thank you for the response. I would recheck and resubmit patch series if there
will be no additional comments.

Best regards,
Oleksii.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5 2/2] dt-bindings: Document common device controller bindings
  2022-10-27  6:35     ` Oleksii Moisieiev
@ 2022-10-28 17:39       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-10-28 17:39 UTC (permalink / raw)
  To: Oleksii Moisieiev, Rob Herring
  Cc: fabio.estevam, alexandre.torgue, peng.fan, linux-kernel,
	linus.walleij, mark.rutland, mcoquelin.stm32, broonie, arnd,
	a.fatoum, shawnguo, Stefano Stabellini, tomase,
	benjamin.gaignard, loic.pallardy, Cristian Marussi, devicetree,
	gregkh, robh+dt, Sudeep Holla

On 27/10/2022 02:35, Oleksii Moisieiev wrote:
> On Wed, Oct 26, 2022 at 04:51:15PM -0500, Rob Herring wrote:
>> On Wed, 26 Oct 2022 17:51:27 +0000, Oleksii Moisieiev wrote:
>>> Introducing of the common device controller bindings for the controller
>>> provider and consumer devices. Those bindings are intended to allow
>>> divided system on chip into muliple domains, that can be used to
>>> configure hardware permissions.
>>>
>>> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
>>> ---
>>>  .../feature-domain-controller.yaml            | 80 +++++++++++++++++++
>>>  1 file changed, 80 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml
>>>
>>
>> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
>> on your patch (DT_CHECKER_FLAGS is new in v5.13):
>>
>> yamllint warnings/errors:
>>
>> dtschema/dtc warnings/errors:
>> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/feature-domains/feature-domain-controller.example.dtb: foo@0: feature-domain-names: ['default', 'unbind'] is too long
>> 	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/feature-domains/feature-domain-controller.yaml
>>
>> doc reference errors (make refcheckdocs):
>>
>>
>> See https://urldefense.com/v3/__https://patchwork.ozlabs.org/project/devicetree-bindings/patch/ab68324eea3c788a369260f5a1e5da843a960cde.1666806317.git.oleksii_moisieiev@epam.com/__;!!GF_29dbcQIUBPA!y6dnIrQEa4gr2RDYPf2_Oc7JsKHJrAKtl69xg0Jlf-Qri5BP9kBzqIknprWXaikX5y2Yz_UWCW5yYv_9Hw$  [patchwork[.]ozlabs[.]org]
>>
>> This check can fail if there are any dependencies. The base for a patch
>> series is generally the most recent rc1.
>>
>> If you already ran 'make dt_binding_check' and didn't see the above
>> error(s), then make sure 'yamllint' is installed and dt-schema is up to
>> date:
>>
>> pip3 install dtschema --upgrade
>>
>> Please check and re-submit.
>>
> 
> Hello,
> 
> Thank you for the response. I would recheck and resubmit patch series if there
> will be no additional comments.
>

when resubmitting, Cc necessary maintainers as pointed out by
scripts/get_maintainer.pl. Or base your tree on something decent...

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-28 17:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 17:51 [PATCH v5 0/2] dt-bindings: Introduce feature-domain-controller Oleksii Moisieiev
2022-10-26 17:51 ` [PATCH v5 2/2] dt-bindings: Document common device controller bindings Oleksii Moisieiev
2022-10-26 21:51   ` Rob Herring
2022-10-27  6:35     ` Oleksii Moisieiev
2022-10-28 17:39       ` Krzysztof Kozlowski
2022-10-26 17:51 ` [PATCH v5 1/2] dt-bindings: Update scmi node description Oleksii Moisieiev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).