[U-Boot] [PATCH] cmd: net: flush cache cacheline aligned

Simon Glass sjg at chromium.org
Thu Aug 4 03:17:04 CEST 2016


Hi Joe,

On 3 August 2016 at 17:18, Joe Hershberger <joe.hershberger at gmail.com> wrote:
> On Tue, Aug 2, 2016 at 2:20 AM, Stefan Agner <stefan at agner.ch> wrote:
>> From: Stefan Agner <stefan.agner at toradex.com>
>>
>> Flush loaded data cacheline aligned. This avoids warnings such as
>> CACHE: Misaligned operation at range [81000000, 816d0fa8]
>>
>> Signed-off-by: Stefan Agner <stefan.agner at toradex.com>
>> ---
>
> This was already rejected once.
> http://lists.denx.de/pipermail/u-boot/2012-April/121564.html
>
>> Why do we actually have to flush caches after load? It seems to
>> have worked so far despite the caches did not get flushed (due to
>> missalignment).
>
> I'm not sure that we do, but it's been there since as far back as the
> git history goes. Maybe Wolfgang has memory of a reason.

I think this is the correct solution. If you load something to memory
you have to flush the cache. If someone is brave enough to load an
image that finishes immediately before something where there is data
that will be overwritten by the flush, then they deserve some pain.

Anytime we flush the cache we have to do it according the rules of the
cache. One of those rules is that cache lines are larger than one
byte. So either we don't flush or we do, and if we do, we must align.

Regards,
Simon


More information about the U-Boot mailing list