ppc405 dma - vm - cache question
Smith, Gene
gene.smith at siemens.com
Wed Oct 27 15:10:56 UTC 2004
Feng, Shuchen wrote, On 10/27/2004 10:25 AM:
> Gene Smith wrote :
>
>
>
>>I have a question for ppc experts in rtems land. I am trying to port the
>
>
>>emac ethernet driver from netbsd to rtems. In the driver code I see all
>>kinds of calls to things like this:
>
>
>>bus_dmamap_create();
>>bus_dmamem_alloc();
>>bus_dmamap_load();
>>bus_dmamap_sync(); <-- called a lot in tx/rx ISRs.
>
>
>
>>I think that these are used to reconcile virtual memory in unix to
>>physical memory addressed by devices (emac or mal device on ppc405).
>
>
> My understanding is that they do software snoop to ensure cache
> coherency.
>
>
>>My assumption is that in rtems I can pretty much ignore these or make my
>>own versions since rtems always uses real mode; anywhere memory is
>>needed for dma purposes by the ethernet device and/or driver I can just
>>malloc it and use the returned address for dma verbatim.
>
>
> Either hardware snoop or software snoop is required if the ethernet
> controller
> accesses SDRAM space that is also cacheable by the CPU.
>
"snoop of hardware or software" is a new term to me. Could you explain
what you mean by this? Yes, I can see cache would be a concern like when
tcp/ip writes to mbufs in data cache and the device does not see the
real data when it tries to send the "same" mbufs using dma. I think this
requires the sync and/or eieio instructions but not sure. I am still
trying to learn this stuff. Thanks.
More information about the users
mailing list