From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>,
James Hogan <jhogan@kernel.org>,
Paul Burton <paul.burton@mips.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Allan Nielsen <allan.nielsen@microsemi.com>,
Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH 3/5] i2c: designware: add MSCC Ocelot support
Date: Tue, 17 Jul 2018 14:40:53 +0200 [thread overview]
Message-ID: <20180717124053.GB23935@piout.net> (raw)
In-Reply-To: <d64fc362be63bb8540447f7df2c232eedd696edb.camel@linux.intel.com>
On 17/07/2018 15:19:08+0300, Andy Shevchenko wrote:
> On Tue, 2018-07-17 at 13:48 +0200, Alexandre Belloni wrote:
> > The Microsemi Ocelot I2C controller is a designware IP. It also has a
> > second set of registers to allow tweaking SDA hold time and spike
> > filtering.
>
> Can you elaborate a bit?
>
> Are they platform specific? Are they shadow registers? Are they
> something else? Datasheet link / excerpt would be also good to read.
>
> > Optional properties :
> > + - reg : for "mscc,ocelot-i2c", a second register set to configure
> > the SDA hold
> > + time, named ICPU_CFG:TWI_DELAY in the datasheet.
> > +
>
> Hmm... Is this registers unique to the SoC in question? Is address of
> them fixed or may be configured on RTL level?
>
> If former is right, why do we need a separate property?
>
Those are registers from the SoC, their position varies depending on
the SoC.
Even if the position was fixed, I'm pretty sure another register set is
needed. It is not a new property.
> >
> > +#define MSCC_ICPU_CFG_TWI_DELAY 0x0
> > +#define MSCC_ICPU_CFG_TWI_DELAY_ENABLE BIT(0)
> > +#define MSCC_ICPU_CFG_TWI_SPIKE_FILTER 0x4
> > +
> > +static int mscc_twi_set_sda_hold_time(struct dw_i2c_dev *dev)
> > +{
> > + writel((dev->sda_hold_time << 1) |
> > MSCC_ICPU_CFG_TWI_DELAY_ENABLE,
> > + dev->base_ext + MSCC_ICPU_CFG_TWI_DELAY);
> > +
> > + return 0;
> > +}
>
> Hmm... And does how this make native DesignWare IP's registers obsolete?
>
DW_IC_SDA_HOLD doesn't exist in this version of the IP. It is replaced
by this SoC specific register.
>
> > + if (of_device_is_compatible(pdev->dev.of_node, "mscc,ocelot-
> > i2c"))
>
> Can't you just ask for this unconditionally? Why not?
> (It seems I might have known why not, but can we use named resource
> instead in case this is not so SoC specific)
>
It is SoC specific.
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-07-17 12:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-17 11:48 [PATCH 0/5] Add support for MSCC Ocelot i2c Alexandre Belloni
2018-07-17 11:48 ` [PATCH 1/5] i2c: designware: factorize setting SDA hold time Alexandre Belloni
2018-07-17 12:11 ` Andy Shevchenko
2018-07-17 12:31 ` Alexandre Belloni
2018-07-17 11:48 ` [PATCH 2/5] i2c: designware: allow IP specific sda_hold_time Alexandre Belloni
2018-07-17 14:33 ` Andy Shevchenko
2018-07-17 11:48 ` [PATCH 3/5] i2c: designware: add MSCC Ocelot support Alexandre Belloni
2018-07-17 12:19 ` Andy Shevchenko
2018-07-17 12:40 ` Alexandre Belloni [this message]
2018-07-17 15:16 ` Andy Shevchenko
2018-07-17 15:26 ` Andy Shevchenko
2018-07-20 17:56 ` Rob Herring
2018-07-17 11:48 ` [PATCH 4/5] mips: dts: mscc: Add i2c on ocelot Alexandre Belloni
2018-07-17 11:48 ` [PATCH 5/5] mips: dts: mscc: enable i2c on ocelot_pcb123 Alexandre Belloni
2018-07-17 12:21 ` [PATCH 0/5] Add support for MSCC Ocelot i2c Andy Shevchenko
2018-07-17 12:46 ` Alexandre Belloni
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=20180717124053.GB23935@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=allan.nielsen@microsemi.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=jarkko.nikula@linux.intel.com \
--cc=jhogan@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=mika.westerberg@linux.intel.com \
--cc=paul.burton@mips.com \
--cc=robh+dt@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=wsa@the-dreams.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.