From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Mon, 09 Dec 2013 07:56:05 +0100 Subject: [U-Boot] [U-Boot, v3, 4/4] cmd_eeprom: bug fix for i2c read/write In-Reply-To: <1385971379-3096-5-git-send-email-dantesu@gmail.com> References: <1385971379-3096-5-git-send-email-dantesu@gmail.com> Message-ID: <52A56985.80109@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Kuo-jung, Am 02.12.2013 09:02, schrieb Kuo-Jung Su: > From: Kuo-Jung Su > > The local pointer of address (i.e., addr) only gets > referenced under SPI mode, and it won't be appropriate > to pass only 1-byte addr[1] to i2c_read/i2c_write while > CONFIG_SYS_I2C_EEPROM_ADDR_LEN> 1. > > 1. In U-boot's I2C model, the address would be re-assembled > to a byte string in MSB order inside I2C controller drivers. > > 2. The 'CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW' option which could > be found at soft_i2c.c is always turned on in cmd_eeprom.c, > the addr[0] always contains the device address with overflowed > MSB address bits. > > Signed-off-by: Kuo-Jung Su > Cc: Alexey Brodkin > Cc: Jean-Christophe PLAGNIOL-VILLARD > cc: Peter Tyser > Cc: Heiko Schocher > Cc: Wolfgang Denk > Cc: Stefan Roese > Cc: Mischa Jonker > > --- > Changes for v3: > - It turns out that what we did before 2013-11-13 > (i.e., cmd_eeprom: fix i2c_{read|write} usage if env is in I2C EEPROM) > is still the best one, this patch simply rollback to it with coding > style fix. > > Changes for v2: > - Initial release > > common/cmd_eeprom.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Applied to u-boot.i2c.git, thanks! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany