[U-Boot] [PATCH 01/10] mkconfig: parse top level makefile target to multiple config targets

Hu Mingkai-B21284 Mingkai.Hu at freescale.com
Mon Sep 7 14:18:35 CEST 2009


 

> -----Original Message-----
> From: Wolfgang Denk [mailto:wd at denx.de] 
> Sent: Monday, September 07, 2009 6:59 PM
> To: Hu Mingkai-B21284
> Cc: Kumar Gala; Wood Scott-B07421; U-Boot-Users ML; Mike Frysinger
> Subject: Re: [PATCH 01/10] mkconfig: parse top level makefile 
> target to multiple config targets
> 
> Dear "Hu Mingkai-B21284",
> 
> In message 
> <73839B4A0818E747864426270AC332C30447ECB9 at zmy16exm20.fsl.frees
> cale.net> you wrote:
> > 
> > > > > It should be enough to pass the make target name to 
> the mkconfig 
> > > > > script resp. the board config file, i. e. in this case either 
> > > > > "CONFIG_MPC8536DS_NAND" or "CONFIG_MPC8536DS_NAND_36BIT".
> > > The rest
> > > > > of the scripting/decision making can then be done in 
> the board 
> > > > > config file.
> > > > > 
> > > >
> > > > Thanks for your replay, but I'm not totally catch on you.
> > > > "the board config file" in your words refer to
> > > board/*/config.mk, right?
> > > 
> > > No, with "board config file" I mean include/configs/*.h
> >
> > How can I parse the board name in a header file?
> 
> I'm not sure I understand the question (or rather the problem 
> you are seeing).
> 
> You already know the board name, because the board config 
> file is clearly related ot one (or eventually more) boards. 
> The rest can be done with some trivial #ifdef'fery.
> 

Oh... I complicated the matters, you means as the follows, right?

In the Makefile:
MPC8536DS_NAND_config \
MPC8536DS_NAND_36BIT_config \
MPC8536DS_36BIT_config \
MPC8536DS_config:       unconfig
        @echo "#define CONFIG_$(@:_config=) 1"  >$(obj)include/config.h
        @$(MKCONFIG) -a MPC8536DS ppc mpc85xx mpc8536ds freescale

then in the include/configs/*.h:
#ifdef MPC8536DS_NAND
blablabla
#endif

#ifdef MPC8536DS_NAND_36BIT
blablabla
#endif

#ifdef MPC8536DS_36BIT
blablabla
#endif

> > If config booting from NAND, we also need to override the 
> TEXT_BASE in 
> > the board/*/config.mk file, how could we do that?
> 
> You can for example set CONFIG_SYS_MONITOR_BASE (or some 
> other CONFIG_ variable - but CONFIG_SYS_MONITOR_BASE is used 
> anyway) as needed in your include/configs/*.h, which then 
> gets exported through include/autoconf.mk, so you can use 
> some "TEXT_BASE = $(CONFIG_SYS_MONITOR_BASE)" in your config.mk
> 

Thanks. 

I'll intergate your comments, align the patchset to the latest U-Boot
and resend the patches, please comments then.

Many thanks,
Mingkai


More information about the U-Boot mailing list