[U-Boot] [Patch] Disable/Enable Flat I²C Commands

Since CONFIG_I2C_CMD_TREE are defined, the old flat i2c commands are still present. This patch disables the old flat command by default, if CONFIG_I2C_CMD_TREE is defined. The new option CONFIG_I2C_CMD_FLAT makes it possible to use the flat commands in addition of tree commands.
Signed-off-by: Jens Scharsig esw@bus-elektronik.de ---
diff --git a/README b/README index 86c1304..3ad6d34 100644 --- a/README +++ b/README @@ -1306,6 +1306,9 @@ The following options need to be configured: older 'imm', 'imd', 'iprobe' etc. commands are considered deprecated and may disappear in the future.
+ CONFIG_I2C_CMD_FLAT enable the old flat i2c commands like + 'imm', 'imd', 'iprobe' etc. if CONFIG_I2C_CMD_TREE is defined. + CONFIG_HARD_I2C selects a hardware I2C controller.
CONFIG_SOFT_I2C configures u-boot to use a software (aka diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 16439ac..5fec13c 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -1324,6 +1324,7 @@ U_BOOT_CMD( #endif ); #endif /* CONFIG_I2C_CMD_TREE */ +#if (defined(CONFIG_I2C_CMD_FLAT) || !defined(CONFIG_I2C_CMD_TREE)) U_BOOT_CMD( imd, 4, 1, do_i2c_md, \ "i2c memory display", \ @@ -1369,6 +1370,7 @@ U_BOOT_CMD( "chip address[.0, .1, .2] [# of objects]\n" " - loop, reading a set of addresses\n" ); +#endif /* CONFIG_I2C_CMD_FLAT/TREE */
#if defined(CONFIG_CMD_SDRAM) U_BOOT_CMD(

Jens Scharsig wrote:
Since CONFIG_I2C_CMD_TREE are defined, the old flat i2c commands are still present. This patch disables the old flat command by default, if CONFIG_I2C_CMD_TREE is defined. The new option CONFIG_I2C_CMD_FLAT makes it possible to use the flat commands in addition of tree commands.
Controversial, maybe, but why not just get rid of the flat commands? When I introduced the tree probably a couple of years ago, we said it would deprecate the flat commands and that they'd go away in a couple of releases. <snip>
regards, Ben

On Thu, 2009-01-29 at 10:16 -0800, Ben Warren wrote:
Jens Scharsig wrote:
Since CONFIG_I2C_CMD_TREE are defined, the old flat i2c commands are still present. This patch disables the old flat command by default, if CONFIG_I2C_CMD_TREE is defined. The new option CONFIG_I2C_CMD_FLAT makes it possible to use the flat commands in addition of tree commands.
Controversial, maybe, but why not just get rid of the flat commands? When I introduced the tree probably a couple of years ago, we said it would deprecate the flat commands and that they'd go away in a couple of releases.
<snip>
We discussed this a few months ago as well and came to the same conclusion as Ben.
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/47755 http://article.gmane.org/gmane.comp.boot-loaders.u-boot/48429
Best, Peter

Dear Ben Warren,
In message 4981F273.2030900@gmail.com you wrote:
Controversial, maybe, but why not just get rid of the flat commands? When I introduced the tree probably a couple of years ago, we said it would deprecate the flat commands and that they'd go away in a couple of releases.
We should at least announce such a feature removal, and declare a deadline in public.
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
Dear Ben Warren,
In message 4981F273.2030900@gmail.com you wrote:
Controversial, maybe, but why not just get rid of the flat commands? When I introduced the tree probably a couple of years ago, we said it would deprecate the flat commands and that they'd go away in a couple of releases.
We should at least announce such a feature removal, and declare a deadline in public.
Best regards,
Wolfgang Denk
From README:
CONFIG_I2C_CMD_TREE is a recommended option that places all I2C commands under a single 'i2c' root command. The older 'imm', 'imd', 'iprobe' etc. commands are considered deprecated and may disappear in the future.
I guess this isn't explicit enough. Let's say it gets removed in the release after v2009.03.
regards, Ben

Dear Ben Warren,
In message 498203BD.3000500@gmail.com you wrote:
From README:
CONFIG_I2C_CMD_TREE is a recommended option that places all I2C commands under a single 'i2c' root command. The older 'imm', 'imd', 'iprobe' etc. commands are considered deprecated and may disappear in the future.
I guess this isn't explicit enough. Let's say it gets removed in the release after v2009.03.
Indeed. We should add it to doc/feature_removal.txt and the wiki page.
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Thu, 2009-01-29 at 21:37 +0100, Wolfgang Denk wrote:
Dear Ben Warren,
In message 498203BD.3000500@gmail.com you wrote:
From README:
CONFIG_I2C_CMD_TREE is a recommended option that places all I2C commands under a single 'i2c' root command. The older 'imm', 'imd', 'iprobe' etc. commands are considered deprecated and may disappear in the future.
I guess this isn't explicit enough. Let's say it gets removed in the release after v2009.03.
Indeed. We should add it to doc/feature_removal.txt and the wiki page.
Its actually already on the wiki page.
http://www.denx.de/wiki/U-Boot/TaskFeatureRemovalSchedule
I submitted the following patch to add it a new doc/feature-removal-schedule.txt with a similar timeframe:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/48429
It seems like it would be a good idea to add the doc/feature_removal.txt. Did the above mentioned patch slip through the cracks or do you prefer to only use the wiki for feature removals?
Best, Peter

Peter Tyser wrote:
Hi Wolfgang,
On Thu, 2009-01-29 at 21:37 +0100, Wolfgang Denk wrote:
Dear Ben Warren,
In message 498203BD.3000500@gmail.com you wrote:
From README:
CONFIG_I2C_CMD_TREE is a recommended option that places all I2C commands under a single 'i2c' root command. The older 'imm', 'imd', 'iprobe' etc. commands are considered deprecated and may disappear in the future.
I guess this isn't explicit enough. Let's say it gets removed in the release after v2009.03.
Indeed. We should add it to doc/feature_removal.txt and the wiki page.
Its actually already on the wiki page.
http://www.denx.de/wiki/U-Boot/TaskFeatureRemovalSchedule
I submitted the following patch to add it a new doc/feature-removal-schedule.txt with a similar timeframe:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/48429
It seems like it would be a good idea to add the doc/feature_removal.txt. Did the above mentioned patch slip through the cracks or do you prefer to only use the wiki for feature removals?
This is perfect. The patches without an obvious custodian sometimes take a bit longer to find a home, I guess. Anway, full ACK from me.
Best, Peter
regards, Ben

Dear Peter Tyser,
In message 1233262578.19784.19.camel@localhost.localdomain you wrote:
Its actually already on the wiki page.
Ah, good. Sometimes I'm better than I think myself ;-)
I submitted the following patch to add it a new doc/feature-removal-schedule.txt with a similar timeframe:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/48429
Hm...
It seems like it would be a good idea to add the doc/feature_removal.txt. Did the above mentioned patch slip through the cracks or do you prefer to only use the wiki for feature removals?
Must have slipped through. Can you please repost so have it here in current context?nks.
Best regards,
Wolfgang Denk

On Thu, 2009-01-29 at 22:15 +0100, Wolfgang Denk wrote:
Dear Peter Tyser,
In message 1233262578.19784.19.camel@localhost.localdomain you wrote:
Its actually already on the wiki page.
Ah, good. Sometimes I'm better than I think myself ;-)
I submitted the following patch to add it a new doc/feature-removal-schedule.txt with a similar timeframe:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/48429
Hm...
It seems like it would be a good idea to add the doc/feature_removal.txt. Did the above mentioned patch slip through the cracks or do you prefer to only use the wiki for feature removals?
Must have slipped through. Can you please repost so have it here in current context?nks.
Sure, will do shortly. I'll add the autoscr and legacy NAND deprecation/removal while I'm at it.
Best, Peter

Wolfgang Denk wrote:
Dear Ben Warren,
In message 498203BD.3000500@gmail.com you wrote:
From README:
CONFIG_I2C_CMD_TREE is a recommended option that places all I2C commands under a single 'i2c' root command. The older 'imm', 'imd', 'iprobe' etc. commands are considered deprecated and may disappear in the future.
I guess this isn't explicit enough. Let's say it gets removed in the release after v2009.03.
Indeed. We should add it to doc/feature_removal.txt and the wiki page.
OK. I'l make it so.
Best regards,
Wolfgang Denk

Dear Jens Scharsig,
In message gls4tp$bib$1@ger.gmane.org you wrote:
Since CONFIG_I2C_CMD_TREE are defined, the old flat i2c commands are still present. This patch disables the old flat command by default, if CONFIG_I2C_CMD_TREE is defined. The new option CONFIG_I2C_CMD_FLAT makes it possible to use the flat commands in addition of tree commands.
I don't like that this changes the behavious of many boards without having the go form the board maintainers, actually without even noticing them in advance.
Please either add the needed CONFIG_I2C_CMD_FLAT to all affected boards so the current behaviour remains the same, or make it such that it gets activated only for new boards.
Best regards,
Wolfgang Denk

Dear Wolfgang Denk,
Please either add the needed CONFIG_I2C_CMD_FLAT to all affected boards so the current behaviour remains the same, or make it such that it gets activated only for new boards.
i will invert the logic of the patch and post it as version 2. The new patch disables flat commands if CONFIG_I2C_CMD_NO_FLAT defined.
Best regards,
Jens Scharsig
participants (4)
-
Ben Warren
-
Jens Scharsig
-
Peter Tyser
-
Wolfgang Denk