All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Rubinstein <felixru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Intel ICHx bus driver
Date: Thu, 28 Jan 2010 14:46:23 +0200	[thread overview]
Message-ID: <af0693f01001280446u66923c70ld707d10b9fcee068@mail.gmail.com> (raw)
In-Reply-To: <20100128105340.41aecf64-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>

Hi Jean,

On Thu, Jan 28, 2010 at 11:53 AM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
> Hi Felix,
>
> On Thu, 28 Jan 2010 11:32:28 +0200, Felix Rubinstein wrote:
>> Please explain to me how do you interpret "I2C Block Write"?
>> To my understanding it's I2C, not SMBus, transaction on the bus,
>> meaning (from Documentation/i2c/i2c-protocol)
>> S Addr Wr [A] Data [A] Data [A] ... [A] Data [A] P
>
> No, the above isn't what people commonly call "I2C block write". What
> people commonly call "I2C block write", and which would probably be
> more appropriately called "1-byte addressing I2C block write" is (as
> documented in Documentation/i2c/i2c-protocol):
>
> S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P
>
> That being said, please note that the difference is only theoretical:
> nothing differentiates command bytes from data bytes on the wire.
>
>> on the other hand SMBus transaction looks like this:
>> S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P
>>
>> The diff is obvious, no Count (not to say Comm) bytes in I2C
>> transaction (well, it's clear, ICH9 is SMBus, not I2C bus). But what
>> does "I2C Block Write" then means?
>
> See "I2C block write" as functionally equivalent to "SMBus block write"
> but for non-SMBus devices such as I2C EEPROMs. The goal is the same
> (write a series of bytes to the device at a given sub-address) but the
> on-the-wire format is different (size goes on the wire for SMBus, not
> for I2C.)
>
> While "I2C block write" isn't part of the SMBus specification, we have
> implemented it in a similar way, simply because many SMBus controllers
> implement that transaction type.
>
>> > I have no idea what you mean with "I2C's multi-block". Please be
>> > specific.
>>
>> S Addr Wr [A] Data [A] Data [A] ... [A] Data [A] P
>
> OK, that's a straight I2C write of arbitrary length.
>
>> Does  i2c-i801.c  support the following kind of transactions?
>> S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P
>> (note, no count byte on the bus, taken from Documentation/i2c/smbus-protocol)
>
> Yes, it does. Use i2c_smbus_write_i2c_block_data(). And if you don't
> need the command byte, you can abuse it by passing the first data byte
> as the command.
>
>> looking at i801_block_transaction_by_block:
>>
>>         if (read_write == I2C_SMBUS_WRITE) {
>>                 len = data->block[0];
>>                 outb_p(len, SMBHSTDAT0);
>>                 for (i = 0; i < len; i++)
>>                         outb_p(data->block[i+1], SMBBLKDAT);
>>         }
>>
>> Meaning len is put on the bus.
>
> No, the above piece of code doesn't imply this. The length is written
> to one register of the SMBus controller. It doesn't imply in any way
> that the controller will push that value on the wire. In the case of
> I2C block transactions, it does not.
How exactly the len is not pushed on the wire?
In i801_transaction, the outb_p(xact | I801_START, SMBHSTCNT);
where xact has I801_BLOCK_DATA (101b) turned on.

here is an excerpt from ICH9 datasheet:
101 = Block: This command uses the transmit slave address, command, DATA0
registers, and the Block Data Byte register. For block write, the
count is stored
in the DATA0 register and indicates how many bytes of data will be transferred.

But DATA0 was assigned a value of len before that by means of the
above code snipet.
Please shed the light why SMBus controller will not push the len byte
on the wire if DATA0 equals to len and Block SMB_CMD (as defined in
the datasheet on page 761) equals to 101b (I801_BLOCK_DATA).


Thanks,
Felix R.


>
> BTW, the ICH9 datasheet is public, so you can easily check what exactly
> the controller does for each transaction type.
>
> --
> Jean Delvare
> http://khali.linux-fr.org/wishlist.html
>

  parent reply	other threads:[~2010-01-28 12:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27 17:56 Intel ICHx bus driver Felix Rubinstein
     [not found] ` <af0693f01001270956h781f2832r928364574d3406aa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-28  7:59   ` Jean Delvare
     [not found]     ` <20100128085904.4e202de1-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-01-28  9:32       ` Felix Rubinstein
     [not found]         ` <af0693f01001280132l4002af0fgf3137fa27ce8555e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-28  9:53           ` Jean Delvare
     [not found]             ` <20100128105340.41aecf64-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-01-28 12:46               ` Felix Rubinstein [this message]
     [not found]                 ` <af0693f01001280446u66923c70ld707d10b9fcee068-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-28 13:29                   ` Jean Delvare
     [not found]             ` <af0693f01002182310i6678e4b5h80feb14b24b37742@mail.gmail.com>
     [not found]               ` <af0693f01002182310i6678e4b5h80feb14b24b37742-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-19  9:58                 ` Jean Delvare
     [not found]                   ` <20100219105841.2bd8b16c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-22 16:12                     ` Felix Rubinstein
     [not found]                       ` <af0693f01002220812n5a6060cejc00d1ebbd7b9424d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-22 21:58                         ` Jean Delvare
     [not found]                           ` <af0693f01002231521q4f99eb63ocd607670625fadfa@mail.gmail.com>
     [not found]                             ` <af0693f01002231521q4f99eb63ocd607670625fadfa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-24 12:01                               ` Felix Rubinstein
     [not found]                                 ` <af0693f01002240401g1aeaf840ld06a156a06be9dbf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-03-02 21:22                                   ` Jean Delvare
     [not found]                                     ` <20100302222203.1eb67c3a-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-03 16:36                                       ` Felix Rubinstein
2010-03-03 16:59                                       ` Jean Delvare
2010-02-28 11:08                               ` Jean Delvare
     [not found]                                 ` <20100228120817.275ef279-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-28 13:45                                   ` Felix Rubinstein
     [not found]                                     ` <af0693f01002280545n622b1c41v1f8c104e57fb51b6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-28 20:19                                       ` Jean Delvare
     [not found]                                         ` <20100228211949.3297a0ff-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-02 12:53                                           ` Felix Rubinstein
     [not found]                                             ` <af0693f01003020453m7ca6891bjca4833c7fa45f44d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-03-12 13:19                                               ` Jean Delvare
     [not found]                                                 ` <20100312141901.04299a55-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-12 16:24                                                   ` Jean Delvare
     [not found]                                                     ` <20100312172421.5b4907e6-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-15  9:43                                                       ` Felix Rubinstein
     [not found]                                                         ` <af0693f01003150243u4d4d76e7t71b37ecd452896ea-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-03-15 10:06                                                           ` Jean Delvare
     [not found]                                                             ` <20100315110645.1df3e4f0-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-15 11:12                                                               ` Felix Rubinstein
     [not found]                                                                 ` <af0693f01003150412p5823d8e0j678b035b1c7cc4bb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-03-15 11:46                                                                   ` Jean Delvare
     [not found]                                                                     ` <20100315124648.6dafae21-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-15 13:12                                                                       ` Felix Rubinstein

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=af0693f01001280446u66923c70ld707d10b9fcee068@mail.gmail.com \
    --to=felixru-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.