[U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.

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

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.

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

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

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.

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

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.

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

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

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

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
participants (4)
-
Ben Warren
-
Jon Loeliger
-
Timur Tabi
-
Wolfgang Denk