From: Wolfram Sang <wsa@the-dreams.de>
To: linux-sh@vger.kernel.org
Subject: Re: [RFC 0/4] prototype: switch I2C IP cores at runtime
Date: Sat, 14 Mar 2015 11:43:36 +0000 [thread overview]
Message-ID: <20150314114336.GF970@katana> (raw)
In-Reply-To: <1418674817-12809-1-git-send-email-wsa@the-dreams.de>
[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]
Hi Geert,
finally going back to this topic.
> I'm mostly approaching this from the DT point of view, as DT describes the
> hardware, so the description should reflect the actual hardware topology as
> closely as possible.
>
> Currently DT describes (let's keep using i2c as an example):
> - one ore more i2c masters (in .dtsi),
> - an i2c bus (in .dts), which is a child of one particular i2c master node,
> - pinctrl (in .dts) to link the i2c bus to one particular i2c master.
>
> Obviously this does not match the hardware, as
> (1) pinctrl is dynamic, and
> (2) the i2c bus is not hard-tied to that specific i2c master instance.
>
> What does describe the hardware is:
> - one or more i2c masters (in .dtsi),
> - pinctrl for the i2c masters (tables/code under drivers/pinctrl/),
> - an i2c bus (in .dts), defined by actual pin connections,
> - pinctrl (in .dts) to link the pin connections used by the i2c bus to one
> default i2c master (is this needed?).
> With the above description, switching can be controlled from pinctrl,
> triggered by the user or by availability of drivers and/or QoS.
If I understood correctly, we currently can't describe this in DT this
way. If we wanted to connect a bus to pins, we need to tie it to the pin
names like "GP5_5" for SCL and "GP5_6" to SDA. We don't have those, we
only have the function groups like "iic2" or "i2c2". And even if we had
those, we would need a reverse mapping to check if "GP5_5" can be
configured to this or that I2C core. Or?
> Your "i2c-demux" in DT is actually a description of an i2c bus.
> But instead of linking it to pins, it contains a list of all i2c masters.
Yes, one layer of indirection. The list is (currently) only used to get
the desired pin mapping.
> If I want to add an i2c-gpio master, I'll have to add it to DT. That sounds
> insignificant, but (in theory) all I/O masters could be implemented using GPIO.
> So one day someone may implement an xxx-gpio driver for whatever bus,
> and I think it should be supported out-of-the-box. When using pins, and thus
> describing the i2c bus in a pin-centric way, that will just work.
If my assumption about the reverse mapping above holds true, I don't
think this is worth the hazzle?
Thanks for your feedback!
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-03-14 11:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 20:20 [RFC 0/4] prototype: switch I2C IP cores at runtime Wolfram Sang
2015-01-05 14:28 ` Geert Uytterhoeven
2015-03-14 11:43 ` Wolfram Sang [this message]
2015-03-14 14:37 ` Laurent Pinchart
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=20150314114336.GF970@katana \
--to=wsa@the-dreams.de \
--cc=linux-sh@vger.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