[U-Boot] [PATCH] tegra2: Enable data cache
Simon Glass
sjg at chromium.org
Fri Sep 9 05:10:33 CEST 2011
Hi,
On Thu, Sep 8, 2011 at 5:30 PM, Marek Vasut <marek.vasut at gmail.com> wrote:
> On Friday, September 09, 2011 02:25:46 AM Mike Frysinger wrote:
>> On Thursday, September 08, 2011 18:20:16 Simon Glass wrote:
>> > --- a/board/nvidia/common/board.c
>> > +++ b/board/nvidia/common/board.c
>> > @@ -307,3 +307,11 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)
>> >
>> > return 0;
>> >
>> > }
>> > #endif
>> >
>> > +
>> > +#ifndef CONFIG_SYS_DCACHE_OFF
>> > +void enable_caches(void)
>> > +{
>> > + /* Enable D-cache. I-cache is already enabled in start.S */
>> > + dcache_enable();
>> > +}
>> > +#endif
>>
>> not specific to your patch, but this seems kind of dumb to copy & paste the
>> same thing between all the arm sub arches/boards. why cant the default
>> enable_caches() look like this for arm:
>> void enable_caches(void)
>> {
>> #ifndef CONFIG_SYS_DCACHE_OFF
>> dcache_enable();
>> #endif
>> #ifndef CONFIG_SYS_ICACHE_OFF
>> icache_enable();
>> #endif
>> }
>> -mike
See the patch here:
http://lists.denx.de/pipermail/u-boot/2011-August/098435.html
There was some discussion about this and apparently we need the dcache
to default off on ARM even though CONFIG_SYS_DCACHE_OFF is not defined
in the board config header. This is because many ARM boards are still
broken. It is a little unfortunate.
I could modify my patch to be in arch/arm/cpu/armv7/tegra2 if that
will help? I hope that this is only a temporary situation.
>
> Makes sense ... and also, we won't eventually need this "enable_caches()" at all
> in cpu-directories. It can then be moved to lib/.
Yes that's where it was at first. I was quite happy with it there. It
actually got called :-)
BTW note that the icache is enabled much earlier, normally as one of
the first things after boot, certainly prior to relocation.
Regards,
Simon
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
More information about the U-Boot
mailing list