From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Javi <occam25-mRCrAkd8dF0@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: i2cset question
Date: Wed, 17 Oct 2012 14:43:03 +0200 [thread overview]
Message-ID: <20121017144303.43612bc4@endymion.delvare> (raw)
In-Reply-To: <loom.20121017T134619-899-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
Hi Javi,
On Wed, 17 Oct 2012 12:07:40 +0000 (UTC), Javi wrote:
> I have the same problem than Chris.
Actually I suspect this is a different problem.
> I am working with an ALIX motherboard with
> voyage linux distribution and I have connected a 24LC64 eeprom. When I try to
> write the epprom with i2cset command it doesn't work.
Because the 24LC64 uses a two-byte addressing model, while SMBus uses a
one-byte addressing model. This means you can't use this type of EEPROM
with an SMBus controller [1]. You need a full-featured I2C controller.
You may be able to achieve that on your system by using the scx200_i2c
driver instead of scx200_acb driver, or by using an extra pair of GPIO
pins with i2c-gpio.
If this isn't an option for you then you'll have to use a different
EEPROM model. AFAIK the 24C16 is the largest one using single-byte
addressing (it uses all 8 I2C addresses 0x50-0x57, and 256 * 8 * 8 =
16K.)
Note that you can't use i2cdump, i2cget and i2cset with 2-byte
addressed EEPROMs. You'll have to try the dedicated tools under
eepromer in the i2c-tools package [2]. For 2-byte addressed EEPROMs you
want either eeprog or eepromer. I seem to recall eeprog implements the
tricks described below for 2-byte addressed EEPROMs over SMBus.
[1] Actually you can write to such an EEPROM by abusing SMBus write
transactions. All you have to do is pass the second address byte as
the first data byte of either an SMBus write word transaction or,
if your SMBus controller supports it, an I2C block write
transaction. Then shift all data bytes by one position. For reads,
you could use an SMBus write byte transaction to set the address
and then SMBus receive byte transactions in a loop to retrieve the
data bytes one by one. However this is racy and slow.
[2] Note that the primary hosting site for i2c-tools is currently down,
you can use my mirror if needed:
http://khali.linux-fr.org/mirror/i2c-tools/
--
Jean Delvare
http://khali.linux-fr.org/wishlist.html
prev parent reply other threads:[~2012-10-17 12:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-17 14:33 i2cset question Chris Cole
[not found] ` <49E89342.1010807-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-04-17 15:48 ` Jean Delvare
[not found] ` <20090417174845.471d4d9d-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-04-17 16:23 ` Chris Cole
[not found] ` <49E8AD1E.1070805-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-04-17 16:33 ` Jean Delvare
2012-10-17 12:07 ` Javi
[not found] ` <loom.20121017T134619-899-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2012-10-17 12:43 ` Jean Delvare [this message]
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=20121017144303.43612bc4@endymion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=occam25-mRCrAkd8dF0@public.gmane.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;
as well as URLs for NNTP newsgroup(s).