Re: [U-Boot] [PATCH v3 2/9] i2c: common changes for multibus/multiadapter support
Hello Simon, Am 11.05.2013 23:33, schrieb Simon Glass: > Hi Heiko, > > On Sat, May 4, 2013 at 6:01 AM, Heiko Schocher wrote: >> Signed-off-by: Heiko Schocher >> Signed-off-by: Simon Glass >> Cc: Henrik Nordström >> >> --- >> - changes for v2: >> add comment from Henrik Nordström >> remove wrong line in README >> - rebase against current mainline 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 >> - changes for v3: >> - adapt to the new introduced U_BOOT_I2C_ADAP_COMPLETE define >> - fix Codingstyle issues >> - adapt README >> --- >> README | 74 - >> arch/arm/lib/board.c| 7 ++- >> arch/blackfin/lib/board.c | 7 +++ >> arch/m68k/lib/board.c | 17 +- >> arch/mips/lib/board.c | 7 +++ >> arch/nds32/lib/board.c | 10 +++- >> arch/powerpc/cpu/mpc8xx/video.c | 4 ++ >> arch/powerpc/lib/board.c| 12 +++- >> common/cmd_date.c | 9 +++ >> common/cmd_dtt.c| 9 +++ >> common/cmd_i2c.c| 120 >> ++-- >> common/env_eeprom.c | 14 + >> common/stdio.c | 13 - >> include/i2c.h | 9 --- >> 14 Dateien geändert, 251 Zeilen hinzugefügt(+), 61 Zeilen entfernt(-) >> > > ... >> diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c >> index 4380794..d59f10d 100644 > >> @@ -1508,16 +1543,21 @@ static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, >> int argc, char * const argv[]) >> */ >> static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const >> argv[]) >> { >> +#if defined(CONFIG_SYS_I2C) >> + i2c_init(I2C_ADAP->speed, I2C_ADAP->slaveaddr); >> +#else >> i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); >> +#endif >> return 0; >> } >> >> static cmd_tbl_t cmd_i2c_sub[] = { >> -#if defined(CONFIG_I2C_MUX) >> - U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_add_bus, "", ""), >> +#if defined(CONFIG_SYS_I2C) >> + U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_show_bus, "", ""), >> #endif /* CONFIG_I2C_MUX */ >> U_BOOT_CMD_MKENT(crc32, 3, 1, do_i2c_crc, "", ""), >> -#if defined(CONFIG_I2C_MULTI_BUS) >> +#if defined(CONFIG_SYS_I2C) || \ >> + defined(CONFIG_I2C_MULTI_BUS) >> U_BOOT_CMD_MKENT(dev, 1, 1, do_i2c_bus_num, "", ""), > > If you are changing the condition here you should change the condition > on the help also. Fixed. >> #endif /* CONFIG_I2C_MULTI_BUS */ >> #if defined(CONFIG_I2C_EDID) >> @@ -1576,11 +1616,11 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int >> argc, char * const argv[]) >> /***/ >> #ifdef CONFIG_SYS_LONGHELP >> static char i2c_help_text[] = >> -#if defined(CONFIG_I2C_MUX) >> - "bus [muxtype:muxaddr:muxchannel] - add a new bus reached over >> muxes\ni2c " >> +#if defined(CONFIG_SYS_I2C) >> + "bus [muxtype:muxaddr:muxchannel] - show I2C bus info\n" >> #endif /* CONFIG_I2C_MUX */ >> "crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n" >> -#if defined(CONFIG_I2C_MULTI_BUS) >> +#if defined(CONFIG_SYS_I2C) >> "i2c dev [dev] - show or set current I2C bus\n" >> #endif /* CONFIG_I2C_MULTI_BUS */ >> #if defined(CONFIG_I2C_EDID) >> diff --git a/common/env_eeprom.c b/common/env_eeprom.c >> index 45c935b..fbd459a 100644 > > I tested this on snow and it seems to disable every bus except bus 0. > I will see if I can take a look. Bad news ... did you tried it with debug traces enabled? > Hopefully one of the Nvidia guys can test on seaboard as I don't have > mind with me right now. > > SMDK5250 # i2c dev 4 > Invalid bus 4 bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 2/9] i2c: common changes for multibus/multiadapter support
Hello Simon, Am 11.05.2013 23:17, schrieb Simon Glass: > Hi Heiko, > > On Sat, May 4, 2013 at 6:01 AM, Heiko Schocher wrote: >> Signed-off-by: Heiko Schocher >> Signed-off-by: Simon Glass >> Cc: Henrik Nordström >> >> --- >> - changes for v2: >> add comment from Henrik Nordström >> remove wrong line in README >> - rebase against current mainline 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 >> - changes for v3: >> - adapt to the new introduced U_BOOT_I2C_ADAP_COMPLETE define >> - fix Codingstyle issues >> - adapt README >> --- >> README | 74 - >> arch/arm/lib/board.c| 7 ++- >> arch/blackfin/lib/board.c | 7 +++ >> arch/m68k/lib/board.c | 17 +- >> arch/mips/lib/board.c | 7 +++ >> arch/nds32/lib/board.c | 10 +++- >> arch/powerpc/cpu/mpc8xx/video.c | 4 ++ >> arch/powerpc/lib/board.c| 12 +++- >> common/cmd_date.c | 9 +++ >> common/cmd_dtt.c| 9 +++ >> common/cmd_i2c.c| 120 >> ++-- >> common/env_eeprom.c | 14 + >> common/stdio.c | 13 - >> include/i2c.h | 9 --- >> 14 Dateien geändert, 251 Zeilen hinzugefügt(+), 61 Zeilen entfernt(-) > > Very happy to see this again. > > Do you also need to change common/board_f.c or common/board_r.c? Uh.. yes, you are right, fix this! Thanks! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 2/9] i2c: common changes for multibus/multiadapter support
Hi Heiko, On Sat, May 4, 2013 at 6:01 AM, Heiko Schocher wrote: > Signed-off-by: Heiko Schocher > Signed-off-by: Simon Glass > Cc: Henrik Nordström > > --- > - changes for v2: > add comment from Henrik Nordström > remove wrong line in README > - rebase against current mainline 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 > - changes for v3: > - adapt to the new introduced U_BOOT_I2C_ADAP_COMPLETE define > - fix Codingstyle issues > - adapt README > --- > README | 74 - > arch/arm/lib/board.c| 7 ++- > arch/blackfin/lib/board.c | 7 +++ > arch/m68k/lib/board.c | 17 +- > arch/mips/lib/board.c | 7 +++ > arch/nds32/lib/board.c | 10 +++- > arch/powerpc/cpu/mpc8xx/video.c | 4 ++ > arch/powerpc/lib/board.c| 12 +++- > common/cmd_date.c | 9 +++ > common/cmd_dtt.c| 9 +++ > common/cmd_i2c.c| 120 > ++-- > common/env_eeprom.c | 14 + > common/stdio.c | 13 - > include/i2c.h | 9 --- > 14 Dateien geändert, 251 Zeilen hinzugefügt(+), 61 Zeilen entfernt(-) > ... > diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c > index 4380794..d59f10d 100644 > @@ -1508,16 +1543,21 @@ static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, int > argc, char * const argv[]) > */ > static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const > argv[]) > { > +#if defined(CONFIG_SYS_I2C) > + i2c_init(I2C_ADAP->speed, I2C_ADAP->slaveaddr); > +#else > i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); > +#endif > return 0; > } > > static cmd_tbl_t cmd_i2c_sub[] = { > -#if defined(CONFIG_I2C_MUX) > - U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_add_bus, "", ""), > +#if defined(CONFIG_SYS_I2C) > + U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_show_bus, "", ""), > #endif /* CONFIG_I2C_MUX */ > U_BOOT_CMD_MKENT(crc32, 3, 1, do_i2c_crc, "", ""), > -#if defined(CONFIG_I2C_MULTI_BUS) > +#if defined(CONFIG_SYS_I2C) || \ > + defined(CONFIG_I2C_MULTI_BUS) > U_BOOT_CMD_MKENT(dev, 1, 1, do_i2c_bus_num, "", ""), If you are changing the condition here you should change the condition on the help also. > #endif /* CONFIG_I2C_MULTI_BUS */ > #if defined(CONFIG_I2C_EDID) > @@ -1576,11 +1616,11 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int > argc, char * const argv[]) > /***/ > #ifdef CONFIG_SYS_LONGHELP > static char i2c_help_text[] = > -#if defined(CONFIG_I2C_MUX) > - "bus [muxtype:muxaddr:muxchannel] - add a new bus reached over > muxes\ni2c " > +#if defined(CONFIG_SYS_I2C) > + "bus [muxtype:muxaddr:muxchannel] - show I2C bus info\n" > #endif /* CONFIG_I2C_MUX */ > "crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n" > -#if defined(CONFIG_I2C_MULTI_BUS) > +#if defined(CONFIG_SYS_I2C) > "i2c dev [dev] - show or set current I2C bus\n" > #endif /* CONFIG_I2C_MULTI_BUS */ > #if defined(CONFIG_I2C_EDID) > diff --git a/common/env_eeprom.c b/common/env_eeprom.c > index 45c935b..fbd459a 100644 I tested this on snow and it seems to disable every bus except bus 0. I will see if I can take a look. Hopefully one of the Nvidia guys can test on seaboard as I don't have mind with me right now. SMDK5250 # i2c dev 4 Invalid bus 4 Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 2/9] i2c: common changes for multibus/multiadapter support
Hi Heiko, On Sat, May 4, 2013 at 6:01 AM, Heiko Schocher wrote: > Signed-off-by: Heiko Schocher > Signed-off-by: Simon Glass > Cc: Henrik Nordström > > --- > - changes for v2: > add comment from Henrik Nordström > remove wrong line in README > - rebase against current mainline 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 > - changes for v3: > - adapt to the new introduced U_BOOT_I2C_ADAP_COMPLETE define > - fix Codingstyle issues > - adapt README > --- > README | 74 - > arch/arm/lib/board.c| 7 ++- > arch/blackfin/lib/board.c | 7 +++ > arch/m68k/lib/board.c | 17 +- > arch/mips/lib/board.c | 7 +++ > arch/nds32/lib/board.c | 10 +++- > arch/powerpc/cpu/mpc8xx/video.c | 4 ++ > arch/powerpc/lib/board.c| 12 +++- > common/cmd_date.c | 9 +++ > common/cmd_dtt.c| 9 +++ > common/cmd_i2c.c| 120 > ++-- > common/env_eeprom.c | 14 + > common/stdio.c | 13 - > include/i2c.h | 9 --- > 14 Dateien geändert, 251 Zeilen hinzugefügt(+), 61 Zeilen entfernt(-) Very happy to see this again. Do you also need to change common/board_f.c or common/board_r.c? Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 2/9] i2c: common changes for multibus/multiadapter support
Hello Daniel, Am 06.05.2013 18:39, schrieb Daniel Schwierzeck: > 2013/5/4 Heiko Schocher >> >> Signed-off-by: Heiko Schocher >> Signed-off-by: Simon Glass >> Cc: Henrik Nordström >> >> --- >> - changes for v2: >> add comment from Henrik Nordström >> remove wrong line in README >> - rebase against current mainline 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 >> - changes for v3: >> - adapt to the new introduced U_BOOT_I2C_ADAP_COMPLETE define >> - fix Codingstyle issues >> - adapt README >> --- >> README | 74 - >> arch/arm/lib/board.c| 7 ++- >> arch/blackfin/lib/board.c | 7 +++ >> arch/m68k/lib/board.c | 17 +- >> arch/mips/lib/board.c | 7 +++ >> arch/nds32/lib/board.c | 10 +++- >> arch/powerpc/cpu/mpc8xx/video.c | 4 ++ >> arch/powerpc/lib/board.c| 12 +++- >> common/cmd_date.c | 9 +++ >> common/cmd_dtt.c| 9 +++ >> common/cmd_i2c.c| 120 >> ++-- >> common/env_eeprom.c | 14 + >> common/stdio.c | 13 - >> include/i2c.h | 9 --- >> 14 Dateien geändert, 251 Zeilen hinzugefügt(+), 61 Zeilen entfernt(-) >> > ... >> >> >> diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c >> index f19f198..fedac71 100644 >> --- a/arch/mips/lib/board.c >> +++ b/arch/mips/lib/board.c >> @@ -36,6 +36,9 @@ >> #ifdef CONFIG_BITBANGMII >> #include >> #endif >> +#if defined(CONFIG_SYS_I2C) >> +#include >> +#endif >> >> DECLARE_GLOBAL_DATA_PTR; >> >> @@ -296,6 +299,10 @@ void board_init_r(gd_t *id, ulong dest_addr) >> onenand_init(); >> #endif >> >> +#if defined(CONFIG_SYS_I2C) >> + i2c_reloc_fixup(); >> +#endif >> + >> > > MIPS doesn't need manual relocation fixups anymore. So you could use > i2c_init_all() here too. Ok, removed this ... Hmm.. can you test this changes on a mips board? bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 2/9] i2c: common changes for multibus/multiadapter support
2013/5/4 Heiko Schocher > > Signed-off-by: Heiko Schocher > Signed-off-by: Simon Glass > Cc: Henrik Nordström > > --- > - changes for v2: > add comment from Henrik Nordström > remove wrong line in README > - rebase against current mainline 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 > - changes for v3: > - adapt to the new introduced U_BOOT_I2C_ADAP_COMPLETE define > - fix Codingstyle issues > - adapt README > --- > README | 74 - > arch/arm/lib/board.c| 7 ++- > arch/blackfin/lib/board.c | 7 +++ > arch/m68k/lib/board.c | 17 +- > arch/mips/lib/board.c | 7 +++ > arch/nds32/lib/board.c | 10 +++- > arch/powerpc/cpu/mpc8xx/video.c | 4 ++ > arch/powerpc/lib/board.c| 12 +++- > common/cmd_date.c | 9 +++ > common/cmd_dtt.c| 9 +++ > common/cmd_i2c.c| 120 > ++-- > common/env_eeprom.c | 14 + > common/stdio.c | 13 - > include/i2c.h | 9 --- > 14 Dateien geändert, 251 Zeilen hinzugefügt(+), 61 Zeilen entfernt(-) > ... > > > diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c > index f19f198..fedac71 100644 > --- a/arch/mips/lib/board.c > +++ b/arch/mips/lib/board.c > @@ -36,6 +36,9 @@ > #ifdef CONFIG_BITBANGMII > #include > #endif > +#if defined(CONFIG_SYS_I2C) > +#include > +#endif > > DECLARE_GLOBAL_DATA_PTR; > > @@ -296,6 +299,10 @@ void board_init_r(gd_t *id, ulong dest_addr) > onenand_init(); > #endif > > +#if defined(CONFIG_SYS_I2C) > + i2c_reloc_fixup(); > +#endif > + > MIPS doesn't need manual relocation fixups anymore. So you could use i2c_init_all() here too. -- Best regards, Daniel ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot