lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Re: ARP not working


From: address@hidden
Subject: Re: [lwip-users] Re: ARP not working
Date: Fri, 18 Feb 2011 21:47:35 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

Bernard Mentink wrote:
Yes, I am using DMA. Can you please elaborate on how to invalidate the cache lines, I havn't had much to do with dma to date ..
Basically, you just have to make sure that data written by the processor (lwIP or your driver in this case) is actually written out to RAM before the ethernet DMA engine reads it from there. To do that, you normally would execute a processor instruction to "invalidate" a certain address in the cache. If the cache currently holds that address, the contents are written to RAM and re-read on next usage.

You'd normally do this when releasing RAM from the processor to the ethernet MAC or before touching newly received data that just has been put into RAM by the ethernet MAC. The actual procedure how to do that heavily depends on the processor and compiler toolchain you are using. For example when using gcc on NIOS-II, you would write

asmvolatile ("flushda (%0)" :: "r" (i));

where i is the address to flush. Also, make sure that if the data size is bigger than one cache line, be sure to flush all corresponding cache line addresses (basically executing a loop like "for(i=start_addr; i < end; i += cacheLineSize)".

There should be more information in your processor's documentation (or in the compiler's documentation) about this.

Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]