ioremap and outb

Alessandro Rubini rubini at gnudd.com
Fri Jan 4 21:20:37 EST 2008


Please don't change subject matter without changing subject line, and please
open a new thread when asking a new question.

> I am writing a driver in which device port is mapped to CPLD and 8 bit data
> bus is directly connected from processor to CPLD. Read write on CPLD memory
> mapped (buffer/register) is required to control the device. This is now IO
> mapped to processor.

This is typical. You'll find quite a lot of examples.

>          addr=ioremap(base_addr,size);          // Remap to Mem mapped

Yes.

>          out_8(addr) and in_8(addr); 

It should be right, although __raw_readb() and __raw_writeb() may
suffice for you. Please check the comments in <asm/io.h>.

It may also happen that you need to read/write  32 bits instead of 8,
but this depends on your specific hardware.

/alessandro


More information about the Linuxppc-embedded mailing list