public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Krzysztof Halasa <khc@pm.waw.pl>
Cc: LM Sensors <lm-sensors@lm-sensors.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: I2C block reads with i2c-viapro: testers wanted
Date: Thu, 11 Aug 2005 21:59:29 +0200	[thread overview]
Message-ID: <20050811215929.1df5fab0.khali@linux-fr.org> (raw)
In-Reply-To: <m3fytgnv73.fsf@defiant.localdomain>

Hi Krzysztof,

> Forgive my ignorance, but does it depend on the south bridge at all?
> Isn't the block read capability just a function of EEPROM chip on
> (I assume) RAM module?

EEPROMs can be read using three different access modes: data byte reads
(each transaction asks for one byte at a given offset), continuous byte
reads (first transaction sets offset to 0, each subsequent transaction
reads one byte and the offset auto-increments), and I2C block reads (one
single transaction sets the initial offset and reads the whole block
[1]).

Now, just because most EEPROMs support these three modes doesn't mean
you can always use them. It depends on which bus the EEPROM is sitting
on, and which driver is used to control that bus.

If the bus is a true I2C bus, most of which are known as bit-banging and
are driven by the i2c-algo-bit driver, then all three types of accesses
will work, and we'll use I2C block reads because it's faster. However,
EEPROMs are also often found on SMBus busses, those controller only
implement a subset of all possible I2C commands. Where this subset
includes I2C block reads, we can implement it in the driver and use it.
This is exactly what I am doing with i2c-viapro right now.

More generally, for an I2C/SMBus command to be usable, both the target
chip and the bus controller must support it, and the bus controller
driver must implement it.

I hope it's clearer now :)

[1] Due to an internal limitation in the Linux kernel, the maximum block
size that can be read is actually 32 bytes, so several block reads are
needed to retrieve larger chunks of data.

-- 
Jean Delvare

  reply	other threads:[~2005-08-11 19:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-09 21:13 I2C block reads with i2c-viapro: testers wanted Jean Delvare
2005-08-10 20:31 ` Hinko Kocevar
2005-08-10 21:06   ` Jean Delvare
2005-08-10 22:23     ` [lm-sensors] " Martin Drab
2005-08-11 17:12       ` Jean Delvare
2005-08-10 23:13     ` Hinko Kocevar
2005-08-11 16:56       ` Jean Delvare
2005-08-11 19:13         ` Krzysztof Halasa
2005-08-11 19:59           ` Jean Delvare [this message]
2005-08-11 21:39             ` Krzysztof Halasa
2005-08-11 21:49               ` Jean Delvare
2005-08-11 22:08                 ` Krzysztof Halasa
2005-08-12  6:26                   ` Jean Delvare
2005-08-12 15:29                     ` Krzysztof Halasa
2005-08-12 17:58                       ` Jean Delvare
2005-08-12  1:07 ` [lm-sensors] " Mark M. Hoffman
2005-08-12  6:02   ` Jean Delvare
  -- strict thread matches above, loose matches on Subject: below --
2005-08-10  1:55 Salah Coronya
2005-08-10 10:06 ` Jean Delvare

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=20050811215929.1df5fab0.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=khc@pm.waw.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    /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