[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4600d755-3bbf-4906-9f23-4e91cfc01c12@lunn.ch>
Date: Fri, 21 Apr 2023 14:15:43 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jiawen Wu <jiawenwu@...stnetic.com>
Cc: netdev@...r.kernel.org, linux@...linux.org.uk,
linux-i2c@...r.kernel.org, linux-gpio@...r.kernel.org,
olteanv@...il.com, mengyuanlou@...-swift.com,
'Jarkko Nikula' <jarkko.nikula@...ux.intel.com>
Subject: Re: [PATCH net-next v3 2/8] i2c: designware: Add driver support for
Wangxun 10Gb NIC
On Fri, Apr 21, 2023 at 10:20:17AM +0800, Jiawen Wu wrote:
> On Thursday, April 20, 2023 9:23 PM, Andrew Lunn wrote:
> > On Thu, Apr 20, 2023 at 06:29:11PM +0800, Jiawen Wu wrote:
> > > On Thursday, April 20, 2023 4:58 AM, Andrew Lunn wrote:
> > > > On Wed, Apr 19, 2023 at 04:27:33PM +0800, Jiawen Wu wrote:
> > > > > Wangxun 10Gb ethernet chip is connected to Designware I2C, to communicate
> > > > > with SFP.
> > > > >
> > > > > Add platform data to pass IOMEM base address, board flag and other
> > > > > parameters, since resource address was mapped on ethernet driver.
> > > > >
> > > > > The exists IP limitations are dealt as workarounds:
> > > > > - IP does not support interrupt mode, it works on polling mode.
> > > > > - I2C cannot read continuously, only one byte can at a time.
> > > >
> > > > Are you really sure about that?
> > > >
> > > > It is a major limitation for SFP devices. It means you cannot access
> > > > the diagnostics, since you need to perform an atomic 2 byte read.
> > > >
> > > > Or maybe i'm understanding you wrong.
> > > >
> > > > Andrew
> > > >
> > >
> > > Maybe I'm a little confused about this. Every time I read a byte info, I have to
> > > write a 'read command'. It can normally get the information for SFP devices.
> > > But I'm not sure if this is regular I2C behavior.
> >
> > I don't know this hardware, so i cannot say what a 'read command'
> > actually does. Can you put a bus pirate or similar sort of device on
> > the bus and look at the actual I2C signals. Is it performing one I2C
> > transaction per byte? If so, that is not good.
....
> You may have misunderstood. If you want to read a 16-bit message, the
> size of 'i2c_msg.len' is set to 2 in the array that 'flags = I2C_M_RD'.
The SFP driver uses a mixture of message lengths, due to SFP bugs. But
in general it will do 16 byte block reads, except for when it needs
smaller quantity of bytes.
However, your wording was:
> > > Every time I read a byte info, I have to write a 'read command'.
This suggests you are reading one byte at a time with each read
command. I just want to make sure that is not one I2C transaction per
byte.
Andrew.
Powered by blists - more mailing lists