Howto allocate non-cacheable memory

Arnd Bergmann arnd.bergmann at de.ibm.com
Mon May 29 01:36:14 EST 2006


On Saturday 27 May 2006 07:38, Muneeswaran P - TLS, Chennai wrote:
>         Pls clarify the following doubts:
>         1. DPRAM is memory mapped to PCI-X card.
>         2. I have to transfer data from main memory to DPRAM using bus
> master concept and vice-versa.
>         3. How to make this memory area as non-cacheable one ? 
>         4. Whether DMA mapping (pci_map_single() call ) should be done for
> both DPRAM and main memory ?
>            4.a) I will get the physical address of DPRAM memory (memory
> mapped to PCI-X card) from BAR-0 register. Can i use this physical addres
> directly for data transer using bus master (without pci_map_single() call.)
> ?
>            4.b)  How to make main memory area as non-cacheable one ?

You need pci_map_single() for all bus-master accesses from the PCI-X card
and ioremap() to map the card's registers and/or memory into your kernel
address space as cache-inhibited.

Depending on what your adapter does, you might want to map memory areas
on the card with __ioremap(addr, size, _PAGE_NO_CACHE) instead of
ioremap(addr, size) in order to get a non-guarded mapping.

	Arnd <><



More information about the Linuxppc-embedded mailing list