linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Jiawen Wu <jiawenwu@trustnetic.com>,
	netdev@vger.kernel.org, linux@armlinux.org.uk,
	linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org,
	olteanv@gmail.com, mengyuanlou@net-swift.com
Subject: Re: [PATCH net-next v3 2/8] i2c: designware: Add driver support for Wangxun 10Gb NIC
Date: Fri, 21 Apr 2023 16:00:43 +0300	[thread overview]
Message-ID: <f1b0995e-a452-84bc-1a5c-d4e31cef0b07@linux.intel.com> (raw)
In-Reply-To: <da4a9993-1445-43a9-a0ef-b3414f492962@lunn.ch>

On 4/21/23 15:22, Andrew Lunn wrote:
> On Fri, Apr 21, 2023 at 09:52:02AM +0300, Jarkko Nikula wrote:
>> I agree, IC_DATA_CMD operation is obscure. In order to read from the bus,
>> writes with BIT(8) set is required into IC_DATA_CMD, wait (irq/poll)
>> DW_IC_INTR_RX_FULL is set in DW_IC_RAW_INTR_STAT and then read back received
>> data from IC_DATA_CMD while taking into count FIFO sizes.
> 
> Just for my understanding, this read command just allows access to the
> data in the FIFO. It has nothing to do with I2C bus transactions.
> 
Not only but it controls both the bus transactions and data to/from FIFO.

> You also mention FIFO depth. So you should not need to do this per
> byte, you can read upto the full depth of the FIFO before having to do
> the read command, poll/irq cycle again?
> 
Commands need to be written to IC_DATA_CMD for each byte and no more 
than is the FIFO depth. Like writing n read commands to it, wait for 
RX_FULL and read as many bytes as available, continue waiting if not done.

It perhaps best explained by looking at 
drivers/i2c/busses/i2c-designware-master.c: i2c_dw_xfer_msg() and 
i2c_dw_read().

  reply	other threads:[~2023-04-21 13:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  8:27 [PATCH net-next v3 0/8] TXGBE PHYLINK support Jiawen Wu
2023-04-19  8:27 ` [PATCH net-next v3 1/8] net: txgbe: Add software nodes to support phylink Jiawen Wu
2023-04-19 20:53   ` Andrew Lunn
2023-04-19  8:27 ` [PATCH net-next v3 2/8] i2c: designware: Add driver support for Wangxun 10Gb NIC Jiawen Wu
2023-04-19 14:36   ` Jarkko Nikula
2023-04-20 10:49     ` Jiawen Wu
2023-04-19 20:58   ` Andrew Lunn
2023-04-20 10:29     ` Jiawen Wu
2023-04-20 13:22       ` Andrew Lunn
2023-04-21  2:20         ` Jiawen Wu
2023-04-21 12:15           ` Andrew Lunn
2023-04-21  6:52       ` Jarkko Nikula
2023-04-21 12:22         ` Andrew Lunn
2023-04-21 13:00           ` Jarkko Nikula [this message]
2023-04-19  8:27 ` [PATCH net-next v3 3/8] net: txgbe: Register I2C platform device Jiawen Wu
2023-04-19  8:27 ` [PATCH net-next v3 4/8] net: txgbe: Add SFP module identify Jiawen Wu
2023-04-19 13:55   ` Vladimir Oltean
2023-04-19  8:27 ` [PATCH net-next v3 5/8] net: txgbe: Support GPIO to SFP socket Jiawen Wu
2023-04-19  8:27 ` [PATCH net-next v3 6/8] net: pcs: Add 10GBASE-R mode for Synopsys Designware XPCS Jiawen Wu
2023-04-19 13:19   ` Vladimir Oltean
2023-04-20  1:56     ` Jiawen Wu
2023-04-20  8:03       ` Vladimir Oltean
2023-04-20  8:38         ` Jiawen Wu
2023-04-20  8:52           ` Vladimir Oltean
2023-04-20  9:32             ` Jiawen Wu
2023-04-19  8:27 ` [PATCH net-next v3 7/8] net: txgbe: Implement phylink pcs Jiawen Wu
2023-04-19  8:27 ` [PATCH net-next v3 8/8] net: txgbe: Support phylink MAC layer Jiawen Wu
2023-04-19 13:39 ` [PATCH net-next v3 0/8] TXGBE PHYLINK support Vladimir Oltean

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=f1b0995e-a452-84bc-1a5c-d4e31cef0b07@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=andrew@lunn.ch \
    --cc=jiawenwu@trustnetic.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.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).