From: Grant Grundler <grundler@puffin.external.hp.com>
To: Randolph Chung <randolph@tausq.org>
Cc: parisc-linux@parisc-linux.org
Subject: Re: [parisc-linux] to swap or not to swap
Date: Tue, 13 Nov 2001 13:32:08 -0700 [thread overview]
Message-ID: <200111132032.NAA01102@puffin.external.hp.com> (raw)
In-Reply-To: Message from Randolph Chung <randolph@tausq.org> of "Tue, 13 Nov 2001 11:42:48 PST." <20011113114247.G3053@tausq.org>
Randolph Chung wrote:
> Grant also seems to be of the opinion that cpu data needs to be swapped
> before written to PCI devices... so does that mean that if i wrote
> something like:
>
> writew(cpu_to_le16(foo), addr)
>
> then on things like parisc it gets swapped once, and on things like
> sparc it gets swapped twice?
maybe that's a bug in how sparc code works?
For parisc, the above is correct for (nearly) all PCI devices.
(I hedge since odd PCI devices might want cpu_to_be16() instead).
And don't forget that control data read by the PCI device via DMA
has to be "endian corrected" too.
PA HW implements what I've heard called "address invariance".
IIRC, m700-10 (r4000 mips, Olivetti) does the same thing.
I think Dino Documentation calls this "byte is byte".
Ie byte stream offsets are the same regardless of how they
are address by either DMA or PIO from either CPU or PCI device.
The result is multi-byte data (ie short/int) has to be swapped
when read/written by the PArisc CPU and the addresses don't change.
HTH,
grant
next prev parent reply other threads:[~2001-11-13 20:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-13 8:30 [parisc-linux] to swap or not to swap Randolph Chung
2001-11-13 14:25 ` Matthew Wilcox
2001-11-13 19:42 ` Randolph Chung
2001-11-13 20:32 ` Grant Grundler [this message]
2001-11-13 22:51 ` Alan Cox
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=200111132032.NAA01102@puffin.external.hp.com \
--to=grundler@puffin.external.hp.com \
--cc=parisc-linux@parisc-linux.org \
--cc=randolph@tausq.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