devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Johnston <matt@codeconstruct.com.au>
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org, Wolfram Sang <wsa@kernel.org>,
	Jeremy Kerr <jk@codeconstruct.com.au>
Subject: Re: [RFC PATCH v2 0/2] MCTP I2C devicetree binding
Date: Thu, 26 Aug 2021 10:27:21 +0800	[thread overview]
Message-ID: <e1e761e10df0beac3786edef1aa8f2e84ccad8fd.camel@codeconstruct.com.au> (raw)
In-Reply-To: <CAL_Jsq+5ujcLLqDezsnzkVANkM9GifxA5BUccMVwZOfBUutACw@mail.gmail.com>

On Mon, 2021-08-23 at 11:16 -0500, Rob Herring wrote:
> On Mon, Aug 23, 2021 at 2:52 AM Jeremy Kerr <jk@codeconstruct.com.au>
> wrote:

> The issue here tends to be we design things based on not having nodes
> in DT and then eventually evolve to the point where we should have had
> a separate node. Connectors or per slot PCI properties are some
> examples. Just something to keep in mind.

When these are needed we can define a DT binding for endpoint devices, as a
I2C client node. I've given the example 'mctp-device' below as a possible
future binding.

> > We're certainly open to other structures for flagging busses as
> > MCTP-capable; we can use a more representative name for this phandle
> > list, or switch to boolean properties on the subordinate nodes
> > themselves (something like the gpio-controller boolean props, perhaps?
> > though that seems harder to confine to a schema for mctp-i2c...)
> 
> Either option is fine with me. A per bus property scales better (you
> can add buses without changing the root MCTP node). We already have
> per bus properties such as 'smbus' and 'multi-master'.

How does this look, adding a property to the generic I2C bus? We'll define
a 'mctp-controller' property that can be set on any I2C bus to flag it as
having MCTP endpoints. A 'mctp-i2c-controller' binding client node is
placed on the root bus to define the local I2C address, that needs to be
present if any child mux busses have the mctp-controller property. So
busses i2c1 and i2c6 will handle MCTP devices. We could omit mctp-
controller from i2c1, in that case only i2c6 would have MCTP devices,
though we still need the 'mctp-i2c-controller' at the root.

i2c1: i2cbus1 {
  compatible = "vendor,example-i2c-controller";
  #address-cells = <1>;
  #size-cells = <0>;
  mctp-controller;

  mctp@50 {
    compatible = "mctp-i2c-controller";
    reg = <(0x50 | I2C_OWN_SLAVE_ADDRESS)>;
  };
};

i2cmux0 {
  compatible = "vendor,example-i2c-mux";
  #address-cells = <1>;
  #size-cells = <0>;
  i2c-parent = <&i2c1>;

  i2c5: i2c@0 {
    reg = <0>;
    eeprom@33 {
      compatible = "atmel,24c64";
      reg = <0x33>;
    };
  };

  i2c6: i2c@1 {
    reg = <1>;
    mctp-controller;

    // A endpoint device can optionally be described in DT.
    // (as an example, not defining it in this patch series)
    nvme@0x20 {
      compatible = "mctp-device";
      reg = <0x20>;
      // only accepts a fixed MCTP address, not using MCTP control protocol
      mctp-fixed-address = 180;
    };
  };
};


Cheers,
Matt



      reply	other threads:[~2021-08-26  2:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11  3:43 [RFC PATCH v2 0/2] MCTP I2C devicetree binding Matt Johnston
2021-08-11  3:43 ` [RFC PATCH v2 1/2] dt-bindings: net: New binding for mctp-i2c-generic Matt Johnston
2021-08-12 12:19   ` Rob Herring
2021-08-11  3:43 ` [RFC PATCH v2 2/2] dt-bindings: net: mctp-i2c-generic: support muxes Matt Johnston
2021-08-13 16:33 ` [RFC PATCH v2 0/2] MCTP I2C devicetree binding Rob Herring
2021-08-16  7:32   ` Matt Johnston
2021-08-17 21:06     ` Rob Herring
2021-08-18  4:19       ` Matt Johnston
2021-08-20 19:25         ` Rob Herring
2021-08-23  7:51           ` Jeremy Kerr
2021-08-23 16:16             ` Rob Herring
2021-08-26  2:27               ` Matt Johnston [this message]

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=e1e761e10df0beac3786edef1aa8f2e84ccad8fd.camel@codeconstruct.com.au \
    --to=matt@codeconstruct.com.au \
    --cc=devicetree@vger.kernel.org \
    --cc=jk@codeconstruct.com.au \
    --cc=robh@kernel.org \
    --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).