ioremap and outb
Arnd Bergmann
arnd at arndb.de
Fri Jan 4 21:45:20 EST 2008
On Friday 04 January 2008, Alessandro Rubini wrote:
> > addr=ioremap(base_addr,size); // Remap to Mem mapped
>
> 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.
> > out_8(addr) and in_8(addr);
>
> 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 <><
More information about the Linuxppc-embedded
mailing list