Introduce initial versions of new Command Config files.
cover 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
cover Introduce initial versions of new Command Config files.
Quoted 6 lines · Jon Loeliger
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.
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale
cover Introduce initial versions of new Command Config files.
Quoted 7 lines · In message <[email protected]> you wrote:
#ifdef
CONFIG_CMD_AUTOSCRIPT
#undefCONFIG_CMD_AUTOSCRIPT
#defineCONFIG_CMD_AUTOSCRIPTCONFIG_CMD_AUTOSCRIPT#else
#defineCONFIG_CMD_AUTOSCRIPT0
#endif
#define foo foo ??? Not that looks uterly strange to me...
Quoted 1 line
... ( repeat for each
CONFIG_CMD_x)
grrrghh....
Quoted 3 lines
#define CONFIG_COMMANDS \ (CONFIG_CMD_AUTOSCRIPT | \ CONFIG_CMD_x (repeat for each CONFIG_CMD_x)
Did you actually test if this works?
Quoted 2 lines
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
Signature · 6 lines
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.
cover Introduce initial versions of new Command Config files.
So, like, the other day Wolfgang Denk mumbled:
Quoted 9 lines
Quoted 7 lines · In message <[email protected]> you wrote:
#ifdef
CONFIG_CMD_AUTOSCRIPT
#undefCONFIG_CMD_AUTOSCRIPT
#defineCONFIG_CMD_AUTOSCRIPTCONFIG_CMD_AUTOSCRIPT#else
#defineCONFIG_CMD_AUTOSCRIPT0
#endif
Quoted 5 lines
#define foo foo ??? Not that looks uterly strange to me...
Quoted 1 line
... ( repeat for each
CONFIG_CMD_x)grrrghh....
I agree.
Quoted 5 lines
Quoted 2 lines
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
cover Introduce initial versions of new Command Config files.
In reply to Wolfgang DenkQuoted 10 lines · Wolfgang Denk
Quoted 6 lines · In message <[email protected]> you wrote:
#ifdef
CONFIG_CMD_AUTOSCRIPT
#undefCONFIG_CMD_AUTOSCRIPT
#defineCONFIG_CMD_AUTOSCRIPTCONFIG_CMD_AUTOSCRIPT#else
#defineCONFIG_CMD_AUTOSCRIPT0
#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
Quoted 3 lines
Quoted 1 line
... ( repeat for each
CONFIG_CMD_x)grrrghh....
It's still better than modifying dozens of source files!
Quoted 6 lines
Quoted 4 lines
#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.
Quoted 6 lines
Quoted 3 lines
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.
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale
cover Introduce initial versions of new Command Config files.
Quoted 7 lines · In message <[email protected]> you wrote:
#define
CONFIG_CMD_AUTOSCRIPTCFG_CMD_AUTOSCRIPTQuoted 2 lines
Quoted 1 line
... ( 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.
Quoted 6 lines
Quoted 2 lines
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_xxxtoday, 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
Signature · 6 lines
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
cover Introduce initial versions of new Command Config files.
In reply to Jon LoeligerQuoted 5 lines · Jon Loeliger
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>
Quoted 5 lines
Enjoy!
jdl
Nice work Jon! A well-thought-out step in the right direction.
regards,
Ben
cover Introduce initial versions of new Command Config files.
In reply to Wolfgang DenkQuoted 8 lines · Wolfgang Denk
Quoted 5 lines · In message <[email protected]> you wrote:
#define
CONFIG_CMD_AUTOSCRIPTCFG_CMD_AUTOSCRIPTQuoted 2 lines
Quoted 1 line
... ( 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.
Quoted 1 line
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.
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale
cover Introduce initial versions of new Command Config files.
In reply to Jon LoeligerDear Jon,
Quoted 4 lines · in message <[email protected]> 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
Signature · 7 lines
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.
cover Introduce initial versions of new Command Config files.
So, like, the other day Wolfgang Denk mumbled:
Quoted 9 lines
Dear Jon,
Quoted 3 lines · in message <[email protected]> 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
cover Introduce initial versions of new Command Config files.
Quoted 2 lines · In message <[email protected]> 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
Signature · 5 lines
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