From: Wolfram Sang <wsa@the-dreams.de>
To: Michal Simek <monstr@monstr.eu>
Cc: "Michal Simek" <michal.simek@xilinx.com>,
linux-kernel@vger.kernel.org,
"Kedareswara rao Appana" <appana.durga.rao@xilinx.com>,
"Kedareswara rao Appana" <appanad@xilinx.com>,
"Jean Delvare" <khali@linux-fr.org>,
"Peter Korsgaard" <jacmet@sunsite.dk>,
linux-i2c@vger.kernel.org,
"Richard Röjfors" <richard.rojfors@pelagicore.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Steven A. Falco" <sfalco@harris.com>
Subject: Re: [PATCH v2 2/3] i2c: xilinx: Set tx direction in write operation
Date: Fri, 4 Oct 2013 13:55:17 +0200 [thread overview]
Message-ID: <20131004115517.GA2994@katana> (raw)
In-Reply-To: <524E902D.8030809@monstr.eu>
[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]
On Fri, Oct 04, 2013 at 11:53:49AM +0200, Michal Simek wrote:
> On 10/04/2013 07:46 AM, Wolfram Sang wrote:
> >
> >> + cr = xiic_getreg32(i2c, XIIC_CR_REG_OFFSET);
> >> + cr |= XIIC_CR_DIR_IS_TX_MASK;
> >> + xiic_setreg32(i2c, XIIC_CR_REG_OFFSET, cr);
> >> +
> >
> > Is there no need to clear the bit again when receiving?
>
> This bit is cleared in xiic_xfer() -> xiic_start_xfer() ->xiic_reinit()
>
> xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, XIIC_CR_TX_FIFO_RESET_MASK);
A bit implicit, but OK.
> > And did
> > transferring ever work if this bit was never set before?
>
> I really don't know. We have switched from old driver to this new mainline one
> and based on our eeprom testing we have found that this bit hasn't been setup properly.
>
> It is described here.
> http://www.xilinx.com/support/documentation/ip_documentation/axi_iic/v1_02_a/axi_iic_ds756.pdf
> page 28 - step 3.
>
> IIC Master Transmitter with a Repeated Start
> 1. Write the IIC device address to the TX_FIFO.
> 2. Write data to TX_FIFO.
> 3. Write to Control Register (CR) to set MSMS = 1 and TX = 1.
> 4. Continue writing data to TX_FIFO.
> 5. Wait for transmit FIFO empty interrupt. This implies the IIC has throttled the bus.
> 6. Write to CR to set RSTA = 1.
Repeated start is not happening in the driver as well, or am I
overlooking something?
> 7. Write IIC device address to TX_FIFO.
> 8. Write all data except last byte to TX_FIFO.
> 9. Wait for transmit FIFO empty interrupt. This implies the IIC has throttled the bus.
> 10. Write to CR to set MSMS = 0. The IIC generates a stop condition at the end of the last byte.
> 11. Write last byte of data to TX_FIFO.
CCing more people who worked on the driver in the past and might have
experiences
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-10-04 11:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-30 14:15 [PATCH v2 1/3] i2c: xilinx: Fix i2c checkpatch warnings Michal Simek
2013-09-30 14:15 ` [PATCH v2 2/3] i2c: xilinx: Set tx direction in write operation Michal Simek
2013-10-04 5:46 ` Wolfram Sang
2013-10-04 9:53 ` Michal Simek
2013-10-04 11:55 ` Wolfram Sang [this message]
2013-10-04 12:12 ` Lars-Peter Clausen
2013-10-04 13:09 ` Michal Simek
2013-10-04 13:38 ` Lars-Peter Clausen
2013-10-04 13:38 ` Michal Simek
2013-10-07 9:19 ` Appana Durga Kedareswara Rao
2013-09-30 14:15 ` [PATCH v2 3/3] i2c: xilinx: Use devm_* functions Michal Simek
2013-10-04 5:33 ` Wolfram Sang
2013-10-04 9:16 ` Michal Simek
2013-10-04 11:58 ` Wolfram Sang
2013-10-04 12:04 ` Michal Simek
2013-10-05 5:59 ` Wolfram Sang
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=20131004115517.GA2994@katana \
--to=wsa@the-dreams.de \
--cc=appana.durga.rao@xilinx.com \
--cc=appanad@xilinx.com \
--cc=jacmet@sunsite.dk \
--cc=khali@linux-fr.org \
--cc=lars@metafoo.de \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=monstr@monstr.eu \
--cc=richard.rojfors@pelagicore.com \
--cc=sfalco@harris.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).