public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
@ 2007-06-11 23:56 Jon Loeliger
  2007-06-12 15:22 ` Timur Tabi
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jon Loeliger @ 2007-06-11 23:56 UTC (permalink / raw)
  To: u-boot

Wolfgang,

This series of 19 patches introduces new CONFIG_CMD_*
names to replace the existing CFG_CMD_* and eliminates
the need for the bit-wise command configuration scheme.

In this step, the new names are introduced in "all"
and "default" files.  Individual boards can then be
configured with either of those starting points and
augmented with additional #define or #undef statements
as desired.

This patch series implements a "temporary step" in
which both the old and new configuration mechanism
are still fully supported, but the old style using
CFG_CMD_* is deprecated.  All references that used
to exist with CFG_CMD_* are now duplicated to have
    (CFG_CMD_x || CONFIG_CMD_x)
as a temporary measure, until all the individual
board config files are updated to use the new symbols.
When that happens, the old symbols will be removed.

An example new style command config file is shown
in include/configs/MPC8641HPCN.h.

I've made this series of patches available as a git
repository called u-boot-cfg.git:

gitweb:
    http://www.jdl.com/git_repos

git:
    git clone git://www.jdl.com/software/u-boot-cfg.git

Enjoy!

jdl

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-06-11 23:56 [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files Jon Loeliger
@ 2007-06-12 15:22 ` Timur Tabi
  2007-06-12 15:59   ` Wolfgang Denk
  2007-06-12 17:33 ` Ben Warren
  2007-07-03 22:45 ` Wolfgang Denk
  2 siblings, 1 reply; 11+ messages in thread
From: Timur Tabi @ 2007-06-12 15:22 UTC (permalink / raw)
  To: u-boot

Jon Loeliger wrote:

> This patch series implements a "temporary step" in
> which both the old and new configuration mechanism
> are still fully supported, but the old style using
> CFG_CMD_* is deprecated.  All references that used
> to exist with CFG_CMD_* are now duplicated to have
>     (CFG_CMD_x || CONFIG_CMD_x)

An alternative would have been to define CONFIG_COMMANDS based on the CONFIG_CMD_x values. 
   In cmd_confdefs.h, add something like this:

/* If CONFIG_COMMANDS is not defined, then assume we're using CONFIG_CMD_x */
#ifndef CONFIG_COMMANDS

#ifdef CONFIG_CMD_AUTOSCRIPT
#undef CONFIG_CMD_AUTOSCRIPT
#define CONFIG_CMD_AUTOSCRIPT CONFIG_CMD_AUTOSCRIPT
#else
#define CONFIG_CMD_AUTOSCRIPT 0
#endif

... ( repeat for each CONFIG_CMD_x )

#define CONFIG_COMMANDS \
	(CONFIG_CMD_AUTOSCRIPT | \
	CONFIG_CMD_x (repeat for each CONFIG_CMD_x)

#endif /* #ifndef CONFIG_COMMANDS */

With this technique, you won't need to modify all of the source files that use 
CONFIG_COMMANDS.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-06-12 15:22 ` Timur Tabi
@ 2007-06-12 15:59   ` Wolfgang Denk
  2007-06-12 16:07     ` Jon Loeliger
  2007-06-12 16:08     ` Timur Tabi
  0 siblings, 2 replies; 11+ messages in thread
From: Wolfgang Denk @ 2007-06-12 15:59 UTC (permalink / raw)
  To: u-boot

In message <466EBA23.4030308@freescale.com> you wrote:
>
> #ifdef CONFIG_CMD_AUTOSCRIPT
> #undef CONFIG_CMD_AUTOSCRIPT
> #define CONFIG_CMD_AUTOSCRIPT CONFIG_CMD_AUTOSCRIPT
> #else
> #define CONFIG_CMD_AUTOSCRIPT 0
> #endif


#define foo foo ??? Not that looks uterly strange to me...

> ... ( repeat for each CONFIG_CMD_x )

grrrghh....

> #define CONFIG_COMMANDS \
> 	(CONFIG_CMD_AUTOSCRIPT | \
> 	CONFIG_CMD_x (repeat for each CONFIG_CMD_x)

Did you actually test if this works?

> With this technique, you won't need to modify all of the source files that use 
> CONFIG_COMMANDS.

But we *do* want to modify all files to move them to using the new
scheme.

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
In the beginning there was nothing.
And the Lord said "Let There Be Light!"
And still there was nothing, but at least now you could see it.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-06-12 15:59   ` Wolfgang Denk
@ 2007-06-12 16:07     ` Jon Loeliger
  2007-06-12 16:08     ` Timur Tabi
  1 sibling, 0 replies; 11+ messages in thread
From: Jon Loeliger @ 2007-06-12 16:07 UTC (permalink / raw)
  To: u-boot

So, like, the other day Wolfgang Denk mumbled:
> In message <466EBA23.4030308@freescale.com> you wrote:
> >
> > #ifdef CONFIG_CMD_AUTOSCRIPT
> > #undef CONFIG_CMD_AUTOSCRIPT
> > #define CONFIG_CMD_AUTOSCRIPT CONFIG_CMD_AUTOSCRIPT
> > #else
> > #define CONFIG_CMD_AUTOSCRIPT 0
> > #endif
> 
> #define foo foo ??? Not that looks uterly strange to me...
> 
> > ... ( repeat for each CONFIG_CMD_x )
> 
> grrrghh....

I agree.

> > With this technique, you won't need to modify all of the source files that use
> > CONFIG_COMMANDS.
> 
> But we *do* want to modify all files to move them to using the new
> scheme.

And my follow up patch will series do it again too!

Thanks,
jdl

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-06-12 15:59   ` Wolfgang Denk
  2007-06-12 16:07     ` Jon Loeliger
@ 2007-06-12 16:08     ` Timur Tabi
  2007-06-12 16:56       ` Wolfgang Denk
  1 sibling, 1 reply; 11+ messages in thread
From: Timur Tabi @ 2007-06-12 16:08 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> In message <466EBA23.4030308@freescale.com> you wrote:
>> #ifdef CONFIG_CMD_AUTOSCRIPT
>> #undef CONFIG_CMD_AUTOSCRIPT
>> #define CONFIG_CMD_AUTOSCRIPT CONFIG_CMD_AUTOSCRIPT
>> #else
>> #define CONFIG_CMD_AUTOSCRIPT 0
>> #endif
> 
> 
> #define foo foo ??? Not that looks uterly strange to me...

Sorry, that was a typo.  I meant

#define CONFIG_CMD_AUTOSCRIPT CFG_CMD_AUTOSCRIPT

>> ... ( repeat for each CONFIG_CMD_x )
> 
> grrrghh....

It's still better than modifying dozens of source files!

> 
>> #define CONFIG_COMMANDS \
>> 	(CONFIG_CMD_AUTOSCRIPT | \
>> 	CONFIG_CMD_x (repeat for each CONFIG_CMD_x)
> 
> Did you actually test if this works?

No exactly, but I use something similar in MPC8349ITX.h.

> 
>> With this technique, you won't need to modify all of the source files that use 
>> CONFIG_COMMANDS.
> 
> But we *do* want to modify all files to move them to using the new
> scheme.

Only when we remove the old method entirely.  This is a transitional patch - it allows 
config header files to use CONFIG_CMD_xxx today, and it avoids complicated #if pragmas in 
all those source files.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-06-12 16:08     ` Timur Tabi
@ 2007-06-12 16:56       ` Wolfgang Denk
  2007-06-12 17:41         ` Timur Tabi
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Denk @ 2007-06-12 16:56 UTC (permalink / raw)
  To: u-boot

In message <466EC4FB.9070706@freescale.com> you wrote:
>
> #define CONFIG_CMD_AUTOSCRIPT CFG_CMD_AUTOSCRIPT
> 
> >> ... ( repeat for each CONFIG_CMD_x )
> > grrrghh....
> 
> It's still better than modifying dozens of source files!

No, it's worse, as it would mean that such mess sticks forever.

Let's do it once, and right, even if it's a painful operation.

> > But we *do* want to modify all files to move them to using the new
> > scheme.
> 
> Only when we remove the old method entirely.  This is a transitional patch - it allows 
> config header files to use CONFIG_CMD_xxx today, and it avoids complicated #if pragmas in 
> all those source files.

Transition will be very short here - see Jon's comment.

And the old method will be removed, soon and completely.

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
Pig: An animal (Porcus omnivorous) closely allied to the  human  race
by  the splendor and vivacity of its appetite, which, however, is in-
ferior in scope, for it balks at pig.                - Ambrose Bierce

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-06-11 23:56 [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files Jon Loeliger
  2007-06-12 15:22 ` Timur Tabi
@ 2007-06-12 17:33 ` Ben Warren
  2007-07-03 22:45 ` Wolfgang Denk
  2 siblings, 0 replies; 11+ messages in thread
From: Ben Warren @ 2007-06-12 17:33 UTC (permalink / raw)
  To: u-boot

On Mon, 2007-06-11 at 18:56 -0500, Jon Loeliger wrote:
> Wolfgang,
> 
> This series of 19 patches introduces new CONFIG_CMD_*
> names to replace the existing CFG_CMD_* and eliminates
> the need for the bit-wise command configuration scheme.
<snip>
> 
> Enjoy!
> 
> jdl
> 

Nice work Jon!  A well-thought-out step in the right direction.

regards,
Ben

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-06-12 16:56       ` Wolfgang Denk
@ 2007-06-12 17:41         ` Timur Tabi
  0 siblings, 0 replies; 11+ messages in thread
From: Timur Tabi @ 2007-06-12 17:41 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> In message <466EC4FB.9070706@freescale.com> you wrote:
>> #define CONFIG_CMD_AUTOSCRIPT CFG_CMD_AUTOSCRIPT
>>
>>>> ... ( repeat for each CONFIG_CMD_x )
>>> grrrghh....
>> It's still better than modifying dozens of source files!
> 
> No, it's worse, as it would mean that such mess sticks forever.

Once every board header file has been converted to the new method, then you can remove all 
that gunk from cmd_confdefs.h and update the .c files.  Jon's approach requires you to 
update the .c files twice - once now to add support for the new method, and again later to 
remove support for the old method.

> Let's do it once, and right, even if it's a painful operation.

I don't think "#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || 
defined(CONFIG_CMD_AUTOSCRIPT" is doing it right the first time.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-06-11 23:56 [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files Jon Loeliger
  2007-06-12 15:22 ` Timur Tabi
  2007-06-12 17:33 ` Ben Warren
@ 2007-07-03 22:45 ` Wolfgang Denk
  2007-07-05  0:59   ` Jon Loeliger
  2 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Denk @ 2007-07-03 22:45 UTC (permalink / raw)
  To: u-boot

Dear Jon,

in message <E1HxtkL-0002Be-K0@jdl.com> you wrote:
> 
> This series of 19 patches introduces new CONFIG_CMD_*
> names to replace the existing CFG_CMD_* and eliminates
> the need for the bit-wise command configuration scheme.

All 19 patches applied to u-boot-testing repository.


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
WARNING:  This Product Attracts Every Other Piece  of  Matter in  the
Universe, Including the Products of Other Manufacturers, with a Force
Proportional  to the Product of the Masses and Inversely Proportional
to the Distance Between Them.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-07-03 22:45 ` Wolfgang Denk
@ 2007-07-05  0:59   ` Jon Loeliger
  2007-07-05  1:43     ` Wolfgang Denk
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Loeliger @ 2007-07-05  0:59 UTC (permalink / raw)
  To: u-boot

So, like, the other day Wolfgang Denk mumbled:
> Dear Jon,
> 
> in message <E1HxtkL-0002Be-K0@jdl.com> you wrote:
>
> > This series of 19 patches introduces new CONFIG_CMD_*
> > names to replace the existing CFG_CMD_* and eliminates
> > the need for the bit-wise command configuration scheme.
> 
> All 19 patches applied to u-boot-testing repository.

Thanks!

Any chance we can pick these up into -testing too?

    Fix #if typo in CONFIG_CMD_* changes.
    include/configs: Use new CONFIG_CMD_* in 85xx board
    Add MPC8568MDS to 85xx target.
    mpc86xx: Remove old CFG_CMD_* references.

All posted June 13, it appears.

Thanks,
jdl

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.
  2007-07-05  0:59   ` Jon Loeliger
@ 2007-07-05  1:43     ` Wolfgang Denk
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfgang Denk @ 2007-07-05  1:43 UTC (permalink / raw)
  To: u-boot

In message <E1I6FgX-00076S-G2@jdl.com> you wrote:
>
> Any chance we can pick these up into -testing too?

Yes, chances were pretty good this night ;-)

But now I do go to bed.

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
It is surely a great calamity for  a  human  being  to  have  no  ob-
sessions.                                                - Robert Bly

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-07-05  1:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-11 23:56 [U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files Jon Loeliger
2007-06-12 15:22 ` Timur Tabi
2007-06-12 15:59   ` Wolfgang Denk
2007-06-12 16:07     ` Jon Loeliger
2007-06-12 16:08     ` Timur Tabi
2007-06-12 16:56       ` Wolfgang Denk
2007-06-12 17:41         ` Timur Tabi
2007-06-12 17:33 ` Ben Warren
2007-07-03 22:45 ` Wolfgang Denk
2007-07-05  0:59   ` Jon Loeliger
2007-07-05  1:43     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox