devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Matt Johnston <matt@codeconstruct.com.au>
Cc: devicetree@vger.kernel.org, Wolfram Sang <wsa@kernel.org>,
	Jeremy Kerr <jk@codeconstruct.com.au>
Subject: Re: [RFC PATCH 1/2] dt-bindings: net: New binding for mctp-i2c
Date: Mon, 2 Aug 2021 10:45:03 -0600	[thread overview]
Message-ID: <CAL_Jsq+rDox9gBDpZ2ZhiBvbyeHtwJDqFv_3imgSzt8hk4K4dA@mail.gmail.com> (raw)
In-Reply-To: <20210802040458.334732-2-matt@codeconstruct.com.au>

On Sun, Aug 1, 2021 at 10:12 PM Matt Johnston <matt@codeconstruct.com.au> wrote:
>
> Used to define an endpoint to communicate with MCTP peripherals attached
> to an I2C bus.
>
> Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
> ---
>  .../devicetree/bindings/net/mctp-i2c.yaml     | 44 +++++++++++++++++++
>  1 file changed, 44 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/mctp-i2c.yaml
>
> diff --git a/Documentation/devicetree/bindings/net/mctp-i2c.yaml b/Documentation/devicetree/bindings/net/mctp-i2c.yaml
> new file mode 100644
> index 000000000000..f9378cd845d4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/mctp-i2c.yaml
> @@ -0,0 +1,44 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/mctp-i2c.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MCTP I2C transport binding
> +
> +maintainers:
> +  - Matt Johnston <matt@codeconstruct.com.au>
> +
> +description:
> +  The MCTP I2C binding defines an MCTP endpoint on the I2C bus to
> +  communicate with I2C peripherals using MCTP (DMTF specification DSP0237).

The general problem with bindings for a protocol/interface is that
those are not complete devices. What if there's something specific
about the implementation that has to be handled? For example, if the
device has to be powered on, brought out of reset or has some buggy
behavior to work around? Or perhaps there's additional functionality.
The exception is if the specification covers all of those things.

Having a specific binding doesn't preclude having a generic driver
either. With a specific compatible, either a generic or device
specific driver could be bound and the kernel could switch between
those whenever it wants.

> +
> +  An mctp-i2c device must be attached to a hardware bus adapter which supports
> +  slave functionality. The reg address must include I2C_OWN_SLAVE_ADDRESS.

This constraint can be a schema.

> +
> +
> +properties:
> +  compatible:
> +    const: mctp-i2c
> +
> +  reg:
> +    maxItems: 1
> +
> +additionalProperties: true

This is only allowed to be 'true' for common, incomplete bindings.
What other properties do you expect?

> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    #include <dt-bindings/i2c/i2c.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        mctp@50 {
> +            compatible = "mctp-i2c";
> +            reg = <(0x50 | I2C_OWN_SLAVE_ADDRESS)>;
> +        };
> +    };
> --
> 2.30.2
>

  reply	other threads:[~2021-08-02 16:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02  4:04 [RFC PATCH 0/2] MCTP I2C devicetree binding Matt Johnston
2021-08-02  4:04 ` [RFC PATCH 1/2] dt-bindings: net: New binding for mctp-i2c Matt Johnston
2021-08-02 16:45   ` Rob Herring [this message]
2021-08-11  3:39     ` Matt Johnston
2021-08-13 16:29       ` Rob Herring
2021-08-02  4:04 ` [RFC PATCH 2/2] dt-bindings: net: Add mctp-i2c bus-attach property Matt Johnston
2021-08-02 13:39   ` Rob Herring
2021-08-02 19:26   ` Rob Herring

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=CAL_Jsq+rDox9gBDpZ2ZhiBvbyeHtwJDqFv_3imgSzt8hk4K4dA@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jk@codeconstruct.com.au \
    --cc=matt@codeconstruct.com.au \
    --cc=wsa@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;
as well as URLs for NNTP newsgroup(s).