Remove individual I2C commands and cleanup
Subsystems (2)
cover Remove individual I2C commands and cleanup
This patch series removes the "individual" I2C commands (and the CONFIG_I2C_CMD_TREE define) and migrates all boards to the newer "tree style" I2C commands.
A small amount of cleanup was performed before and after removing the individual commands.
Peter Tyser (7):
cm5200: Make function test command names more unique
cmd_i2c: Create common default i2c_[set|get]_bus_speed() functions
cmd_i2c: Remove deprecated individual i2c commands
cmd_i2c: Update references to individual i2c commands
cmd_i2c: Clean up i2c command argument parsing
cmd_i2c: Clean up trivial helper functions
cmd_i2c: Fix i2c help command output when CONFIG_I2C_MUX
README | 20 +---- board/cm5200/cmd_cm5200.c | 18 ++-- board/esd/tasreg/tasreg.c | 4 +- common/cmd_i2c.c | 176 +++++++++++++------------------------- cpu/arm920t/at91rm9200/i2c.c | 10 -- cpu/mpc512x/i2c.c | 14 --- cpu/mpc8260/i2c.c | 13 --- cpu/ppc4xx/i2c.c | 14 --- doc/README.ebony | 20 ++-- doc/README.m52277evb | 8 +-- doc/README.m5373evb | 8 +-- doc/README.m54455evb | 8 +-- doc/README.m5475evb | 8 +-- doc/README.ppc440 | 4 +- doc/README.xpedite1k | 6 +- doc/feature-removal-schedule.txt | 12 --- drivers/i2c/soft_i2c.c | 14 --- drivers/i2c/tsi108_i2c.c | 2 +- include/configs/DU405.h | 1 - include/configs/DU440.h | 1 - include/configs/MPC8313ERDB.h | 1 - include/configs/MPC8349EMDS.h | 1 - include/configs/MPC8349ITX.h | 1 - include/configs/MPC8360ERDK.h | 1 - include/configs/MPC8536DS.h | 1 - include/configs/MPC8568MDS.h | 1 - include/configs/MPC8569MDS.h | 1 - include/configs/MPC8572DS.h | 1 - include/configs/MVBLM7.h | 1 - include/configs/PMC440.h | 1 - include/configs/SIMPC8313.h | 1 - include/configs/XPEDITE5200.h | 1 - include/configs/XPEDITE5370.h | 1 - include/configs/ads5121.h | 1 - include/configs/at91rm9200ek.h | 1 - include/configs/bubinga.h | 2 +- include/configs/katmai.h | 1 - include/configs/keymile-common.h | 1 - include/configs/kmeter1.h | 1 - include/configs/korat.h | 1 - include/configs/sacsng.h | 6 +- include/configs/sbc8349.h | 1 - include/configs/socrates.h | 1 - include/configs/taihu.h | 2 +- 44 files changed, 99 insertions(+), 293 deletions(-)
PATCH 1/7 cm5200: Make function test command names more unique
Add "_test" to cm5200's function test command names to prevent overlap with common, global function names. Originally, the "do_i2c" function test command interfered with common/cmd_i2c.c's "do_i2c" when CONFIG_I2C_CMD_TREE was defined.
The functions were also made static as they are not globally accessed.
--- board/cm5200/cmd_cm5200.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)
board/cm5200/cmd_cm5200.c +9 -9
@@ -29,7 +29,7 @@#ifdef CONFIG_CMD_BSP -int do_i2c (char *argv[]) +static int do_i2c_test (char *argv[]) {unsigned char temp, temp1;
@@ -57,7 +57,7 @@ int do_i2c(char *argv[])return 0 ; } -int do_usbtest (char *argv[]) +static int do_usb_test (char *argv[]) {int i;static int usb_stor_curr_dev =-1 ;/* current device */
@@ -90,7 +90,7 @@ int do_usbtest(char *argv[])return 0 ; } -int do_led (char *argv[]) +static int do_led_test (char *argv[]) {int i =0 ;struct mpc5xxx_gpt_0_7 *gpt = (struct mpc5xxx_gpt_0_7 *)MPC5XXX_GPT ;
@@ -134,7 +134,7 @@ int do_led(char *argv[])return 0 ; } -int do_rs232 (char *argv[]) +static int do_rs232_test (char *argv[]) {int error_status =0 ;struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO ;
@@ -397,22 +397,22 @@ int do_rs232(char *argv[])return error_status; } -int cmd_fkt (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) +static int cmd_fkt (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) {int rcode =-1 ;switch (argc) {case 2 :if (strncmp (argv[1 ],"i2c" ,3 ) ==0 ) - rcode =do_i2c (argv); + rcode =do_i2c_test (argv);else if (strncmp (argv[1 ],"led" ,3 ) ==0 ) - rcode =do_led (argv); + rcode =do_led_test (argv);else if (strncmp (argv[1 ],"usb" ,3 ) ==0 ) - rcode =do_usbtest (argv); + rcode =do_usb_test (argv);break ;case 3 :if (strncmp (argv[1 ],"rs232" ,3 ) ==0 ) - rcode =do_rs232 (argv); + rcode =do_rs232_test (argv);break ; }
Signature · 1 line
1.6.2.1
PATCH 2/7 i2c: Create common default i2c_[set|get]_bus_speed() functions
In reply to Peter TyserNew default, weak i2c_get_bus_speed() and i2c_set_bus_speed() functions replace a number of architecture-specific implementations.
Also, providing default functions will allow all boards to enable CONFIG_I2C_CMD_TREE. This was previously not possible since the tree-form of the i2c command provides the ability to display and modify the i2c bus speed which requires i2c_[set|get]_bus_speed() to be present.
--- common/cmd_i2c.c | 18 ++++++++++++++++++ cpu/arm920t/at91rm9200/i2c.c | 10 ---------- cpu/mpc512x/i2c.c | 14 -------------- cpu/mpc8260/i2c.c | 13 ------------- cpu/ppc4xx/i2c.c | 14 -------------- drivers/i2c/soft_i2c.c | 14 -------------- 6 files changed, 18 insertions(+), 65 deletions(-)
common/cmd_i2c.c +18 -0
@@ -138,6 +138,24 @@ DECLARE_GLOBAL_DATA_PTR;static int mod_i2c_mem (cmd_tbl_t *cmdtp,int incrflag,int flag,int argc,char *argv[]); +/* TODO: Implement architecture-specific get/set functions */ +unsigned int __def_i2c_get_bus_speed (void ) +{ +return CONFIG_SYS_I2C_SPEED ; +} +unsigned int i2c_get_bus_speed (void ) + __attribute((weak,alias ("__def_i2c_get_bus_speed" ))); + +int __def_i2c_set_bus_speed (unsigned int speed) +{ +if (speed !=CONFIG_SYS_I2C_SPEED ) +return -1 ; + +return 0 ; +} +int i2c_set_bus_speed (unsigned int ) + __attribute((weak,alias ("__def_i2c_set_bus_speed" ))); +/* * Syntax: * imd {i2c_chip} {addr}{.0, .1, .2} {len}
cpu/arm920t/at91rm9200/i2c.c +0 -10
@@ -189,14 +189,4 @@ i2c_init(int speed, int slaveaddr) return; } -int i2c_set_bus_speed (unsigned int speed) -{ -return -1 ; -} - -unsigned int i2c_get_bus_speed (void ) -{ -return CONFIG_SYS_I2C_SPEED ; -} -#endif /* CONFIG_HARD_I2C */
cpu/mpc512x/i2c.c +0 -14
@@ -397,18 +397,4 @@ unsigned int i2c_get_bus_num (void) return bus_num; } -/* TODO */ -unsigned int i2c_get_bus_speed (void ) -{ -return -1 ; -} - -int i2c_set_bus_speed (unsigned int speed) -{ -if (speed !=CONFIG_SYS_I2C_SPEED ) -return -1 ; - -return 0 ; -} -#endif /* CONFIG_HARD_I2C */
cpu/mpc8260/i2c.c +0 -13
@@ -783,19 +783,6 @@ int i2c_set_bus_num(unsigned int bus)#endif return 0 ; } -/* TODO: add 100/400k switching */ -unsigned int i2c_get_bus_speed (void ) -{ -return CONFIG_SYS_I2C_SPEED ; -} - -int i2c_set_bus_speed (unsigned int speed) -{ -if (speed !=CONFIG_SYS_I2C_SPEED ) -return -1 ; - -return 0 ; -}#endif /* CONFIG_I2C_MULTI_BUS */ #endif /* CONFIG_HARD_I2C */
cpu/ppc4xx/i2c.c +0 -14
@@ -438,18 +438,4 @@ int i2c_set_bus_num(unsigned int bus)return 0 ; }#endif /* CONFIG_I2C_MULTI_BUS */ - -/* TODO: add 100/400k switching */ -unsigned int i2c_get_bus_speed (void ) -{ -return CONFIG_SYS_I2C_SPEED ; -} - -int i2c_set_bus_speed (unsigned int speed) -{ -if (speed !=CONFIG_SYS_I2C_SPEED ) -return -1 ; - -return 0 ; -}#endif /* CONFIG_HARD_I2C */
drivers/i2c/soft_i2c.c +0 -14
@@ -244,20 +244,6 @@ int i2c_set_bus_num(unsigned int bus) }#endif -/* TODO: add 100/400k switching */ -unsigned int i2c_get_bus_speed (void ) -{ -return CONFIG_SYS_I2C_SPEED ; -} - -int i2c_set_bus_speed (unsigned int speed) -{ -if (speed !=CONFIG_SYS_I2C_SPEED ) -return -1 ; - -return 0 ; -} -/*----------------------------------------------------------------------- * if ack == I2C_ACK, ACK the byte so can continue reading, else * send I2C_NOACK to end the read.
Signature · 1 line
1.6.2.1
PATCH 3/7 i2c: Remove deprecated individual i2c commands
In reply to Peter TyserThe following individual I2C commands have been removed: imd, imm, inm, imw, icrc32, iprobe, iloop, isdram.
The functionality of the individual commands is still available via the 'i2c' command.
This change only has an impact on those boards which did not have CONFIG_I2C_CMD_TREE defined.
--- README | 5 --- common/cmd_i2c.c | 58 -------------------------------------- doc/feature-removal-schedule.txt | 12 -------- include/configs/DU405.h | 1 - include/configs/DU440.h | 1 - include/configs/MPC8313ERDB.h | 1 - include/configs/MPC8349EMDS.h | 1 - include/configs/MPC8349ITX.h | 1 - include/configs/MPC8360ERDK.h | 1 - include/configs/MPC8536DS.h | 1 - include/configs/MPC8568MDS.h | 1 - include/configs/MPC8569MDS.h | 1 - include/configs/MPC8572DS.h | 1 - include/configs/MVBLM7.h | 1 - include/configs/PMC440.h | 1 - include/configs/SIMPC8313.h | 1 - include/configs/XPEDITE5200.h | 1 - include/configs/XPEDITE5370.h | 1 - include/configs/ads5121.h | 1 - include/configs/at91rm9200ek.h | 1 - include/configs/katmai.h | 1 - include/configs/keymile-common.h | 1 - include/configs/kmeter1.h | 1 - include/configs/korat.h | 1 - include/configs/sbc8349.h | 1 - include/configs/socrates.h | 1 - 26 files changed, 0 insertions(+), 98 deletions(-)
README +0 -5
@@ -1315,11 +1315,6 @@ The following options need to be configured: clock chips. See common/cmd_i2c.c for a description of the command line interface. - 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. - CONFIG_HARD_I2C selects a hardware I2C controller. CONFIG_SOFT_I2C configures u-boot to use a software (aka
common/cmd_i2c.c +0 -58
79 lines not on this page · raw message
doc/feature-removal-schedule.txt +0 -12
@@ -40,18 +40,6 @@ Who: Wolfgang Denk <[email protected]> and board maintainers --------------------------- -What: Individual I2C commands -When: April 2009 -Why: Per the U-Boot README, individual I2C commands such as "imd", "imm", - "imw", etc are deprecated. The single "i2c" command which is - currently enabled via CONFIG_I2C_CMD_TREE contains the same - functionality as the individual I2C commands. The individual - I2C commands should be removed as well as any references to - CONFIG_I2C_CMD_TREE. -Who: Peter Tyser <[email protected]> - ---------------------------- - What: Legacy NAND code When: April 2009 Why: Legacy NAND code is deprecated. Similar functionality exists in
include/configs/DU405.h +0 -1
@@ -211,7 +211,6 @@/*----------------------------------------------------------------------- * I2C EEPROM (CAT24WC08) for environment */ -#define CONFIG_I2C_CMD_TREE 1#define CONFIG_HARD_I2C /* I2c with hardware support */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F
include/configs/DU440.h +0 -1
@@ -170,7 +170,6 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 100000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_I2C_CMD_TREE 1#define CONFIG_I2C_MULTI_BUS 1#define CONFIG_SYS_SPD_BUS_NUM 0
include/configs/MPC8313ERDB.h +0 -1
@@ -321,7 +321,6 @@#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_FSL_I2C #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F#define CONFIG_SYS_I2C_NOPROBES {{0,0x69}}/* Don't probe these addrs */
include/configs/MPC8349EMDS.h +0 -1
@@ -315,7 +315,6 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_FSL_I2C #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F#define CONFIG_SYS_I2C_NOPROBES {{0,0x69}}/* Don't probe these addrs */
include/configs/MPC8349ITX.h +0 -1
@@ -95,7 +95,6 @@#define CONFIG_FSL_I2C #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_I2C2_OFFSET 0x3100#define CONFIG_SYS_SPD_BUS_NUM 1/* The I2C bus for SPD */
include/configs/MPC8360ERDK.h +0 -1
@@ -265,7 +265,6 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_FSL_I2C #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F#define CONFIG_SYS_I2C_NOPROBES {{0x52}}/* Don't probe these addrs */
include/configs/MPC8536DS.h +0 -1
@@ -337,7 +337,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);#define CONFIG_HARD_I2C /* I2C with hardware support */ #undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F#define CONFIG_SYS_I2C_NOPROBES {{0, 0x29}}/* Don't probe these addrs */
include/configs/MPC8568MDS.h +0 -1
@@ -287,7 +287,6 @@ extern unsigned long get_clock_freq(void);#define CONFIG_HARD_I2C /* I2C with hardware support*/ #undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_EEPROM_ADDR 0x52#define CONFIG_SYS_I2C_SLAVE 0x7F
include/configs/MPC8569MDS.h +0 -1
@@ -231,7 +231,6 @@ extern unsigned long get_clock_freq(void);#define CONFIG_HARD_I2C /* I2C with hardware support*/ #undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F#define CONFIG_SYS_I2C_NOPROBES {{0,0x69}}/* Don't probe these addrs */
include/configs/MPC8572DS.h +0 -1
@@ -378,7 +378,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);#define CONFIG_HARD_I2C /* I2C with hardware support */ #undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_EEPROM_ADDR 0x57#define CONFIG_SYS_I2C_SLAVE 0x7F
include/configs/MVBLM7.h +0 -1
@@ -53,7 +53,6 @@#define CONFIG_FSL_I2C #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_I2C2_OFFSET 0x3100
include/configs/PMC440.h +0 -1
@@ -230,7 +230,6 @@#define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_I2C_CMD_TREE 1#define CONFIG_I2C_MULTI_BUS 1#define CONFIG_SYS_I2C_MULTI_EEPROMS
include/configs/SIMPC8313.h +0 -1
@@ -223,7 +223,6 @@#define CONFIG_HARD_I2C /* I2C with hardware support*/ #define CONFIG_FSL_I2C #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F#define CONFIG_SYS_I2C_NOPROBES {{0,0x69}}/* Don't probe these addrs */
include/configs/XPEDITE5200.h +0 -1
@@ -226,7 +226,6 @@#define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_I2C2_OFFSET 0x3100#define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE /* I2C EEPROM */ #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
include/configs/XPEDITE5370.h +0 -1
@@ -244,7 +244,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);#define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_I2C2_OFFSET 0x3100#define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE /* PEX8518 slave I2C interface */ #define CONFIG_SYS_I2C_PEX8518_ADDR 0x70
include/configs/ads5121.h +0 -1
@@ -287,7 +287,6 @@#define CONFIG_HARD_I2C /* I2C with hardware support */ #undef CONFIG_SOFT_I2C/* so disable bit-banged I2C */ #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 100000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F#if 0
include/configs/at91rm9200ek.h +0 -1
@@ -266,7 +266,6 @@#ifdef CONFIG_HARD_I2C #define CONFIG_CMD_I2C -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 0/* not used */ #define CONFIG_SYS_I2C_SLAVE 0/* not used */ #endif
include/configs/katmai.h +0 -1
@@ -129,7 +129,6 @@#define CONFIG_SYS_I2C_SPEED 100000/* I2C speed and slave address */ #define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_SPD_BUS_NUM 0/* The I2C bus for SPD */ #define IIC0_BOOTPROM_ADDR 0x50
include/configs/keymile-common.h +0 -1
@@ -97,7 +97,6 @@#define CONFIG_SYS_SLOT_ID_MASK (0x3f)/* mask for slot ID bits */ #define CONFIG_I2C_MULTI_BUS 1 -#define CONFIG_I2C_CMD_TREE 1#define CONFIG_SYS_MAX_I2C_BUS 2#define CONFIG_SYS_I2C_INIT_BOARD 1#define CONFIG_I2C_MUX 1
include/configs/kmeter1.h +0 -1
@@ -314,7 +314,6 @@#define CONFIG_SYS_I2C_SLAVE 0x7F#define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_I2C_MULTI_BUS 1 -#define CONFIG_I2C_CMD_TREE 1#define CONFIG_SYS_MAX_I2C_BUS 2#define CONFIG_I2C_MUX 1
include/configs/korat.h +0 -1
@@ -282,7 +282,6 @@#define CONFIG_CMD_ELF #define CONFIG_CMD_FAT #define CONFIG_CMD_I2C -#define CONFIG_I2C_CMD_TREE #define CONFIG_CMD_IRQ #define CONFIG_CMD_MII #define CONFIG_CMD_NET
include/configs/sbc8349.h +0 -1
@@ -279,7 +279,6 @@#define CONFIG_HARD_I2C /* I2C with hardware support*/ #undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_FSL_I2C -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */
include/configs/socrates.h +0 -1
@@ -243,7 +243,6 @@#define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_CMD_TREE #define CONFIG_SYS_I2C2_OFFSET 0x3100/* I2C RTC */
Signature · 1 line
1.6.2.1
PATCH 4/7 i2c: Update references to individual i2c commands
In reply to Peter TyserThe individual i2c commands imd, imm, inm, imw, icrc32, iprobe, iloop, and isdram are no longer available so all references to them have been updated to the new form of "i2c <cmd>".
--- README | 15 ++++----------- board/esd/tasreg/tasreg.c | 4 ++-- common/cmd_i2c.c | 27 +++++++++++---------------- doc/README.ebony | 20 ++++++++++---------- doc/README.m52277evb | 8 +------- doc/README.m5373evb | 8 +------- doc/README.m54455evb | 8 +------- doc/README.m5475evb | 8 +------- doc/README.ppc440 | 4 ++-- doc/README.xpedite1k | 6 +++--- drivers/i2c/tsi108_i2c.c | 2 +- include/configs/bubinga.h | 2 +- include/configs/sacsng.h | 6 +++--- include/configs/taihu.h | 2 +- 14 files changed, 42 insertions(+), 78 deletions(-)
README +4 -11
@@ -1430,9 +1430,9 @@ The following options need to be configured: CONFIG_SYS_I2C_NOPROBES This option specifies a list of I2C devices that will be skipped - when the 'i2c probe' command is issued (or 'iprobe' using the legacy - command). If CONFIG_I2C_MULTI_BUS is set, specify a list of bus-device - pairs. Otherwise, specify a 1D array of device addresses + when the 'i2c probe' command is issued. If CONFIG_I2C_MULTI_BUS + is set, specify a list of bus-device pairs. Otherwise, specify + a 1D array of device addresses e.g. #undef CONFIG_I2C_MULTI_BUS
@@ -2866,14 +2866,7 @@ mw - memory write (fill) cp - memory copy cmp - memory compare crc32 - checksum calculation -imd - i2c memory display -imm - i2c memory modify (auto-incrementing) -inm - i2c memory modify (constant address) -imw - i2c memory write (fill) -icrc32 - i2c checksum calculation -iprobe - probe to discover valid I2C chip addresses -iloop - infinite loop on address range -isdram - print SDRAM configuration information +i2c - I2C sub-system sspi - SPI utility commands base - print or set address offset printenv- print environment variables
board/esd/tasreg/tasreg.c +2 -2
@@ -231,7 +231,7 @@ int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) addr =simple_strtol (argv[1 ],NULL ,16 ); -printf ("iprobe looping on addr 0x%lx (cntrl-c aborts)...\n" , addr); +printf ("i2c probe looping on addr 0x%lx (cntrl-c aborts)...\n" , addr);for (;;) {i2c_probe (addr);
@@ -249,7 +249,7 @@ int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) }U_BOOT_CMD ( iploop,2 ,1 , do_iploop, -"iprobe loop <addr>" , +"i2c probe loop <addr>" ,NULL );
common/cmd_i2c.c +11 -16
@@ -27,11 +27,6 @@* There are several parameters in many of the commands that bear further * explanations: * -* Two of the commands (imm and imw) take a byte/word/long modifier -* (e.g. imm.w specifies the word-length modifier). This was done to -* allow manipulating word-length registers. It was not done on any other -* commands because it was not deemed useful. -* * {i2c_chip} is the I2C chip address (the first byte sent on the bus). * Each I2C chip on the bus has a unique address. On the I2C data bus, * the address is the upper seven bits and the LSB is the "read/write"
@@ -69,11 +64,11 @@* {addr} field (since .1 is the default, it doesn't actually have to * be specified). Examples: given a memory chip at I2C chip address * 0x50, the following would happen... -* imd 50 0 10 display 16 bytes starting at 0x000 +* i2c md 50 0 10 display 16 bytes starting at 0x000 * On the bus: <S> A0 00 <E> <S> A1 <rd> ... <rd> -* imd 50 100 10 display 16 bytes starting at 0x100 +* i2c md 50 100 10 display 16 bytes starting at 0x100 * On the bus: <S> A2 00 <E> <S> A3 <rd> ... <rd> -* imd 50 210 10 display 16 bytes starting at 0x210 +* i2c md 50 210 10 display 16 bytes starting at 0x210 * On the bus: <S> A4 10 <E> <S> A5 <rd> ... <rd> * This is awfully ugly. It would be nice if someone would think up * a better way of handling this.
@@ -158,7 +153,7 @@ int i2c_set_bus_speed(unsigned int)/* * Syntax: -* imd {i2c_chip} {addr}{.0, .1, .2} {len} +* i2c md {i2c_chip} {addr}{.0, .1, .2} {len} */ #define DISP_LINE_LEN 16
@@ -275,7 +270,7 @@ int do_i2c_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])/* Write (fill) memory * * Syntax: -* imw {i2c_chip} {addr}{.0, .1, .2} {data} [{count}] +* i2c mw {i2c_chip} {addr}{.0, .1, .2} {data} [{count}] */ int do_i2c_mw (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) {
@@ -359,7 +354,7 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])/* Calculate a CRC on memory * * Syntax: -* icrc32 {i2c_chip} {addr}{.0, .1, .2} {count} +* i2c crc32 {i2c_chip} {addr}{.0, .1, .2} {count} */ int do_i2c_crc (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) {
@@ -428,8 +423,8 @@ int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])/* Modify memory. * * Syntax: -* imm{.b, .w, .l} {i2c_chip} {addr}{.0, .1, .2} -* inm{.b, .w, .l} {i2c_chip} {addr}{.0, .1, .2} +* i2c mm{.b, .w, .l} {i2c_chip} {addr}{.0, .1, .2} +* i2c nm{.b, .w, .l} {i2c_chip} {addr}{.0, .1, .2} */ static int
@@ -562,7 +557,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])/* * Syntax: -* iprobe {addr}{.0, .1, .2} +* i2c probe {addr}{.0, .1, .2} */ int do_i2c_probe (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) {
@@ -604,7 +599,7 @@ int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])/* * Syntax: -* iloop {i2c_chip} {addr}{.0, .1, .2} [{length}] [{delay}] +* i2c loop {i2c_chip} {addr}{.0, .1, .2} [{length}] [{delay}] * {length} - Number of bytes to read * {delay} - A DECIMAL number and defaults to 1000 uSec */
@@ -726,7 +721,7 @@ static void decode_bits (u_char const b, char const *str[], int const do_once)/* * Syntax: -* sdram {i2c_chip} +* i2c sdram {i2c_chip} */ int do_sdram (cmd_tbl_t * cmdtp,int flag,int argc,char *argv[]) {
doc/README.ebony +10 -10
@@ -31,17 +31,17 @@ J42: open All others are factory default. -I2C iprobe +I2C probe ===================== The i2c utilities have been tested on both Rev B. and Rev C. and look good. The CONFIG_SYS_I2C_NOPROBES macro is defined to prevent probing the CDCV850 clock controller at address 0x69 (since reading it causes the i2c implementation to misbehave. The output of -iprobe should look like this (assuming you are only using a single +'i2c probe' should look like this (assuming you are only using a single SO-DIMM: -=> iprobe +=> i2c probe Valid chip addresses: 50 53 54 Excluded chip addresses: 69
@@ -63,13 +63,13 @@ J42 - strapped This will select the default sys0 and sys1 settings (the serial eeproms are not used). Then power up the board and fix the serial -eeprom using the imm command. Here are the values I currently +eeprom using the 'i2c mm' command. Here are the values I currently use: -=> imd 50 0 10 +=> i2c md 50 0 10 0000: bf a2 04 01 ae 94 11 00 00 00 00 00 00 00 00 00 ................ -=> imd 54 0 10 +=> i2c md 54 0 10 0000: 8f b3 24 01 4d 14 11 00 00 00 00 00 00 00 00 00 ..$.M........... Once you have the eeproms set correctly change the
@@ -83,8 +83,8 @@ the SPD to initialize the DDR SDRAM control registers. So if the SPD eeprom is corrupted, U-Boot will never get into ram. Here's how I got out of this situation: -0. First, _before_ playing with the i2c utilities, do an iprobe, then -use imd to capture the various device contents to a file. Some day +0. First, _before_ playing with the i2c utilities, do an 'i2c probe', then +use 'i2c md' to capture the various device contents to a file. Some day you may be glad you did this ... trust me :-). Otherwise try the following:
@@ -100,12 +100,12 @@ settings without using the SPD eeprom. 3. Load the new U-Boot image and reboot ebony. -4. Repair the SPD eeprom using the imm command. Here's the eeprom +4. Repair the SPD eeprom using the 'i2c mm' command. Here's the eeprom contents that work with the default SO-DIMM that comes with the ebony board (micron 8VDDT164AG-265A1). Note: these are probably _not_ the factory settings ... but they work. -=> imd 53 0 10 80 +=> i2c md 53 0 10 80 0000: 80 08 07 0c 0a 01 40 00 04 75 75 00 80 08 00 01 ...... at ..uu..... 0010: 0e 04 0c 01 02 20 00 a0 75 00 00 50 3c 50 2d 20 ..... ..u..P<P- 0020: 90 90 50 50 00 00 00 00 00 41 4b 34 32 75 00 00 ..PP.....AK42u..
doc/README.m52277evb +1 -7
@@ -204,16 +204,10 @@ erase - erase FLASH memory flinfo - print FLASH memory information go - start application at address 'addr' help - print online help +i2c - I2C sub-system icache - enable or disable instruction cache -icrc32 - checksum calculation -iloop - infinite loop on address range -imd - i2c memory display iminfo - print header information for application image imls - list all images found in flash -imm - i2c memory modify (auto-incrementing) -imw - memory write (fill) -inm - memory modify (constant address) -iprobe - probe to discover valid I2C chip addresses itest - return true/false on integer compare loadb - load binary file over serial line (kermit mode) loads - load S-Record file over serial line
doc/README.m5373evb +1 -7
@@ -215,16 +215,10 @@ erase - erase FLASH memory flinfo - print FLASH memory information go - start application at address 'addr' help - print online help +i2c - I2C sub-system icache - enable or disable instruction cache -icrc32 - checksum calculation -iloop - infinite loop on address range -imd - i2c memory display iminfo - print header information for application image imls - list all images found in flash -imm - i2c memory modify (auto-incrementing) -imw - memory write (fill) -inm - memory modify (constant address) -iprobe - probe to discover valid I2C chip addresses itest - return true/false on integer compare loadb - load binary file over serial line (kermit mode) loads - load S-Record file over serial line
doc/README.m54455evb +1 -7
@@ -304,17 +304,11 @@ fsinfo - print information about filesystems fsload - load binary file from a filesystem image go - start application at address 'addr' help - print online help +i2c - I2C sub-system icache - enable or disable instruction cache -icrc32 - checksum calculation ide - IDE sub-system -iloop - infinite loop on address range -imd - i2c memory display iminfo - print header information for application image imls - list all images found in flash -imm - i2c memory modify (auto-incrementing) -imw - memory write (fill) -inm - memory modify (constant address) -iprobe - probe to discover valid I2C chip addresses itest - return true/false on integer compare loadb - load binary file over serial line (kermit mode) loads - load S-Record file over serial line
doc/README.m5475evb +1 -7
@@ -234,16 +234,10 @@ erase - erase FLASH memory flinfo - print FLASH memory information go - start application at address 'addr' help - print online help +i2c - I2C sub-system icache - enable or disable instruction cache -icrc32 - checksum calculation -iloop - infinite loop on address range -imd - i2c memory display iminfo - print header information for application image imls - list all images found in flash -imm - i2c memory modify (auto-incrementing) -imw - memory write (fill) -inm - memory modify (constant address) -iprobe - probe to discover valid I2C chip addresses itest - return true/false on integer compare loadb - load binary file over serial line (kermit mode) loads - load S-Record file over serial line
doc/README.ppc440 +2 -2
@@ -88,7 +88,7 @@ I2C ================= The i2c utilities have been tested on both Rev B. and Rev C. and -look good. The iprobe command implementation has been updated to +look good. The 'i2c probe' command implementation has been updated to allow for 'skipped' addresses. Some i2c slaves are write only and cause problems when a probe (read) is performed (for example the CDCV850 clock controller@address 0x69 on the ebony board).
@@ -97,7 +97,7 @@ To prevent probing certain addresses you can define the CONFIG_SYS_I2C_NOPROBES macro in your board-specific header file. When defined, all specified addresses are skipped during a probe. The addresses that are skipped will be displayed in the output -of the iprobe command. +of the 'i2c probe' command. For example, to prevent probing address 0x69, define the macro as follows:
doc/README.xpedite1k +3 -3
@@ -23,7 +23,7 @@ strappings and the 2 EMAC HW Ethernet addresses. Be careful not to change the 1st page of the EEPROM! Unpopulated jumper J560 can get you out of trouble as it disables the strapping read from EEPROM. -I2C iprobe +I2C probe ===================== The i2c utilities work and have been tested on Rev B. of the 440GX. See
@@ -47,10 +47,10 @@ J560 - closed This will select the default sys0 and sys1 settings (the serial eeproms are not used). Then power up the board and fix the serial -eeprom using the imm command. Here are the values I currently +eeprom using the 'i2c mm' command. Here are the values I currently use: -=> imd 50 0 10 +=> i2c md 50 0 10 0000: 85 7d 42 06 07 80 11 00 00 00 00 00 00 00 00 00 .}B.............
drivers/i2c/tsi108_i2c.c +1 -1
@@ -120,7 +120,7 @@ static int i2c_read_byte (* chip_addr: I2C chip address, range 0..127 * (to read from SPD channel EEPROM use (0xD0 ... 0xD7) * NOTE: The bit 7 in the chip_addr serves as a channel select. -* This hack is for enabling "isdram" command on Tsi108 boards +* This hack is for enabling "i2c sdram" command on Tsi108 boards * without changes to common code. Used for I2C reads only. * byte_addr: Memory or register address within the chip * alen: Number of bytes to use for addr (typically 1, 2 for larger
include/configs/bubinga.h +1 -1
@@ -134,7 +134,7 @@*/ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ -#define CONFIG_SYS_I2C_NOPROBES { 0x69 }/* avoid iprobe hangup (why?) */ +#define CONFIG_SYS_I2C_NOPROBES { 0x69 }/* avoid i2c probe hangup (why?) */ #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 6/* 24C02 requires 5ms delay */ #if defined(CONFIG_CMD_EEPROM )
include/configs/sacsng.h +3 -3
@@ -408,9 +408,9 @@"echo hostname ${hostname}\0" \"ana=run adc ; run dac\0" \"adc=run adc-12 ; run adc-34\0" \ -"adc-12=echo ### ADC-12 ; imd.b e 81 e\0" \ -"adc-34=echo ### ADC-34 ; imd.b f 81 e\0" \ -"dac=echo ### DAC ; imd.b 11 81 5\0" \ +"adc-12=echo ### ADC-12 ; i2c md e 81 e\0" \ +"adc-34=echo ### ADC-34 ; i2c md f 81 e\0" \ +"dac=echo ### DAC ; i2c md 11 81 5\0" \"boot-hook=echo\0" /* What should the console's baud rate be? */
include/configs/taihu.h +1 -1
@@ -139,7 +139,7 @@*/ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ -#define CONFIG_SYS_I2C_NOPROBES { 0x69 }/* avoid iprobe hangup (why?) */ +#define CONFIG_SYS_I2C_NOPROBES { 0x69 }/* avoid i2c probe hangup (why?) */ #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 6/* 24C02 requires 5ms delay */ #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50/* I2C boot EEPROM (24C02W) */
Signature · 1 line
1.6.2.1
PATCH 5/7 cmd_i2c: Clean up i2c command argument parsing
In reply to Peter Tyserargc and argv should only be modified once instead of once for every i2c sub-command
--- common/cmd_i2c.c | 52 ++++++++++++++++++++++++++++------------------------ 1 files changed, 28 insertions(+), 24 deletions(-)
common/cmd_i2c.c +28 -24
@@ -1274,35 +1274,39 @@ int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])int do_i2c (cmd_tbl_t * cmdtp,int flag,int argc,char *argv[]) { +/* Strip off leading 'i2c' command argument */ + argc--; + argv++; +#if defined(CONFIG_I2C_MUX ) -if (!strncmp (argv[1 ],"bu" ,2 )) -return do_i2c_add_bus (cmdtp, flag, --argc, ++argv); +if (!strncmp (argv[0 ],"bu" ,2 )) +return do_i2c_add_bus (cmdtp, flag, argc, argv);#endif /* CONFIG_I2C_MUX */ -if (!strncmp (argv[1 ],"sp" ,2 )) -return do_i2c_bus_speed (cmdtp, flag, --argc, ++argv); +if (!strncmp (argv[0 ],"sp" ,2 )) +return do_i2c_bus_speed (cmdtp, flag, argc, argv);#if defined(CONFIG_I2C_MULTI_BUS ) -if (!strncmp (argv[1 ],"de" ,2 )) -return do_i2c_bus_num (cmdtp, flag, --argc, ++argv); +if (!strncmp (argv[0 ],"de" ,2 )) +return do_i2c_bus_num (cmdtp, flag, argc, argv);#endif /* CONFIG_I2C_MULTI_BUS */ -if (!strncmp (argv[1 ],"md" ,2 )) -return do_i2c_md (cmdtp, flag, --argc, ++argv); -if (!strncmp (argv[1 ],"mm" ,2 )) -return do_i2c_mm (cmdtp, flag, --argc, ++argv); -if (!strncmp (argv[1 ],"mw" ,2 )) -return do_i2c_mw (cmdtp, flag, --argc, ++argv); -if (!strncmp (argv[1 ],"nm" ,2 )) -return do_i2c_nm (cmdtp, flag, --argc, ++argv); -if (!strncmp (argv[1 ],"cr" ,2 )) -return do_i2c_crc (cmdtp, flag, --argc, ++argv); -if (!strncmp (argv[1 ],"pr" ,2 )) -return do_i2c_probe (cmdtp, flag, --argc, ++argv); -if (!strncmp (argv[1 ],"re" ,2 )) -return do_i2c_reset (cmdtp, flag, --argc, ++argv); -if (!strncmp (argv[1 ],"lo" ,2 )) -return do_i2c_loop (cmdtp, flag, --argc, ++argv); +if (!strncmp (argv[0 ],"md" ,2 )) +return do_i2c_md (cmdtp, flag, argc, argv); +if (!strncmp (argv[0 ],"mm" ,2 )) +return do_i2c_mm (cmdtp, flag, argc, argv); +if (!strncmp (argv[0 ],"mw" ,2 )) +return do_i2c_mw (cmdtp, flag, argc, argv); +if (!strncmp (argv[0 ],"nm" ,2 )) +return do_i2c_nm (cmdtp, flag, argc, argv); +if (!strncmp (argv[0 ],"cr" ,2 )) +return do_i2c_crc (cmdtp, flag, argc, argv); +if (!strncmp (argv[0 ],"pr" ,2 )) +return do_i2c_probe (cmdtp, flag, argc, argv); +if (!strncmp (argv[0 ],"re" ,2 )) +return do_i2c_reset (cmdtp, flag, argc, argv); +if (!strncmp (argv[0 ],"lo" ,2 )) +return do_i2c_loop (cmdtp, flag, argc, argv);#if defined(CONFIG_CMD_SDRAM ) -if (!strncmp (argv[1 ],"sd" ,2 )) -return do_sdram (cmdtp, flag, --argc, ++argv); +if (!strncmp (argv[0 ],"sd" ,2 )) +return do_sdram (cmdtp, flag, argc, argv);#endif elsecmd_usage (cmdtp );
Signature · 1 line
1.6.2.1
PATCH 6/7 cmd_i2c: Clean up trivial helper functions
In reply to Peter Tyser--- common/cmd_i2c.c | 25 ++++--------------------- 1 files changed, 4 insertions(+), 21 deletions(-)
common/cmd_i2c.c +4 -21
@@ -130,9 +130,6 @@ DECLARE_GLOBAL_DATA_PTR;#endif -static int -mod_i2c_mem (cmd_tbl_t *cmdtp,int incrflag,int flag,int argc,char *argv[]); -/* TODO: Implement architecture-specific get/set functions */ unsigned int __def_i2c_get_bus_speed (void ) {
@@ -257,15 +254,6 @@ int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])return 0 ; } -int do_i2c_mm (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) -{ -return mod_i2c_mem (cmdtp,1 , flag, argc, argv); -} - -int do_i2c_nm (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) -{ -return mod_i2c_mem (cmdtp,0 , flag, argc, argv); -}/* Write (fill) memory *
@@ -1199,12 +1187,6 @@ int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) }#endif -int do_i2c_reset (cmd_tbl_t * cmdtp,int flag,int argc,char *argv[]) -{ -i2c_init (CONFIG_SYS_I2C_SPEED ,CONFIG_SYS_I2C_SLAVE ); -return 0 ; -} -#if defined(CONFIG_I2C_MUX )int do_i2c_add_bus (cmd_tbl_t * cmdtp,int flag,int argc,char *argv[]) {
@@ -1291,17 +1273,18 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])if (!strncmp (argv[0 ],"md" ,2 ))return do_i2c_md (cmdtp, flag, argc, argv);if (!strncmp (argv[0 ],"mm" ,2 )) -return do_i2c_mm (cmdtp, flag, argc, argv); +return mod_i2c_mem (cmdtp,1 , flag, argc, argv);if (!strncmp (argv[0 ],"mw" ,2 ))return do_i2c_mw (cmdtp, flag, argc, argv);if (!strncmp (argv[0 ],"nm" ,2 )) -return do_i2c_nm (cmdtp, flag, argc, argv); +return mod_i2c_mem (cmdtp,0 , flag, argc, argv);if (!strncmp (argv[0 ],"cr" ,2 ))return do_i2c_crc (cmdtp, flag, argc, argv);if (!strncmp (argv[0 ],"pr" ,2 ))return do_i2c_probe (cmdtp, flag, argc, argv);if (!strncmp (argv[0 ],"re" ,2 )) -return do_i2c_reset (cmdtp, flag, argc, argv); +i2c_init (CONFIG_SYS_I2C_SPEED ,CONFIG_SYS_I2C_SLAVE ); +return 0 ;if (!strncmp (argv[0 ],"lo" ,2 ))return do_i2c_loop (cmdtp, flag, argc, argv);#if defined(CONFIG_CMD_SDRAM )
Signature · 1 line
1.6.2.1
PATCH 7/7 cmd_i2c: Fix i2c help command output when CONFIG_I2C_MUX
In reply to Peter TyserWhen CONFIG_I2C_MUX was defined the output of 'help i2c' was not correct, eg:
=> help i2c
i2c bus [muxtype:muxaddr:muxchannel] - add a new bus reached over muxes. speed [speed] - show or set I2C bus speed
i2c dev [dev] - show or set current I2C bus
...
It has been changed to:
i2c speed [speed] - show or set I2C bus speed
i2c bus [muxtype:muxaddr:muxchannel] - add a new bus reached over muxes i2c dev [dev] - show or set current I2C bus
...
--- common/cmd_i2c.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
common/cmd_i2c.c +2 -2
@@ -1301,10 +1301,10 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])U_BOOT_CMD ( i2c,6 ,1 , do_i2c,"I2C sub-system" , +"speed [speed] - show or set I2C bus speed\n" #if defined(CONFIG_I2C_MUX) -"bus [muxtype:muxaddr:muxchannel] - add a new bus reached over muxes.\n" + "i2c bus [muxtype:muxaddr:muxchannel] - add a new bus reached over muxes\n" #endif /* CONFIG_I2C_MUX */ - "speed [speed] - show or set I2C bus speed\n"#if defined(CONFIG_I2C_MULTI_BUS ) "i2c dev [dev] - show or set current I2C bus\n"#endif /* CONFIG_I2C_MULTI_BUS */
Signature · 1 line
1.6.2.1
cover Remove individual I2C commands and cleanup
In reply to Peter TyserQuoted 6 lines · Peter Tyser
This patch series removes the "individual" I2C commands (and the
CONFIG_I2C_CMD_TREEdefine) and migrates all boards to the newer "tree style" I2C commands.A small amount of cleanup was performed before and after removing the individual commands.
I reviewed the code briefly, and it looks okay. The general idea is good, so I ACK these patches.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
cover Remove individual I2C commands and cleanup
In reply to Peter TyserHello Peter,
Quoted 6 lines · Peter Tyser
This patch series removes the "individual" I2C commands (and the
CONFIG_I2C_CMD_TREEdefine) and migrates all boards to the newer "tree style" I2C commands.A small amount of cleanup was performed before and after removing the individual commands.
Thanks for your work, looks good to me. I make some tests with your patches, and if they are OK, I apply your patches to u-boot-i2c.git.
Hmm.. maybe you can have a look at my posting:
http://lists.denx.de/pipermail/u-boot/2009-March/049506.html
There is a new i2c_core.c file which holds all "common" i2c functions, for example the i2c_[set|get]_bus_speed(). I think such a file is a better place for it.
I wonder I get no response for cleaning up the i2c subsystem ... is here no interest in doing such a cleanup? (I think it is a necessary step ...)
comments are welcome ;-)
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
cover Remove individual I2C commands and cleanup
Quoted 22 lines · Heiko Schocher
Hello Peter,
Quoted 6 lines · Peter Tyser
This patch series removes the "individual" I2C commands (and the
CONFIG_I2C_CMD_TREEdefine) and migrates all boards to the newer "tree style" I2C commands.A small amount of cleanup was performed before and after removing the individual commands.
Thanks for your work, looks good to me. I make some tests with your patches, and if they are OK, I apply your patches to u-boot-i2c.git.
Hmm.. maybe you can have a look at my posting:
http://lists.denx.de/pipermail/u-boot/2009-March/049506.html
There is a new
i2c_core.cfile which holds all "common" i2c functions, for example the i2c_[set|get]_bus_speed(). I think such a file is a better place for it.
Quoted 8 lines
I wonder I get no response for cleaning up the i2c subsystem ... is here no interest in doing such a cleanup? (I think it is a necessary step ...)
comments are welcome ;-)
bye
Heiko
I am in favor of an i2c cleanup, and also Peter's changeover to the i2c "tree style" fix. I would take the lack of opposition as tacit approval, rather than apathy. Thankfully, the u-boot list isn't made up of a flock of dittoheads (def'n #2):
<http://www.urbandictionary.com/define.php?term=dittohead>
Thanks,
gvb
cover Remove individual I2C commands and cleanup
In reply to Heiko SchocherHi Heiko,
Quoted 10 lines
Quoted 6 lines
This patch series removes the "individual" I2C commands (and the
CONFIG_I2C_CMD_TREEdefine) and migrates all boards to the newer "tree style" I2C commands.A small amount of cleanup was performed before and after removing the individual commands.
Thanks for your work, looks good to me. I make some tests with your patches, and if they are OK, I apply your patches to u-boot-i2c.git.
Great, thanks.
Quoted 7 lines
Hmm.. maybe you can have a look at my posting:
http://lists.denx.de/pipermail/u-boot/2009-March/049506.html
There is a new
i2c_core.cfile which holds all "common" i2c functions, for example the i2c_[set|get]_bus_speed(). I think such a file is a better place for it.
I agree that the concept of having common i2c functions in common file (and not in cmd_i2c.c) is a good idea. If you want me to rebase my changes on the i2c multibus_v2 tree let me know and I'll move the i2c_[set|get]_bus_speed() to i2c_core.c and resubmit.
While we're discussing the i2c commands, another TODO item could be to transition the new tree-style I2C command to use a cmd_tbl_t instead of the current ifs/strncmp.
Quoted 3 lines
I wonder I get no response for cleaning up the i2c subsystem ... is here no interest in doing such a cleanup? (I think it is a necessary step ...)
My guess would be that people aren't making lots of comments because:
- Most people don't require the new functionality of the i2c subsystem cleanup with their current hardware, thus they have less of an interest in critiquing it as it doesn't really affect them. They also don't have any hardware to test/play with the new features.
- Most people are busy working on changes that do affect their hardware, etc
- It takes more effort to review patches that haven't been posted to the mailing list
- The original i2c discussion/flameware scared them off:)
Anyway, I agree with Jerry that the added functionality of the i2c subsystem cleanup is good (but can't speak to the implementation), hopefully the lack of comments mean people haven't found anything too objectionable in your changes.
Best,
Peter
cover Remove individual I2C commands and cleanup
In reply to Jerry Van BarenHello Jerry,
Quoted 27 lines · Jerry Van Baren
Quoted 26 lines · Heiko Schocher
Hello Peter,
Quoted 6 lines · Peter Tyser
This patch series removes the "individual" I2C commands (and the
CONFIG_I2C_CMD_TREEdefine) and migrates all boards to the newer "tree style" I2C commands.A small amount of cleanup was performed before and after removing the individual commands.
Thanks for your work, looks good to me. I make some tests with your patches, and if they are OK, I apply your patches to u-boot-i2c.git.
Hmm.. maybe you can have a look at my posting:
http://lists.denx.de/pipermail/u-boot/2009-March/049506.html
There is a new
i2c_core.cfile which holds all "common" i2c functions, for example the i2c_[set|get]_bus_speed(). I think such a file is a better place for it.I wonder I get no response for cleaning up the i2c subsystem ... is here no interest in doing such a cleanup? (I think it is a necessary step ...)
Quoted 8 lines
Quoted 4 lines
comments are welcome ;-)
bye
HeikoI am in favor of an i2c cleanup, and also Peter's changeover to the i2c "tree style" fix. I would take the lack of opposition as tacit approval, rather than apathy. Thankfully, the u-boot list isn't made up
:-) Ok, so I try to go on with it ...
Quoted 2 lines
of a flock of dittoheads (def'n #2):
<http://www.urbandictionary.com/define.php?term=dittohead>
;-)
thanks
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
cover Remove individual I2C commands and cleanup
In reply to Peter TyserHello Peter,
Quoted 11 lines · Peter Tyser
Quoted 9 lines
Quoted 6 lines
This patch series removes the "individual" I2C commands (and the
CONFIG_I2C_CMD_TREEdefine) and migrates all boards to the newer "tree style" I2C commands.A small amount of cleanup was performed before and after removing the individual commands.
Thanks for your work, looks good to me. I make some tests with your patches, and if they are OK, I apply your patches to u-boot-i2c.git.
Great, thanks.
Sorry, I had no time for it, but hopefully I am ready with it on monday.
Quoted 4 lines
Quoted 4 lines
Hmm.. maybe you can have a look at my posting:
http://lists.denx.de/pipermail/u-boot/2009-March/049506.html
Quoted 8 lines
Quoted 3 lines
There is a new
i2c_core.cfile which holds all "common" i2c functions, for example the i2c_[set|get]_bus_speed(). I think such a file is a better place for it.I agree that the concept of having common i2c functions in common file (and not in
cmd_i2c.c) is a good idea. If you want me to rebase my changes on the i2cmultibus_v2tree let me know and I'll move the i2c_[set|get]_bus_speed() toi2c_core.cand resubmit.
No need for you to do this, because I think, the "new" multibus update must have some time to test, so it takes a while for it to go in main- line.
Quoted 3 lines
While we're discussing the i2c commands, another TODO item could be to transition the new tree-style I2C command to use a
cmd_tbl_tinstead of the current ifs/strncmp.
Yes, thats right, patches are welcome ;-)
Quoted 9 lines
Quoted 3 lines
I wonder I get no response for cleaning up the i2c subsystem ... is here no interest in doing such a cleanup? (I think it is a necessary step ...)
My guess would be that people aren't making lots of comments because:
- Most people don't require the new functionality of the i2c subsystem cleanup with their current hardware, thus they have less of an interest in critiquing it as it doesn't really affect them. They also don't have any hardware to test/play with the new features.
It maybe affects them, because also "old" hardware with only one I2C driver should be tested, and I have not all boards for testing ... so it would be nice if some boardmaintainers can do also tests with the new i2c subsystem, and give a little feedback ... preferred feedback:
"My board works without problems with the new multibus core" ;-)
Quoted 2 lines
- Most people are busy working on changes that do affect their hardware, etc
Yes, thats probably the biggest reason.
Quoted 2 lines
- It takes more effort to review patches that haven't been posted to the mailing list
Hmm.. sorry for that, but some patches were greater then 100k, because they affected a lot of boards (for example the ppc_4xx i2c driver), so I didn;t post them ... and it is not such a big work to get this patches with git ... but you are right, it is more effort to do this, then just reading an EMail ...
Quoted 1 line
- The original i2c discussion/flameware scared them off:)
Yes, maybe. It was a "hard" discussion ...
Quoted 4 lines
Anyway, I agree with Jerry that the added functionality of the i2c subsystem cleanup is good (but can't speak to the implementation), hopefully the lack of comments mean people haven't found anything too objectionable in your changes.
That sounds like a dream ;-)
So I try to hold the to branches in sync with mainline, and maybe I find time to port the missing i2c driver to it, and then I start a second(third) round for it
thanks
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 2/7 i2c: Create common default i2c_[set|get]_bus_speed() functions
In reply to Peter Tysercommon/cmd_i2c.c DECLARE_GLOBAL_DATA_PTR; · line 147
Quoted 2 lines · On Thursday 16 April 2009 15:41:22 Peter Tyser wrote:
common/cmd_i2c.c +2
-0+unsigned int i2c_get_bus_speed (void ) + __attribute((weak,alias ("__def_i2c_get_bus_speed" )));
__attribute__ ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090418/0c895ee7/attachment.pgp
PATCH 2/7 i2c: Create common default i2c_[set|get]_bus_speed() functions
Quoted 5 lines · Mike Frysinger
common/cmd_i2c.c DECLARE_GLOBAL_DATA_PTR; · line 147
Quoted 2 lines · On Thursday 16 April 2009 15:41:22 Peter Tyser wrote:
common/cmd_i2c.c +2
-0+unsigned int i2c_get_bus_speed (void ) + __attribute((weak,alias ("__def_i2c_get_bus_speed" )));
__attribute__?
Interesting, thanks for catching that. I blindly copied the weak functions in net/eth.c which also use the __attribute declaration. It looks like gcc treats __attribute and __attribute__ the same, but I couldn't find any definitive info on __attribute. I'll resubmit using __attribute__.
Anyone have a reason that we shouldn't replace all u-boot references to __attribute with __attribute__?
Thanks,
Peter
PATCH 2/7 i2c: Create common default i2c_[set|get]_bus_speed() functions
Quoted 7 lines · On Saturday 18 April 2009 23:13:58 Peter Tyser wrote:
Quoted 5 lines · Mike Frysinger
common/cmd_i2c.c DECLARE_GLOBAL_DATA_PTR; · line 147
Quoted 2 lines · On Thursday 16 April 2009 15:41:22 Peter Tyser wrote:
common/cmd_i2c.c +2
-0+unsigned int i2c_get_bus_speed (void ) + __attribute((weak,alias ("__def_i2c_get_bus_speed" )));
__attribute__?
Quoted 8 lines
Interesting, thanks for catching that. I blindly copied the weak functions in
net/eth.cwhich also use the__attributedeclaration. It looks like gcc treats__attributeand__attribute__the same, but I couldn't find any definitive info on__attribute. I'll resubmit using__attribute__.Anyone have a reason that we shouldn't replace all u-boot references to
__attributewith__attribute__?
not that i know of ... using __XXX__ with gcc keywords tends to be preferred. -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090420/d2094f4f/attachment.pgp
v2 cover Remove individual I2C commands and cleanup
In reply to Peter TyserHello Peter,
Quoted 16 lines · Peter Tyser
This patch series removes the "individual" I2C commands (and the
CONFIG_I2C_CMD_TREEdefine) and migrates all boards to the newer "tree style" I2C commands.A small amount of cleanup was performed before and after removing the individual commands.
Peter Tyser (7):
cm5200: Make function test command names more unique
cmd_i2c: Create common default i2c_[set|get]_bus_speed() functions
cmd_i2c: Remove deprecated individual i2c commands
cmd_i2c: Update references to individual i2c commands
cmd_i2c: Clean up i2c command argument parsing
cmd_i2c: Clean up trivial helper functions
cmd_i2c: Fix i2c help command output whenCONFIG_I2C_MUX
Quoted 2 lines
Changes since v1:
- replaced__attributereferences with__attribute__
Applied to u-boot-i2c.git next branch
Thanks!
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
v2 cover Remove individual I2C commands and cleanup
Hello Peter,
Quoted 17 lines · Heiko Schocher
Quoted 16 lines · Peter Tyser
This patch series removes the "individual" I2C commands (and the
CONFIG_I2C_CMD_TREEdefine) and migrates all boards to the newer "tree style" I2C commands.A small amount of cleanup was performed before and after removing the individual commands.
Peter Tyser (7):
cm5200: Make function test command names more unique
cmd_i2c: Create common default i2c_[set|get]_bus_speed() functions
cmd_i2c: Remove deprecated individual i2c commands
cmd_i2c: Update references to individual i2c commands
cmd_i2c: Clean up i2c command argument parsing
cmd_i2c: Clean up trivial helper functions
cmd_i2c: Fix i2c help command output whenCONFIG_I2C_MUX
Quoted 5 lines
Quoted 2 lines
Changes since v1:
- replaced__attributereferences with__attribute__Applied to u-boot-i2c.git next branch
Thanks!
Damned, I should have wait for the "MAKEALL" is finished ... the nearly two last boards showed me the following error:
Configuring for CPCI750 board...cmd_i2c.c: In function 'do_i2c':
cmd_i2c.c:1286: error: 'CONFIG_SYS_I2C_SLAVE' undeclared (first use in this function) cmd_i2c.c:1286: error: (Each undeclared identifier is reported only once cmd_i2c.c:1286: error: for each function it appears in.)
make[1]: *** [cmd_i2c.o] Fehler 1
make[1]: *** Warte auf noch nicht beendete Prozesse...
make: *** [common/libcommon.a] Fehler 2
ppc_82xx-size: './u-boot': No such file
Configuring for ELPPC board...
text data bss dec hex filename
169744 19652 38320 227716 37984 ./u-boot
Configuring for p3mx board...cmd_i2c.c: In function 'do_i2c':
cmd_i2c.c:1286: error: 'CONFIG_SYS_I2C_SLAVE' undeclared (first use in this function) cmd_i2c.c:1286: error: (Each undeclared identifier is reported only once cmd_i2c.c:1286: error: for each function it appears in.)
make[1]: *** [cmd_i2c.o] Fehler 1
make[1]: *** Warte auf noch nicht beendete Prozesse...
make: *** [common/libcommon.a] Fehler 2
ppc_82xx-size: './u-boot': No such file
This is introduced from your patch
[PATCH v2 3/7] i2c: Remove deprecated individual i2c commands from your patchseries ... can you please fix this?
thanks
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
v2 cover Remove individual I2C commands and cleanup
Quoted 17 lines
Damned, I should have wait for the "MAKEALL" is finished ... the nearly two last boards showed me the following error:
Configuring for CPCI750 board...
cmd_i2c.c: In function 'do_i2c':
cmd_i2c.c:1286: error: 'CONFIG_SYS_I2C_SLAVE' undeclared (first use in this function) cmd_i2c.c:1286: error: (Each undeclared identifier is reported only once cmd_i2c.c:1286: error: for each function it appears in.)
make[1]: *** [cmd_i2c.o] Fehler 1
make[1]: *** Warte auf noch nicht beendete Prozesse...
make: *** [common/libcommon.a] Fehler 2
ppc_82xx-size: './u-boot': No such file
Configuring for ELPPC board...
text data bss dec hex filename
169744 19652 38320 227716 37984 ./u-boot
Configuring for p3mx board...
Quoted 8 lines
cmd_i2c.c: In function 'do_i2c':
cmd_i2c.c:1286: error: 'CONFIG_SYS_I2C_SLAVE' undeclared (first use in this function) cmd_i2c.c:1286: error: (Each undeclared identifier is reported only once cmd_i2c.c:1286: error: for each function it appears in.)
make[1]: *** [cmd_i2c.o] Fehler 1
make[1]: *** Warte auf noch nicht beendete Prozesse...
make: *** [common/libcommon.a] Fehler 2
ppc_82xx-size: './u-boot': No such file
Thanks for catching that Heiko. I'll send fixups tomorrow.
Best,
Peter