From: Nicolas Pitre <nico@fluxnic.net>
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org, Robert Gough <robert.gough@intel.com>,
Laura Nixon <laura.nixon@team.mipi.org>,
Boris Brezillon <boris.brezillon@collabora.com>,
Matthew Schnoor <matthew.schnoor@intel.com>,
linux-i3c@lists.infradead.org
Subject: Re: [PATCH v2 1/2] dt-bindings: i3c: MIPI I3C Host Controller Interface
Date: Tue, 25 Aug 2020 20:40:29 -0400 (EDT) [thread overview]
Message-ID: <nycvar.YSQ.7.78.906.2008252015280.1479@knanqh.ubzr> (raw)
In-Reply-To: <CAL_JsqKJByNNwgP34_=G3bdVaZiM1OCUY94N1pTRzgNvqHjcWw@mail.gmail.com>
On Tue, 25 Aug 2020, Rob Herring wrote:
> On Tue, Aug 25, 2020 at 4:02 PM Nicolas Pitre <nico@fluxnic.net> wrote:
>
> > Currently there are very few implementations. One of them lives in an
> > FPGA and the example below is actually the DT entry I use for it. I'm
> > guessing specific vendor implementations will have their own tweaks
> > eventually, such as clock sources and whatnot.
>
> Yes, exactly. And bugs too.
Obviously. ;-)
> > But that is outside of
> > the spec (actually the spec defines a register area for eventual vendor
> > specific usage). But I have no visibility into that and of course the
> > code has no provision for that yet either.
> >
> > So I imagine there will be something like this in dts files eventually:
> >
> > compatibvle = "intel,foobar_soc_i3c_hci", "mipi-i3c-hci";
> >
> > Is that what you mean?
>
> Yes. Even your FPGA is tied to some implementation...
It is, but so far it's self-discoverable.
> > > Also, which version of the spec does this compatible correspond to?
> >
> > All of them.
> >
> > > Or are there not HCI differences in the spec versions you mention in
> > > the cover letter?
> >
> > The hardware is self advertising per the spec. So there is no need to
> > carry such distinction in the DT compatible. Even vendor extensions are
> > tagged with MIPI vendor IDs in the hardware directly.
>
> Oh good, folks are learning. :)
>
> Is the vendor ID (and revision) discoverable even if no vendor
> extensions?
Yes. It's even in the very first 32-bit word from the register space.
Here's the relevant code:
#define HCI_VERSION 0x00 /* HCI Version (in BCD) */
[...]
/* Validate HCI hardware version */
regval = reg_read(HCI_VERSION);
hci->version_major = (regval >> 8) & 0xf;
hci->version_minor = (regval >> 4) & 0xf;
hci->revision = regval & 0xf;
NOTE("HCI v%u.%u r%02u",
hci->version_major, hci->version_minor, hci->revision);
/* known versions */
switch (regval & ~0xf) {
case 0x100: /* version 1.0 */
case 0x110: /* version 1.1 */
case 0x200: /* version 2.0 */
break;
default:
ERR("unsupported HCI version");
return -EPROTONOSUPPORT;
}
Then there is a register that provides the relative offset to another
register area where "extended attributes" are to be found. Those
attributes are also spec defined. One of the standard attributes
contains the MIPI vendor ID, the vendor version ID and vendor product
ID. And then there is a range of attributes which are vendor defined.
That's where specific stuff like fancy clock controls would be located
and vendor specific tweaks to be applied. But so far
everything can be predicated on hardware-provided data.
> If so, then I'm more comfortable with "mipi-i3c-hci" on it's own. The
> exception will be if there's setup needed to discover the h/w which
> seems likely. In that case, we should probably do compatible strings
> based on VID/PID like PCI, USB, etc. No need to define that now I
> guess, but please add some sort of summary of the above about the
> discoverability of the HCI implementer and features.
OK.
Nicolas
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next prev parent reply other threads:[~2020-08-26 0:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 3:17 [PATCH v2 1/2] MIPI I3c HCI (Host Controller Interface) driver Nicolas Pitre
2020-08-19 3:17 ` [PATCH v2 1/2] dt-bindings: i3c: MIPI I3C Host Controller Interface Nicolas Pitre
2020-08-25 21:29 ` Rob Herring
2020-08-25 22:02 ` Nicolas Pitre
2020-08-25 23:06 ` Rob Herring
2020-08-26 0:40 ` Nicolas Pitre [this message]
2020-08-19 3:17 ` [PATCH v2 2/2] i3c/master: add the mipi-i3c-hci driver Nicolas Pitre
2020-10-01 12:31 ` Sakari Ailus
2020-10-05 22:15 ` Nicolas Pitre
2020-10-07 10:17 ` Sakari Ailus
2020-10-07 16:30 ` Nicolas Pitre
2020-10-09 12:01 ` Sakari Ailus
2020-08-19 3:21 ` [PATCH v2 1/2] MIPI I3c HCI (Host Controller Interface) driver Nicolas Pitre
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=nycvar.YSQ.7.78.906.2008252015280.1479@knanqh.ubzr \
--to=nico@fluxnic.net \
--cc=boris.brezillon@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=laura.nixon@team.mipi.org \
--cc=linux-i3c@lists.infradead.org \
--cc=matthew.schnoor@intel.com \
--cc=robert.gough@intel.com \
--cc=robh@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).