devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Chuanhua Han <chuanhua.han@nxp.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Sumit Batra <sumit.batra@nxp.com>, "eha@deif.com" <eha@deif.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Leo Li <leoyang.li@nxp.com>,
	"wsa+renesas@sang-engineering.com"
	<wsa+renesas@sang-engineering.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"u.kleine-koenig@pengutronix.de" <u.kleine-koenig@pengutronix.de>,
	"linux@rempel-privat.de" <linux@rempel-privat.de>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"peda@axentia.se" <peda@axentia.se>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [EXT] Re: [PATCH 1/2] i2c: imx: I2C Driver doesn't consider I2C_IPGCLK_SEL RCW bit when using ls1046a SoC
Date: Mon, 6 May 2019 09:37:35 +0200	[thread overview]
Message-ID: <20190506073735.ctzybytamu44pbvv@pengutronix.de> (raw)
In-Reply-To: <AM6PR04MB43571B8D52C1FE9ED20DBA1D97360@AM6PR04MB4357.eurprd04.prod.outlook.com>

On Sat, May 04, 2019 at 09:28:48AM +0000, Chuanhua Han wrote:
> 
> 
> > -----Original Message-----
> > From: Sascha Hauer <s.hauer@pengutronix.de>
> > Sent: 2019年4月30日 20:51
> > To: Chuanhua Han <chuanhua.han@nxp.com>
> > Cc: shawnguo@kernel.org; Leo Li <leoyang.li@nxp.com>; robh+dt@kernel.org;
> > mark.rutland@arm.com; linux-kernel@vger.kernel.org;
> > linux-i2c@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> > devicetree@vger.kernel.org; festevam@gmail.com; dl-linux-imx
> > <linux-imx@nxp.com>; wsa+renesas@sang-engineering.com;
> > u.kleine-koenig@pengutronix.de; eha@deif.com; linux@rempel-privat.de;
> > l.stach@pengutronix.de; peda@axentia.se; Sumit Batra
> > <sumit.batra@nxp.com>
> > Subject: [EXT] Re: [PATCH 1/2] i2c: imx: I2C Driver doesn't consider
> > I2C_IPGCLK_SEL RCW bit when using ls1046a SoC
> > 
> > Caution: EXT Email
> > 
> > On Tue, Apr 30, 2019 at 12:47:18PM +0800, Chuanhua Han wrote:
> > > The current kernel driver does not consider I2C_IPGCLK_SEL (424 bit of
> > > RCW) in deciding  i2c_clk_rate in function i2c_imx_set_clk() { 0
> > > Platform clock/4, 1 Platform clock/2}.
> > >
> > > When using ls1046a SoC, this populates incorrect value in IBFD
> > > register if I2C_IPGCLK_SEL = 0, which generates half of the desired Clock.
> > >
> > > Therefore, if ls1046a SoC is used, we need to set the i2c clock
> > > according to the corresponding RCW.
> > 
> > So the clock driver reports the wrong clock. Please fix the clock driver then.
> No, this is a problem with the i2c driver. It is not a problem with
> the clock driver, so the i2c driver needs to be modified.

So how does this RCW bit get evaluated? According to the reference
manual only one clock goes to the i2c module (described as 1/2 Platform
Clock) and the i2c module only takes one clock. So it seems there must
be a /2 divider somewhere, either in each i2c module or somewhere
outside. Can your IC guys tell you where it is?

One reason I suggested the clock driver is that the clock driver
contains SoC specific code already, so it should be easier to integrate
there.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-05-06  7:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30  4:47 [PATCH 1/2] i2c: imx: I2C Driver doesn't consider I2C_IPGCLK_SEL RCW bit when using ls1046a SoC Chuanhua Han
2019-04-30  4:47 ` [PATCH 2/2] arm64: dts: fsl: ls1046a: Add the guts node in dts Chuanhua Han
2019-05-06  7:41   ` Sascha Hauer
2019-05-06  7:44     ` [EXT] " Chuanhua Han
2019-05-08 11:38     ` Chuanhua Han
2019-04-30 12:50 ` [PATCH 1/2] i2c: imx: I2C Driver doesn't consider I2C_IPGCLK_SEL RCW bit when using ls1046a SoC Sascha Hauer
2019-05-04  9:28   ` [EXT] " Chuanhua Han
2019-05-06  7:37     ` Sascha Hauer [this message]
2019-05-06  7:46       ` Chuanhua Han
2019-05-08 11:34       ` Chuanhua Han
2019-05-09  4:35         ` Sumit Batra
2019-05-09  5:10           ` Sumit Batra
2019-05-09  7:48           ` Sascha Hauer
2019-05-09  7:55             ` Wolfram Sang
2019-05-06  7:47 ` Sascha Hauer
2019-05-06  7:53   ` [EXT] " Chuanhua Han
2019-05-08 11:42   ` Chuanhua Han

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=20190506073735.ctzybytamu44pbvv@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=chuanhua.han@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eha@deif.com \
    --cc=festevam@gmail.com \
    --cc=l.stach@pengutronix.de \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=mark.rutland@arm.com \
    --cc=peda@axentia.se \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=sumit.batra@nxp.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wsa+renesas@sang-engineering.com \
    /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).