[U-Boot] ARM v7: Flush icache when executing a program with go

Kuo-Jung Su dantesu at gmail.com
Mon May 20 02:55:39 CEST 2013


2013/5/17 Henrik Nordström <henrik at henriknordstrom.net>:
> fre 2013-05-17 klockan 00:13 +0200 skrev Wolfgang Denk:
>
>> There is a common, architecture-independent C API that implements
>> cache flushing/invalidation; please re-read the summary at [1]
>
> Sorry I missed that discussion. Had a bit too much mail for a while.
>
>> > Or maybe just punt it. If you are on an arch with incoherent caches then
>> > make sure to make use of the cache command to flush caches and maybe
>> > even disable caches before using go.
>>
>> The cache commands currently do not support subcommands for flushing
>> / invalidating the caches.  See again [1].
>
> From what I see the cache commands do have a sub commands for flushing.
>
> "icache flush" calls icache_invalidate_all().
>
> "dcache flush" calls flush_dcache_all().
>
> but imho the user shouldn't really need to care for these and is why I
> hooked into the go command.
>
> I don't see much of a performance problem with a automatic full cache
> flush when using the go command on platforms with incoherent caches. In
> most use cases it's not very different from the bootm command which also
> needs to do the same (and using a similar hooking mechanism as what I
> used for go, but not saying that is a good thing)
>
> Platforms with coherent caches likely do not need to care and can keep
> the cache as-is.
>
> And I do not think there needs to be commands for flushing specific
> regions other than for testing. Region based flushing is better done by
> code which knows what is needed. It's hard for users to get this right
> as most times it works anyway.
>
> Regards
> Henrik
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


How about making the weak aliased arch_preboot_os() global, and then
get it invoked
in both bootm & go?
It looks much pretty to me, and we don't even worry about the i-cache issues.


--
Best wishes,
Kuo-Jung Su


More information about the U-Boot mailing list