* [U-Boot-Users] [PATCH][RFC] disable flat i2c commands when CONFIG_I2C_CMD_TREE defined
@ 2007-03-02 16:59 Matthias Fuchs
2007-03-02 17:41 ` Ben Warren
0 siblings, 1 reply; 2+ messages in thread
From: Matthias Fuchs @ 2007-03-02 16:59 UTC (permalink / raw)
To: u-boot
Hi,
I noticed that when using CONFIG_I2C_CMD_TREE to enable
the 'i2c' command with its sub commands, I also get the flat
i2c commands (imm, iprobe, ...) compiled into u-boot.
I think this is more than I need and want.
Does anything speak against disabling the flat i2c commands
when CONFIG_I2C_CMD_TREE is defined?
This is how I've done it (please skip the SPD stuff).
Matthias
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 45cfde2..59a4276 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -701,6 +701,7 @@ int do_sdram ( cmd_tbl_t *cmdtp, int fl
switch(data[2]) {
case 2: puts ("EDO\n"); break;
case 4: puts ("SDRAM\n"); break;
+ case 8: puts ("DDR2\n"); break;
default: puts ("unknown\n"); break;
}
puts ("Row address bits ");
@@ -722,6 +723,7 @@ int do_sdram ( cmd_tbl_t *cmdtp, int fl
case 2: puts ("HSTL 1.5\n"); break;
case 3: puts ("SSTL 3.3\n"); break;
case 4: puts ("SSTL 2.5\n"); break;
+ case 5: puts ("SSTL 1.8\n"); break;
default: puts ("unknown\n"); break;
}
printf("SDRAM cycle time %d.%d nS\n",
@@ -948,6 +950,7 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag,
/***************************************************/
+#if !defined(CONFIG_I2C_CMD_TREE)
U_BOOT_CMD(
imd, 4, 1, do_i2c_md, \
"imd - i2c memory display\n", \
@@ -1002,8 +1005,7 @@ U_BOOT_CMD(
" (valid chip values 50..57)\n"
);
#endif
-
-#if defined(CONFIG_I2C_CMD_TREE)
+#else /* CONFIG_I2C_CMD_TREE */
U_BOOT_CMD(
i2c, 6, 1, do_i2c,
"i2c - I2C sub-system\n",
--
-----------------------------------------------------------------------
Dipl.-Ing. Matthias Fuchs esd electronic system design gmbh
http://www.esd-electronics.com Vahrenwalder Str. 207
phone: +49-511-37298-0, fax: -68 30165 Hannover, Germany
-----------------------------------------------------------------------
^ permalink raw reply related [flat|nested] 2+ messages in thread* [U-Boot-Users] [PATCH][RFC] disable flat i2c commands when CONFIG_I2C_CMD_TREE defined
2007-03-02 16:59 [U-Boot-Users] [PATCH][RFC] disable flat i2c commands when CONFIG_I2C_CMD_TREE defined Matthias Fuchs
@ 2007-03-02 17:41 ` Ben Warren
0 siblings, 0 replies; 2+ messages in thread
From: Ben Warren @ 2007-03-02 17:41 UTC (permalink / raw)
To: u-boot
Matthias,
On Fri, 2007-03-02 at 17:59 +0100, Matthias Fuchs wrote:
> Hi,
>
> I noticed that when using CONFIG_I2C_CMD_TREE to enable
> the 'i2c' command with its sub commands, I also get the flat
> i2c commands (imm, iprobe, ...) compiled into u-boot.
>
> I think this is more than I need and want.
>
> Does anything speak against disabling the flat i2c commands
> when CONFIG_I2C_CMD_TREE is defined?
>
> This is how I've done it (please skip the SPD stuff).
>
> Matthias
Looks good. I can't think of a use case where both command formats
would be useful, but maybe others can.
Please flip the order so it's
#if defined(CONFIG_I2C_CMD_TREE)
U_BOOT_CMD(
i2c, 6, 1, do_i2c,
...
#else
U_BOOT_CMD(
imd, 4, 1, do_i2c_md, \
...
#endif
and submit as a proper patch.
regards,
Ben
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-02 17:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-02 16:59 [U-Boot-Users] [PATCH][RFC] disable flat i2c commands when CONFIG_I2C_CMD_TREE defined Matthias Fuchs
2007-03-02 17:41 ` Ben Warren
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.