All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Danin <danindrey@mail.ru>
To: Wolfram Sang <wsa@the-dreams.de>, Stephen Warren <swarren@wwwdotorg.org>
Cc: devicetree@vger.kernel.org, devel@linuxdriverproject.org,
	linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	ac100@lists.launchpad.net, Laxman Dewangan <ldewangan@nvidia.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Russell King <linux@arm.linux.org.uk>,
	Thierry Reding <thierry.reding@gmail.com>,
	Alexandre Courbot <gnurou@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Julian Andres Klode <jak@jak-linux.org>,
	Marc Dietrich <marvin24@gmx.de>
Subject: Re: [PATCH v3 1/4] i2c: tegra: implement slave mode
Date: Fri, 24 Jul 2015 13:18:28 +0300	[thread overview]
Message-ID: <55B210F4.6030700@mail.ru> (raw)
In-Reply-To: <20150724092720.GA1597@katana>

On 24.07.2015 12:27, Wolfram Sang wrote:
> Still doesn't work for me and I think I understand why. Do you run your
> I2C controller in slave mode only?

Yes.

> That might work, but using it in
> master/slave mode simultanously won't work yet as I see it:
>
> * After every transfer (as master), clocks get disabled. I assume the IP
>    core won't be able to detect its own address then.

At the begin of my work on this patchset I even denied clock disable 
call if slave is registered (to minimize code that can affect transfer). 
If only slave mode is used, then this logic is not needed.

>
> * There is this code in tegra_i2c_init():
>
> 	if (!i2c_dev->is_dvc) {
> 		u32 sl_cfg = i2c_readl(i2c_dev, I2C_SL_CNFG);
> 		sl_cfg |= I2C_SL_CNFG_NACK | I2C_SL_CNFG_NEWSL;
> 		i2c_writel(i2c_dev, sl_cfg, I2C_SL_CNFG);
> 		i2c_writel(i2c_dev, 0xfc, I2C_SL_ADDR1);
> 		i2c_writel(i2c_dev, 0x00, I2C_SL_ADDR2);
>
> 	}
>
>    It probably messes up the slave initialization in tegra_reg_slave().
>    At least I see that the slave address gets overwritten when I peek
>    the register after boot.
>

tegra_i2c_init is called on probe and resume. Also it is called in case 
of xfer fail. If xfer is ok, then I think slave addr must be kept unchanged.

> Does that make sense to you?

As far as I understand it is a loopback mode. Probably it will not work 
(Stephen Warren already mentioned this).
But we can try to run it.

WARNING: multiple messages have this Message-ID (diff)
From: danindrey@mail.ru (Andrey Danin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/4] i2c: tegra: implement slave mode
Date: Fri, 24 Jul 2015 13:18:28 +0300	[thread overview]
Message-ID: <55B210F4.6030700@mail.ru> (raw)
In-Reply-To: <20150724092720.GA1597@katana>

On 24.07.2015 12:27, Wolfram Sang wrote:
> Still doesn't work for me and I think I understand why. Do you run your
> I2C controller in slave mode only?

Yes.

> That might work, but using it in
> master/slave mode simultanously won't work yet as I see it:
>
> * After every transfer (as master), clocks get disabled. I assume the IP
>    core won't be able to detect its own address then.

At the begin of my work on this patchset I even denied clock disable 
call if slave is registered (to minimize code that can affect transfer). 
If only slave mode is used, then this logic is not needed.

>
> * There is this code in tegra_i2c_init():
>
> 	if (!i2c_dev->is_dvc) {
> 		u32 sl_cfg = i2c_readl(i2c_dev, I2C_SL_CNFG);
> 		sl_cfg |= I2C_SL_CNFG_NACK | I2C_SL_CNFG_NEWSL;
> 		i2c_writel(i2c_dev, sl_cfg, I2C_SL_CNFG);
> 		i2c_writel(i2c_dev, 0xfc, I2C_SL_ADDR1);
> 		i2c_writel(i2c_dev, 0x00, I2C_SL_ADDR2);
>
> 	}
>
>    It probably messes up the slave initialization in tegra_reg_slave().
>    At least I see that the slave address gets overwritten when I peek
>    the register after boot.
>

tegra_i2c_init is called on probe and resume. Also it is called in case 
of xfer fail. If xfer is ok, then I think slave addr must be kept unchanged.

> Does that make sense to you?

As far as I understand it is a loopback mode. Probably it will not work 
(Stephen Warren already mentioned this).
But we can try to run it.

  reply	other threads:[~2015-07-24 10:18 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 20:35 [PATCH v3 0/4] arm: tegra: implement NVEC driver using tegra i2c Andrey Danin
2015-07-20 20:35 ` Andrey Danin
2015-07-20 20:35 ` Andrey Danin
     [not found] ` <1437424546-30405-1-git-send-email-danindrey-JGs/UdohzUI@public.gmane.org>
2015-07-20 20:35   ` [PATCH v3 1/4] i2c: tegra: implement slave mode Andrey Danin
2015-07-20 20:35     ` Andrey Danin
2015-07-20 20:35     ` Andrey Danin
2015-07-24  9:27     ` Wolfram Sang
2015-07-24  9:27       ` Wolfram Sang
2015-07-24 10:18       ` Andrey Danin [this message]
2015-07-24 10:18         ` Andrey Danin
     [not found]         ` <55B210F4.6030700-JGs/UdohzUI@public.gmane.org>
2015-07-24 10:52           ` Wolfram Sang
2015-07-24 10:52             ` Wolfram Sang
2015-07-24 10:52             ` Wolfram Sang
2015-08-20 12:14             ` Andrey Danin
2015-08-20 12:14               ` Andrey Danin
2015-08-20 12:14               ` Andrey Danin
2015-08-20 12:14               ` Andrey Danin
     [not found]               ` <55D5C4AA.2000307-JGs/UdohzUI@public.gmane.org>
2015-09-08 11:46                 ` Wolfram Sang
2015-09-08 11:46                   ` Wolfram Sang
2015-09-08 11:46                   ` Wolfram Sang
2015-09-08 12:31                   ` Andrey Danin
2015-09-08 12:31                     ` Andrey Danin
2015-09-08 12:31                     ` Andrey Danin
2015-07-20 20:35   ` [PATCH v3 2/4] staging/nvec: reimplement on top of tegra i2c driver Andrey Danin
2015-07-20 20:35     ` Andrey Danin
2015-07-20 20:35     ` Andrey Danin
     [not found]     ` <1437424546-30405-3-git-send-email-danindrey-JGs/UdohzUI@public.gmane.org>
2015-07-20 22:18       ` Stephen Warren
2015-07-20 22:18         ` Stephen Warren
2015-07-20 22:18         ` Stephen Warren
2015-07-20 20:35   ` [PATCH v3 3/4] staging/nvec: remove old code Andrey Danin
2015-07-20 20:35     ` Andrey Danin
2015-07-20 20:35     ` Andrey Danin
2015-07-20 20:35   ` [PATCH v3 4/4] dt: paz00: define nvec as child of i2c bus Andrey Danin
2015-07-20 20:35     ` Andrey Danin
2015-07-20 20:35     ` Andrey Danin
2015-07-20 22:19     ` Stephen Warren
2015-07-20 22:19       ` Stephen Warren
     [not found]       ` <55AD73F4.2050502-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-07-21  6:35         ` Andrey Danin
2015-07-21  6:35           ` Andrey Danin
2015-07-21  6:35           ` Andrey Danin
2015-07-21  8:25           ` Marc Dietrich
2015-07-21  8:25             ` Marc Dietrich
2015-07-21  8:25             ` Marc Dietrich
2015-07-21  8:51             ` Andrey Danin
2015-07-21  8:51               ` Andrey Danin
2015-07-21  8:51               ` Andrey Danin
     [not found]               ` <55AE0803.10603-JGs/UdohzUI@public.gmane.org>
2015-07-21 11:57                 ` Marc Dietrich
2015-07-21 11:57                   ` Marc Dietrich
2015-07-21 11:57                   ` Marc Dietrich
2015-07-21 20:52                   ` Wolfram Sang
2015-07-21 20:52                     ` Wolfram Sang
2015-07-21 20:52                     ` Wolfram Sang
2015-07-21  8:38   ` [PATCH v3 0/4] arm: tegra: implement NVEC driver using tegra i2c Andrey Danin
2015-07-21  8:38     ` Andrey Danin
2015-07-21  8:38     ` Andrey Danin

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=55B210F4.6030700@mail.ru \
    --to=danindrey@mail.ru \
    --cc=ac100@lists.launchpad.net \
    --cc=devel@linuxdriverproject.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gnurou@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jak@jak-linux.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=marvin24@gmx.de \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.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.