
Dear Aneesh V,
In message 4E32C223.2050309@ti.com you wrote:
I had written a small write-up on this earlier today in the below thread: http://marc.info/?l=u-boot&m=131193466800729&w=2
Thanks.
I had done extensive testing on the armv7 cache-maintenance APIs by creating coherency issues and solving them using the APIs. I believe the problems are due to the APIs not being appropriately used where they need to be used, also coupled with the fact that dcache_enable() is now called from board_init_r().
Yes, this is the problem - now suddenly a large number of drivers which are not prepared to run with caches on break.
Maybe, I should also write a README with guidelines for correct cache usage.
That would be nice, too. TIA!
Also, I would suggest the following to solve the problem with breaking boards:
- Allow boards to define CONFIG_SYS_DCACHE_OFF and/or
- Instead of calling dcache_enable() from board_init_r() let's call a
new function like dcache_init(). The default implementation of this function shall do nothing. The real implementation in platform code may enable or disable d_cache() on a per SoC/board basis.
I think approach 2. is the better one (we should try to avoid unnecessary #ifdef's). But instead of doing nothing, the default implementation should print a warning "dcache: not enabled", so users and board maintainers are permanently aware which boards have not been adapted / fixed yet :-)
Thanks!
Best regards,
Wolfgang Denk