Re: [PATCH v2 2/2] dt-bindings: xen: Add xen,scmi-devid property description for SCMI

From: Rob Herring
Date: Tue Mar 08 2022 - 15:13:42 EST


On Mon, Mar 07, 2022 at 08:17:44AM +0000, Oleksii Moisieiev wrote:
> Document xen,scmi-devid property for the devices, using SCMI protocol
> to work with clocks/resets/power-domains etc. This property is intended
> to set the device_id, which should be used to manage device permissions
> in the Firmware. Device permissions management described in DEN 0056,
> Section 4.2.2.10 [0].

If device_id is a SCMI thing, how is it set for other platforms and
bindings? With clocks or power-domains, the device_id is the cell value,
right?

Since we don't yet have a device assignment, security, or partitioning
binding, you've come up with some Xen specific solution. Given I know
multiple people want some sort of binding for this, I'm not going to
accept anything short of a common binding addressing the various needs.


> This property is used by Xen hypervisor, which works as trusted Agent, to
> set permissions for the devices, passed-through to the Guest Domains,
> which are 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@xxxxxxxx>
> ---
> .../bindings/firmware/xen,scmi-devid.yaml | 42 +++++++++++++++++++
> 1 file changed, 42 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/firmware/xen,scmi-devid.yaml
>
> diff --git a/Documentation/devicetree/bindings/firmware/xen,scmi-devid.yaml b/Documentation/devicetree/bindings/firmware/xen,scmi-devid.yaml
> new file mode 100644
> index 000000000000..49dc9951b54d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/firmware/xen,scmi-devid.yaml
> @@ -0,0 +1,42 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2022 EPAM Systems.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/firmware/xen,scmi-devid.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Xen SCMI (System Control and Management Interface) Device ID binding
> +
> +maintainers:
> + - Oleksii Moisieiev <oleksii_moisieiev@xxxxxxxx>
> +
> +select: true
> +
> +description: |
> + SCMI device_id property is intended to set the device id, needed to manage
> + the device permissions via SCMI protocol in the firmware. The device_id
> + should match device ids, defined in the firmware so the device permissions
> + can be requested by sending BASE_SET_DEVICE_PERMISSIONS (see 4.2.2.10 of [0]).
> +
> + This property is used by Xen hypervisor to set the device permissions for
> + the Guest Domains. Where Xen is trusted Agent and Guest Domains are
> + non-trusted Agents.
> +
> + [0] https://developer.arm.com/documentation/den0056/latest
> +
> +properties:
> + xen,scmi-devid:
> + description: Identifier of the device, matching device id, defined in
> + the firmware.
> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> +additionalProperties: true
> +
> +examples:
> + - |
> + ohci1: usb@ee0a0000 {
> + /* ... */
> + reg = <0xee0a0000 0x100>;
> + xen,scmi-devid = <11>;

This will cause validation errors unless xen,scmi-devid is listed or
this schema is referenced in every possible device schema. That
doesn't scale, but we don't really have a solution to that. For some
common properties, the tools will add certain properties. If we
come up with something common, we'll need to add it. Or we may
need to come up with something more data driven where certain schemas
are automatically added.

Rob

> + clocks = <&scmi_clock 4>;
> + };
> --
> 2.27.0
>