[U-Boot] [PATCH v 1/3] arm: do not force d-cache enable on all boards

Wolfgang Denk
2011-08-01T19:45:44Z

Dear Jason Liu,

In message <CAB4PhKdj0prR3etkkz5PSqKPgS69CFZepY83Gw-aPQKcFkyKkQ@mail.gmail.com> you wrote:
>
> > What about the following change?
> >
> > #ifndef CONFIG_SYS_DCACHE_OFF
> > dcache_enable();
> > #else
> > puts("WARNING: Caches not enabled\n");
> > #endif
>
> Or better:
>
> #ifdef CONFIG_SYS_DCACHE_ON
> dcache_enable();
> #else
> puts("WARNING: Caches not enabled\n");
> #endif
>
> In fact, we can turn on I-cache safely by default, turn-off D-cache by default,
> But give big warning to board-maintainer to fix it later if turn off D-cache.

This is NOT better, it is worse.

The rule is that you don't need to #define a specific option if you
want default behaviour. Default behaviour should be caches on, so
only "broken" boards where this does not work yet should be able to
opt out by defining some option.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There are some things worth dying for.
-- Kirk, "Errand of Mercy", stardate 3201.7