[U-Boot] [Announce][RFC] CFG_ macro renaming

Hi,
As announce during OLS conference, it's plain to use kconfig to manage board configuration.
For this purpose and Makefile conditional compile we're move CFG_ macro to new CONFIG_ marco
For memory
There are two classes of configuration variables:
* Configuration _OPTIONS_: These are selectable by the user and have names beginning with "CONFIG_".
* Configuration _SETTINGS_: These depend on the hardware etc. and should not be meddled with if you don't know what you're doing; they have names beginning with "CFG_".
to keep CFG_ meaning we will rename them in the following change
1) Basic config
For environment we will use CONFIG_ENV_ (will be done this merge windows)
For configuration settings CONFIG_SYS_
additional proposition
2) Extra config
For memory settings CONFIG_MEM_ or CONFIG_SYS_MEM_
For PCI settings CONFIG_PCI_ or CONFIG_SYS_PCI_
For USB settings CONFIG_USE or CONFIG_SYS_PCI_
For flash settings CONFIG_FLASH or CONFIG_SYS_FLASH_
For nand settins CONFIG_NAND or CONFIG_SYS_NAND_
For dtt settgins CONFIG_DTT or CONFIG_SYS_DTT
etc...
Comments are welcome.
The move to new style will be done for the beggining of the next merge window
Best Regards, J.

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20080901235624.GC316@game.jcrosoft.org you wrote:
As announce during OLS conference, it's plain to
s/plain/planned/
Configuration _OPTIONS_: These are selectable by the user and have names beginning with "CONFIG_".
Configuration _SETTINGS_: These depend on the hardware etc. and should not be meddled with if you don't know what you're doing; they have names beginning with "CFG_".
to keep CFG_ meaning we will rename them in the following change
- Basic config
For environment we will use CONFIG_ENV_ (will be done this merge windows)
i. e. s/CFG_ENV_/CONFIG_ENV_/g
For configuration settings CONFIG_SYS_
For *other* configuration settings we will use CONFIG_SYS_, i. e. s/CFG_/CONFIG_SYS_g.
- Extra config
For memory settings CONFIG_MEM_ or CONFIG_SYS_MEM_
For PCI settings CONFIG_PCI_ or CONFIG_SYS_PCI_
For USB settings CONFIG_USE or CONFIG_SYS_PCI_
For flash settings CONFIG_FLASH or CONFIG_SYS_FLASH_
For nand settins CONFIG_NAND or CONFIG_SYS_NAND_
For dtt settgins CONFIG_DTT or CONFIG_SYS_DTT
etc...
Please do not do that, as it will interfere with a lot of already existing definitions. Stick with CONFIG_SYS_ in general. There may be some cases where your suggestion makes sense, but these need to be carefully hand-selected, i. e. this must not be done by some automatically running script.
Best regards,
Wolfgang Denk

- Extra config
For memory settings CONFIG_MEM_ or CONFIG_SYS_MEM_
For PCI settings CONFIG_PCI_ or CONFIG_SYS_PCI_
For USB settings CONFIG_USE or CONFIG_SYS_PCI_
For flash settings CONFIG_FLASH or CONFIG_SYS_FLASH_
For nand settins CONFIG_NAND or CONFIG_SYS_NAND_
For dtt settgins CONFIG_DTT or CONFIG_SYS_DTT
etc...
Please do not do that, as it will interfere with a lot of already existing definitions. Stick with CONFIG_SYS_ in general. There may be some cases where your suggestion makes sense, but these need to be carefully hand-selected, i. e. this must not be done by some automatically running script.
As you point this part was plain to be done manually.
Best Regards, J.

Hi Jean-Christophe, Hi Wolfgang,
Can you create a "deprecated_cfg.h" file that contains directives like:
#ifdef CFG_OLD_PARAMATER #error "CFG_OLD_PARAMETER renamed! Use CONIFIG_NEW_PARAMETER instead!" #endif
for each CFG_* renamed directive?
This should avoid to "lost" some configuration parameters during this transitory.phase. this file should be included by common.h for example.
my2cents
best regards,
luigi
Il martedì 02 settembre 2008 02:59:58 Jean-Christophe PLAGNIOL-VILLARD ha scritto:
- Extra config
For memory settings CONFIG_MEM_ or CONFIG_SYS_MEM_
For PCI settings CONFIG_PCI_ or CONFIG_SYS_PCI_
For USB settings CONFIG_USE or CONFIG_SYS_PCI_
For flash settings CONFIG_FLASH or CONFIG_SYS_FLASH_
For nand settins CONFIG_NAND or CONFIG_SYS_NAND_
For dtt settgins CONFIG_DTT or CONFIG_SYS_DTT
etc...
Please do not do that, as it will interfere with a lot of already existing definitions. Stick with CONFIG_SYS_ in general. There may be some cases where your suggestion makes sense, but these need to be carefully hand-selected, i. e. this must not be done by some automatically running script.
As you point this part was plain to be done manually.
Best Regards, J. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

On 23:38 Sat 13 Sep , Luigi 'Comio' Mantellini wrote:
Hi Jean-Christophe, Hi Wolfgang,
Can you create a "deprecated_cfg.h" file that contains directives like:
#ifdef CFG_OLD_PARAMATER #error "CFG_OLD_PARAMETER renamed! Use CONIFIG_NEW_PARAMETER instead!" #endif
for each CFG_* renamed directive?
This should avoid to "lost" some configuration parameters during this transitory.phase. this file should be included by common.h for example.
IMHO, I do not think it's needed due to there is no "lost" possible with this kind of script
git-grep CFG_ | cut -d: -f1 | grep -v -e "CHANGELOG*" | xargs sed -i -e "s:CFG_:CONFIG_SYS_:g"
Best Regards, J.

Hi J.
see inline comments. Il sabato 13 settembre 2008 23:41:55 Jean-Christophe PLAGNIOL-VILLARD ha scritto:
On 23:38 Sat 13 Sep , Luigi 'Comio' Mantellini wrote:
Hi Jean-Christophe, Hi Wolfgang,
Can you create a "deprecated_cfg.h" file that contains directives like:
#ifdef CFG_OLD_PARAMATER #error "CFG_OLD_PARAMETER renamed! Use CONIFIG_NEW_PARAMETER instead!" #endif
for each CFG_* renamed directive?
This should avoid to "lost" some configuration parameters during this transitory.phase. this file should be included by common.h for example.
IMHO, I do not think it's needed due to there is no "lost" possible with this kind of script
git-grep CFG_ | cut -d: -f1 | grep -v -e "CHANGELOG*" | xargs sed -i -e "s:CFG_:CONFIG_SYS_:g"
This doesn't apply on CFG_ENV_IS_* / CONFIG_ENV_IS_* macros (for example). and I should use this grep/sed only at the end of the macro renaming. I'm speaking about the transitory time.
Best regards,
luigi
Best Regards, J.

This should avoid to "lost" some configuration parameters during this
transitory.phase. this file should be included by common.h for
example.
IMHO, I do not think it's needed due to there is no "lost" possible with
this kind of script
git-grep CFG_ | cut -d: -f1 | grep -v -e "CHANGELOG*" | xargs sed -i -e
"s:CFG_:CONFIG_SYS_:g"
This doesn't apply on CFG_ENV_IS_* / CONFIG_ENV_IS_* macros (for example). and
I should use this grep/sed only at the end of the macro renaming. I'm speaking about the transitory time.
The CFG_ENV_ is already renammed into CONFIG_ENV_ and applied in Wolfgang's tree.
Best Regards, J.

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20080913214155.GA32194@game.jcrosoft.org you wrote:
Can you create a "deprecated_cfg.h" file that contains directives like:
#ifdef CFG_OLD_PARAMATER #error "CFG_OLD_PARAMETER renamed! Use CONIFIG_NEW_PARAMETER instead!" #endif
for each CFG_* renamed directive?
I think this is a good idea.
This should avoid to "lost" some configuration parameters during this transitory.phase. this file should be included by common.h for example.
IMHO, I do not think it's needed due to there is no "lost" possible with this kind of script
git-grep CFG_ | cut -d: -f1 | grep -v -e "CHANGELOG*" | xargs sed -i -e "s:CFG_:CONFIG_SYS_:g"
It may not be needed for code in mainline, but it is a simple and efficient way to catch mistakes when someone submits new code that has been smoldering for some while in some private repository.
It protects against errors, and it doesn't hurt...
Best regards,
Wolfgang Denk

On Tue, Sep 02, 2008 at 01:56:24AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
For USB settings CONFIG_USE or CONFIG_SYS_PCI_
Huh?
I guess you meant s/USE/USB/ and s/PCI/USB/ ?
Best regards Markus
participants (4)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Luigi 'Comio' Mantellini
-
Markus Klotzbücher
-
Wolfgang Denk