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

Lei Wen adrian.wenl at gmail.com
Tue Oct 25 10:58:41 CEST 2011


Hi Wolfgang,

On Tue, Oct 25, 2011 at 3:43 PM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Lei Wen,
>
> In message <1319509652-5648-1-git-send-email-leiwen at marvell.com> you wrote:
>> For files like the drivers/serial/serial.c, it must include the
>> platform file, as the CONFIG_SYS_NS16550_COM1 must reference to
>> the definition in the platform definition files.
>>
>> Include the platform definition file in the config file, so that it
>> would decouple the dependence for the driver files.
> ...
>
>> --- a/include/configs/edminiv2.h
>> +++ b/include/configs/edminiv2.h
>> @@ -45,6 +45,7 @@
>>  #define CONFIG_88F5182               1       /* SOC Name */
>>  #define CONFIG_MACH_EDMINIV2 1       /* Machine type */
>>
>> +#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

Or should I directly hard coding the CONFIG_SYS_NS16550_COM1
insteading the macro ORION5X_UART0_BASE,
since this macro is defined in arch/arm/include/asm/arch-orion5x/orion5x.h...

Thanks,
Lei


More information about the U-Boot mailing list