Re: [RFC PATCH v2 0/2] MCTP I2C devicetree binding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2021-08-23 at 11:16 -0500, Rob Herring wrote:
> On Mon, Aug 23, 2021 at 2:52 AM Jeremy Kerr <jk@xxxxxxxxxxxxxxxxxxxx>
> 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





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux