Re: allocating uncachable memory
flat view
From: Benjamin Herrenschmidt <hidden>
Date: 2000-08-23 14:03:27
I'm writing a driver for a PCI controller in a PPC system. That driver "exports" a bit of local ram into the PCI space. Now if some PCI device is writing into this memory the local system won't notice it in all cases since this memory is cached. How can i allocate uncached memory in linux? Or if this does not work how can I remap it as non-cachable. I already tried ioremap_nocache but this does not work for real memory. It would be nice if someone could give me a short code fragment...
Depending on the host PCI controller, the machine will or will not be cache-coherent. Most PPC machines out there (all PCI PPC machines) are, AFAIK, cache coherents. PPC NuBus powermacs are not. That means that any access done to memory from the PCI is "snooped" by the CPU and the cache is kept up-to-date. There are routines in 2.4 for allocating PCI "consistent" memory (will be uncached on archs that are not coherent and normal on others). See pci_alloc_consistent() or something like that (I don't have my kernel sources with me). ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/