From: Arnd Bergmann <arnd@arndb•de>
To: linuxppc-embedded@ozlabs•org
Subject: Re: ioremap and outb
Date: Fri, 4 Jan 2008 11:45:20 +0100 [thread overview]
Message-ID: <200801041145.21085.arnd@arndb.de> (raw)
In-Reply-To: <20080104102037.GA31627@mail.gnudd.com>
On Friday 04 January 2008, Alessandro Rubini wrote:
> > =A0 =A0 =A0 =A0 =A0addr=3Dioremap(base_addr,size); =A0 =A0 =A0 =A0 =A0/=
/ Remap to Mem mapped
>=20
> Yes.
In newer drivers that are specific to powerpc, it's often easier
to use the of_iomap() function to map a device, so you don't
have to calculate the base address manually from the device tree.
> > =A0 =A0 =A0 =A0 =A0out_8(addr) and in_8(addr);=20
>=20
> It should be right, although __raw_readb() and __raw_writeb() may
> suffice for you.
Actually not. While they may work, the __raw_* functions do not have
a specific meaning in device drivers. Depending on the I/O model, they
may or may not work on a given platform. The {in,out}_{8,{be,le}{16,32,64}}
functions however are defined to operate on local (not PCI) ioremapped
mmio devices, and are usually more efficient than the {read,write}{b,w,l,q}
variant you'd use on PCI devices.
Arnd <><
prev parent reply other threads:[~2008-01-04 10:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-03 16:57 Drivers' probe function calling order DI BACCO ANTONIO - technolabs
2008-01-03 18:04 ` Jeff Mock
2008-01-03 21:54 ` Alessandro Rubini
2008-01-04 8:41 ` Misbah khan
2008-01-04 10:20 ` ioremap and outb Alessandro Rubini
2008-01-04 10:45 ` 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=200801041145.21085.arnd@arndb.de \
--to=arnd@arndb$(echo .)de \
--cc=linuxppc-embedded@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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