All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Scott Wood <scottwood@freescale.com>
Cc: sparclinux@vger.kernel.org, linuxppc-dev@ozlabs.org,
	paulus@samba.org, David Miller <davem@davemloft.net>
Subject: Re: [PATCH 0/3]: Sparc OF I2C support.
Date: Fri, 22 Aug 2008 08:01:37 +1000	[thread overview]
Message-ID: <1219356097.21386.143.camel@pasglop> (raw)
In-Reply-To: <20080821163256.GC15669@ld0162-tx32.am.freescale.net>

On Thu, 2008-08-21 at 11:32 -0500, Scott Wood wrote:
> On Thu, Aug 21, 2008 at 12:10:12AM -0700, David Miller wrote:
> > Mostly straightforward stuff _except_ for the I2C address encoding.
> > 
> > What I2C IEEE1275 device binding was used to write that code in
> > of_i2c.c?  Is it some PowerPC specific thing?  Was it "invented"
> > by the embedded folks (I hope not)?
> 
> Yes, it was "invented".  There was no documented i2c OF binding that I
> could find, and AFAIR nobody came forward with examples of existing
> practice at the time.

Well, there were examples in the powermac code :-)

> > And, furthermore, the device address is shifted up 1 bit higher
> > than the Linux I2C layer expects.  It includes the low direction
> > bit, bit 0, so we have to shift it down by 1 bit before we give
> > it to the Linux I2C layer.
> 
> Yuck.

Apple does the same. IE. I take the address from "reg" and shift it
right by one bit before passing it to linux.

> > 2) When CONFIG_SPARC, shift the device address down by one bit before
> >    giving it to the Linux I2C layer.
> 
> Maybe we should distinguish by the type of I2C bus node instead.

Or fix the embedded stuff :-)

Ben.

WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Scott Wood <scottwood@freescale.com>
Cc: sparclinux@vger.kernel.org, linuxppc-dev@ozlabs.org,
	paulus@samba.org, David Miller <davem@davemloft.net>
Subject: Re: [PATCH 0/3]: Sparc OF I2C support.
Date: Thu, 21 Aug 2008 22:01:37 +0000	[thread overview]
Message-ID: <1219356097.21386.143.camel@pasglop> (raw)
In-Reply-To: <20080821163256.GC15669@ld0162-tx32.am.freescale.net>

On Thu, 2008-08-21 at 11:32 -0500, Scott Wood wrote:
> On Thu, Aug 21, 2008 at 12:10:12AM -0700, David Miller wrote:
> > Mostly straightforward stuff _except_ for the I2C address encoding.
> > 
> > What I2C IEEE1275 device binding was used to write that code in
> > of_i2c.c?  Is it some PowerPC specific thing?  Was it "invented"
> > by the embedded folks (I hope not)?
> 
> Yes, it was "invented".  There was no documented i2c OF binding that I
> could find, and AFAIR nobody came forward with examples of existing
> practice at the time.

Well, there were examples in the powermac code :-)

> > And, furthermore, the device address is shifted up 1 bit higher
> > than the Linux I2C layer expects.  It includes the low direction
> > bit, bit 0, so we have to shift it down by 1 bit before we give
> > it to the Linux I2C layer.
> 
> Yuck.

Apple does the same. IE. I take the address from "reg" and shift it
right by one bit before passing it to linux.

> > 2) When CONFIG_SPARC, shift the device address down by one bit before
> >    giving it to the Linux I2C layer.
> 
> Maybe we should distinguish by the type of I2C bus node instead.

Or fix the embedded stuff :-)

Ben.



  parent reply	other threads:[~2008-08-21 22:01 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-21  7:10 [PATCH 0/3]: Sparc OF I2C support David Miller
2008-08-21  7:10 ` David Miller
2008-08-21 16:32 ` Scott Wood
2008-08-21 16:32   ` Scott Wood
2008-08-21 21:21   ` David Miller
2008-08-21 21:21     ` David Miller
2008-08-21 21:35     ` Scott Wood
2008-08-21 21:35       ` Scott Wood
2008-08-21 21:45       ` David Miller
2008-08-21 21:45         ` David Miller
2008-08-21 22:05         ` Benjamin Herrenschmidt
2008-08-21 22:05           ` Benjamin Herrenschmidt
2008-08-21 22:27           ` David Miller
2008-08-21 22:27             ` David Miller
2008-08-21 22:38             ` Benjamin Herrenschmidt
2008-08-21 22:38               ` Benjamin Herrenschmidt
2008-08-21 22:05       ` Benjamin Herrenschmidt
2008-08-21 22:05         ` Benjamin Herrenschmidt
2008-08-21 22:28         ` David Miller
2008-08-21 22:28           ` David Miller
2008-08-21 22:39           ` Benjamin Herrenschmidt
2008-08-21 22:39             ` Benjamin Herrenschmidt
2008-08-21 23:14       ` Grant Likely
2008-08-21 23:14         ` Grant Likely
2008-08-21 23:14         ` Grant Likely
2008-08-21 23:32         ` David Miller
2008-08-21 23:32           ` David Miller
2008-08-21 23:32           ` David Miller
2008-08-22  1:15           ` Josh Boyer
2008-08-22  1:15             ` Josh Boyer
2008-08-22  1:15             ` Josh Boyer
2008-08-22  3:53             ` David Miller
2008-08-22  3:53               ` David Miller
2008-08-22  3:53               ` David Miller
2008-08-22  4:18               ` Grant Likely
2008-08-22  4:18                 ` Grant Likely
2008-08-22  4:18                 ` Grant Likely
2008-08-22  4:22                 ` David Miller
2008-08-22  4:22                   ` David Miller
2008-08-22  4:22                   ` David Miller
2008-08-22  4:29                   ` Mitch Bradley
2008-08-22  4:29                     ` Mitch Bradley
2008-08-22  4:30                     ` Grant Likely
2008-08-22  4:30                       ` Grant Likely
2008-08-22  4:30                       ` Grant Likely
2008-08-22  4:34                       ` Grant Likely
2008-08-22  4:34                         ` Grant Likely
2008-08-22  4:34                         ` Grant Likely
2008-08-22  4:37                         ` David Miller
2008-08-22  4:37                           ` David Miller
2008-08-22  4:37                           ` David Miller
2008-08-22  5:19                           ` Mitch Bradley
2008-08-22  5:19                             ` Mitch Bradley
2008-08-22  5:19                             ` Mitch Bradley
2008-08-22 16:00                             ` Yoder Stuart
2008-08-22 16:00                               ` Yoder Stuart
2008-08-22 16:00                               ` Yoder Stuart
2008-08-22 16:13                               ` Josh Boyer
2008-08-22 16:13                                 ` Josh Boyer
2008-08-22 16:13                                 ` Josh Boyer
2008-08-22 10:50               ` Josh Boyer
2008-08-22 10:50                 ` Josh Boyer
2008-08-22 10:50                 ` Josh Boyer
2008-08-22 11:06                 ` David Miller
2008-08-22 11:06                   ` David Miller
2008-08-22 11:06                   ` David Miller
2008-08-21 23:45         ` Jon Smirl
2008-08-21 23:45           ` Jon Smirl
2008-08-21 23:45           ` Jon Smirl
2008-08-22  2:33           ` Grant Likely
2008-08-22  2:33             ` Grant Likely
2008-08-22  2:33             ` Grant Likely
2008-08-22  2:39             ` Jon Smirl
2008-08-22  2:39               ` Jon Smirl
2008-08-22  2:39               ` Jon Smirl
2008-08-22 15:58               ` Scott Wood
2008-08-22 15:58                 ` Scott Wood
2008-08-22 15:58                 ` Scott Wood
2008-08-22 16:44               ` Grant Likely
2008-08-22 16:44                 ` Grant Likely
2008-08-22 16:44                 ` Grant Likely
2008-08-21 22:01   ` Benjamin Herrenschmidt [this message]
2008-08-21 22:01     ` Benjamin Herrenschmidt
2008-08-21 21:53 ` Jon Smirl
2008-08-21 21:53   ` Jon Smirl
2008-08-21 21:58   ` David Miller
2008-08-21 21:58     ` David Miller

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=1219356097.21386.143.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=scottwood@freescale.com \
    --cc=sparclinux@vger.kernel.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.