All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Peter Korsgaard <jacmet@sunsite.dk>
Cc: sfr@canb.auug.org.au, linuxppc-dev@ozlabs.org
Subject: Re: Recently removed io accessors
Date: Fri, 13 Oct 2006 17:31:10 +1000	[thread overview]
Message-ID: <1160724670.4792.195.camel@localhost.localdomain> (raw)
In-Reply-To: <87iriovh3x.fsf@sleipner.barco.com>

On Fri, 2006-10-13 at 08:56 +0200, Peter Korsgaard wrote:
> >>>>> "BH" == Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> 
> Hi,
> 
> >> Any chance of getting them back or should I implement a (slower)
> >> loop myself before submitting the patch?
> 
> BH> Well, a "packet buffer" should have no endian. When streaming in
> BH> our out a fifo, you basically stream bytes that happen to come out
> BH> 2 at a time.  So unless somebody wired the hardware backward, you
> BH> should do no swapping when using the fifo.
> 
> I agree in principle, but the issue gets complicated by the fact that
> the chip works in chunks of 32bit, but the 911{5..7} chips only have a
> 16bit interface to lower costs, and that the chip has a builtin endian
> swap feature (which works for all direct registers, but apparently not
> for the packet buffers).
> 
> The memory controller automatically translates a 32bit access to two
> 16 bit accesses.

Well, that is not necessarily broken :)

> You could be right that the hw people screwed something up, but that
> doesn't help much once there's units in the field :/

Well, I still don't see it. It all depends how the HW has been wired I
suppose but you should not need byteswap regardless of the 32 bits being
broken in packs of 2x16 bits or whatever... If the chip has a HW
byteswap for registers and not for the packet buffer, that makes it even
more clear that such swapping should not be necessary.

Unless the chip has been wired backward on the processor bus (in which
case, btw, DMA will not work either unless you have one of those
magically swapping dma controllers)..

So I still claim that you should not need them and if you do, then the
chip has probably been incorrect wired to your CPU bus. In which case,
you can either grab an old copy of the functions and put them in your
driver for your platform or add a cpu_to_leXX() loop to byteswap the
data in/out, but it's probably not the right thing to do in the generic
driver since it would be a problem specific to your board.

Unless I'm missing something ... It would be useful to have more details
about your setup.

Cheers.
Ben.

  reply	other threads:[~2006-10-13  7:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-12 15:44 Recently removed io accessors Peter Korsgaard
2006-10-13  0:04 ` Benjamin Herrenschmidt
2006-10-13  6:56   ` Peter Korsgaard
2006-10-13  7:31     ` Benjamin Herrenschmidt [this message]
2006-10-13  8:43       ` Peter Korsgaard
2006-10-13  9:30         ` Benjamin Herrenschmidt
2006-10-13  9:55           ` Peter Korsgaard
2006-10-13 12:18             ` Benjamin Herrenschmidt
2006-10-13 12:38               ` Peter Korsgaard
2006-10-13 23:20         ` Paul Mackerras
2006-10-14 11:57           ` Peter Korsgaard
2006-10-16 16:51             ` Linas Vepstas
2006-10-16 18:54               ` Peter Korsgaard

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=1160724670.4792.195.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=jacmet@sunsite.dk \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sfr@canb.auug.org.au \
    /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.