From: Arnd Bergmann <arnd@arndb.de>
To: Jonas Bonn <jonas@southpole.se>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] Add IO primitives for Wishbone bus
Date: Mon, 4 Oct 2010 10:37:43 +0200 [thread overview]
Message-ID: <201010041037.43477.arnd@arndb.de> (raw)
In-Reply-To: <1286178037-17337-1-git-send-email-jonas@southpole.se>
On Monday 04 October 2010 09:40:37 Jonas Bonn wrote:
> Is this an acceptable solution or is there another way that would be
> better? The problem at hand is how best to write a driver for a device
> when the device has the same endianess as the CPU and that endianess is
> arbitrary... for soft cores (OpenRISC in my case), this is a relevant problem,
> as the device endianess is determined along with the CPU core endianess
> at synthesis time...
Looks good in principle, the only possible problem I can see is if you
have both little-endian and big-endian wishbone devices in the same
system, which I assume could happen at some point.
If you want to be able to handle that cleanly, you should pass the device
into the accessor function as well.
It would also be good to provide a matching wb_iomap() function that
returns an iomem token you can use here (see pci_iomap).
A more complex implementation would detect the endianess at wb_iomap
time and return a token that encodes the endianess, which the regular
ioread/iowrite multiplexors can handle then. You probably don't need
to go that far, unless you expect wishbone to become ubiquitous in
the near future.
Arnd
prev parent reply other threads:[~2010-10-04 8:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-04 7:40 [RFC] Add IO primitives for Wishbone bus Jonas Bonn
2010-10-04 8:37 ` Arnd Bergmann [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=201010041037.43477.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=jonas@southpole.se \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox