[U-Boot] [PATCH] ARM: orion5x: reduce dependence of including platform file

Wolfgang Denk wd at denx.de
Tue Oct 25 20:50:33 CEST 2011


Dear Lei Wen,

In message <CALZhoSQyCPnYCXgrYQCkvu6A0NYCrmtzveXcQsb3OSCMV_TKcA at mail.gmail.com> you wrote:
> 
> >> +#include <asm/arch/orion5x.h>
> >
> > I don't like this.
> >
> >
> > Board config files MUST NOT do any such includes.  Keep in mind that
> > one day we might want to try something like Kconfig, so board config
> > files should ONLY contain configuration information in the form of
> > #define's and the like.
> >
> > NAK.
> 
> I should admit I have some bit of confusing here...
> What I see there are lots of include in the config file, 742 include
> usage case in the config files...:
> $ grep -Rn "#include" include/configs | wc -l
> 742

There are includes.  Some of them are OK, some aren't and should be
fixed.

More than half of your number are "#include <config_cmd_default.h>"
which are perfectly fine.


For example, it's also perfectly fine if all boards that are similar
or that provide a similar look & feel (for example, because they come
from a single vendor) include a common configuration file. Such
examples are #include "amcc-common.h", #include "mv-common.h",
#include <configs/bfin_adi_common.h>, #include "manroland/common.h",
etc. etc. etc.

On the other hand, files from asm/arch/* should never define any
config settings - if it cannot be avoided they may provide register
definitions and the like, but any "#define CONFIG_*" has no place
there.

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
Our business is run on trust.  We trust you will pay in advance.


More information about the U-Boot mailing list