cmd_i2c: Provide option for bulk 'i2c write' in one transaction
PATCH 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
I2C chips do exist that require a write of some multi-byte data to occur in a single bus transaction (aka atomic transfer), otherwise either the write does not come into effect at all, or normal operation of internal circuitry cannot be guaranteed. The current implementation of the 'i2c write' command (transfer of multiple bytes from a memory buffer) in fact performs a separate transaction for each byte to be written and thus cannot support such types of I2C slave devices.
This patch provides an alternative by allowing 'i2c write' to execute the write transfer of the given number of bytes in a single bus transaction if CONFIG_SYS_I2C_BULK_WRITE is defined in the board header (otherwise the old method shall compile).
--- common/cmd_i2c.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
common/cmd_i2c.c +14 -1
@@ -280,10 +280,22 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[return cmd_usage (cmdtp);/* -* Length is the number of objects, not number of bytes. +* Length is the number of bytes. */ length =simple_strtoul (argv[4 ],NULL ,16 ); +#if defined(CONFIG_SYS_I2C_BULK_WRITE ) +/* +* Write all bytes in a single I2C transaction. If the target +* device is an EEPROM, it is your responsibility to not cross +* a page bounady. +*/ +if (i2c_write (chip, devaddr, alen, memaddr, length) !=0 ) { +puts ("Error writing to the chip.\n" ); +return 1 ; + } +#else +/* Perform <length> separate write transactions of one byte each */ while (length-- >0 ) {if (i2c_write (chip, devaddr++, alen, memaddr++,1 ) !=0 ) {puts ("Error writing to the chip.\n" );
@@ -296,6 +308,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[udelay (11000 ); #endif } +#endif return 0 ; }
Signature · 1 line
1.7.9.5
PATCH 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
Hi,
Quoted 47 lines · Lubomir Popov
I2C chips do exist that require a write of some multi-byte data to occur in a single bus transaction (aka atomic transfer), otherwise either the write does not come into effect at all, or normal operation of internal circuitry cannot be guaranteed. The current implementation of the 'i2c write' command (transfer of multiple bytes from a memory buffer) in fact performs a separate transaction for each byte to be written and thus cannot support such types of I2C slave devices.
This patch provides an alternative by allowing 'i2c write' to execute the write transfer of the given number of bytes in a single bus transaction if
CONFIG_SYS_I2C_BULK_WRITEis defined in the board header (otherwise the old method shall compile).Signed-off-by Lubomir Popov <[email protected]>--- common/cmd_i2c.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)common/cmd_i2c.c +13
-1@@ -280,10 +280,22 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[return cmd_usage (cmdtp);/* -* Length is the number of objects, not number of bytes. +* Length is the number of bytes. */ length =simple_strtoul (argv[4 ],NULL ,16 ); +#if defined(CONFIG_SYS_I2C_BULK_WRITE ) +/* +* Write all bytes in a single I2C transaction. If the target +* device is an EEPROM, it is your responsibility to not cross +* a page bounady. +*/ +if (i2c_write (chip, devaddr, alen, memaddr, length) !=0 ) { +puts ("Error writing to the chip.\n" ); +return 1 ; + } +#else +/* Perform <length> separate write transactions of one byte each */ while (length-- >0 ) {if (i2c_write (chip, devaddr++, alen, memaddr++,1 ) !=0 ) {puts ("Error writing to the chip.\n" );
common/cmd_i2c.c static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[ · line 309
Quoted 2 lines
common/cmd_i2c.c +0
-0@@ -296,6 +308,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[udelay (11000 );#endif
This should really be an option/flag on the command. We might want to do different things depending on the situation.
In fact with driver model's I2C implementation, currently in review, this logic of splitting things up can be handled in the uclass layer:
http://patchwork.ozlabs.org/patch/414066/
Regards,
Simon
PATCH 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
Hi Simon,
Quoted 47 lines
Hi,
Quoted 44 lines · Lubomir Popov
I2C chips do exist that require a write of some multi-byte data to occur in a single bus transaction (aka atomic transfer), otherwise either the write does not come into effect at all, or normal operation of internal circuitry cannot be guaranteed. The current implementation of the 'i2c write' command (transfer of multiple bytes from a memory buffer) in fact performs a separate transaction for each byte to be written and thus cannot support such types of I2C slave devices.
This patch provides an alternative by allowing 'i2c write' to execute the write transfer of the given number of bytes in a single bus transaction if
CONFIG_SYS_I2C_BULK_WRITEis defined in the board header (otherwise the old method shall compile).Signed-off-by Lubomir Popov <[email protected]>--- common/cmd_i2c.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)common/cmd_i2c.c +13
-1@@ -280,10 +280,22 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[return cmd_usage (cmdtp);/* -* Length is the number of objects, not number of bytes. +* Length is the number of bytes. */ length =simple_strtoul (argv[4 ],NULL ,16 ); +#if defined(CONFIG_SYS_I2C_BULK_WRITE ) +/* +* Write all bytes in a single I2C transaction. If the target +* device is an EEPROM, it is your responsibility to not cross +* a page bounady. +*/ +if (i2c_write (chip, devaddr, alen, memaddr, length) !=0 ) { +puts ("Error writing to the chip.\n" ); +return 1 ; + } +#else +/* Perform <length> separate write transactions of one byte each */ while (length-- >0 ) {
Quoted 8 lines
common/cmd_i2c.c static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[ · line 309
Quoted 5 lines
common/cmd_i2c.c +0
-0if (i2c_write (chip, devaddr++, alen, memaddr++,1 ) !=0 ) {puts ("Error writing to the chip.\n" );@@ -296,6 +308,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[udelay (11000 );#endif This should really be an option/flag on the command. We might want to do different things depending on the situation.
Agree. I thought about this initially, even about adding a separate command, but then decided that the human device using 'i2c write' with or without the config option would be intelligent enough to know what is being needed and done. From a chip compatibility perspective this is not an issue, since for byte-wise transfers the 'i2c mw' and 'i2c mm' commands still do exist. So I went the easy way :-).
Quoted 5 lines
In fact with driver model's I2C implementation, currently in review, this logic of splitting things up can be handled in the uclass layer:
Right, in the DM context a command line option would be the better solution. I shall see to revising the patch in this respect.
Quoted 4 lines
Regards,
Simon
Best regards,
Lubo
PATCH v2 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
In reply to Simon GlassHi Simon,
[snip]
Quoted 7 lines
Review
Quoted 6 lines
(quoted diff) +3
-0+ while (length-- > 0) { + if (i2c_write(chip, devaddr++, alen, memaddr++, 1) != 0) + return i2c_report_err(-1, I2C_ERR_WRITE); /* * No write delay with FRAM devices. */
Quoted 7 lines
Should this be indented?
Quoted 5 lines
#if !defined(CONFIG_SYS_I2C_FRAM)
(quoted diff) +2
-1- udelay(11000); + udelay(11000); #endif + }
[snip]
Which indent do you mean? The udelay() is within the while loop, so it should. The comment above your note - I kept it as is, aligned with the #if/#endif.
Regards,
Lubo
PATCH v2 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
+Heiko
Hi,
Quoted 19 lines · Lubomir Popov
Hi Simon,
[snip]
Quoted 7 lines
Review
Quoted 6 lines
(quoted diff) +3
-0+ while (length-- > 0) { + if (i2c_write(chip, devaddr++, alen, memaddr++, 1) != 0) + return i2c_report_err(-1, I2C_ERR_WRITE); /* * No write delay with FRAM devices. */Quoted 7 lines
Should this be indented?
Quoted 5 lines
#if !defined(CONFIG_SYS_I2C_FRAM)
(quoted diff) +2
-1- udelay(11000); + udelay(11000); #endif + }
Quoted 4 lines
[snip]
Which indent do you mean? The
udelay()is within the while loop, so it should. The comment above your note - I kept it as is, aligned with the #if/#endif.
It was hard to tell in my emailed, but yes i see, you have kept it where it was, which is fine.
I added Heiko (I2C maintainer) to cc. As mentioned, but in more detail, with driver model 'i2c flags 2' will select this behaviour for any i2c access, not just for this command. See u-boot-dm/i2c-working2 file i2c-uclass.c.
Regards,
Simon
PATCH 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
In reply to Lubomir PopovHello Lubomir,
Am 24.11.2014 17:00, schrieb Lubomir Popov:
Quoted 13 lines
I2C chips do exist that require a write of some multi-byte data to occur in a single bus transaction (aka atomic transfer), otherwise either the write does not come into effect at all, or normal operation of internal circuitry cannot be guaranteed. The current implementation of the 'i2c write' command (transfer of multiple bytes from a memory buffer) in fact performs a separate transaction for each byte to be written and thus cannot support such types of I2C slave devices.
This patch provides an alternative by allowing 'i2c write' to execute the write transfer of the given number of bytes in a single bus transaction if
CONFIG_SYS_I2C_BULK_WRITEis defined in the board header (otherwise the old method shall compile).
Quoted 4 lines
Signed-off-by Lubomir Popov <[email protected]>--- common/cmd_i2c.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
Could you rebase your patch against current mainline, please? As we have now DM in i2c subsystem your patch does not apply clean anymore ... thanks!
bye,
Heiko
Quoted 37 lines
common/cmd_i2c.c +14
-1@@ -280,10 +280,22 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[return cmd_usage (cmdtp);/* -* Length is the number of objects, not number of bytes. +* Length is the number of bytes. */ length =simple_strtoul (argv[4 ],NULL ,16 ); +#if defined(CONFIG_SYS_I2C_BULK_WRITE ) +/* +* Write all bytes in a single I2C transaction. If the target +* device is an EEPROM, it is your responsibility to not cross +* a page bounady. +*/ +if (i2c_write (chip, devaddr, alen, memaddr, length) !=0 ) { +puts ("Error writing to the chip.\n" ); +return 1 ; + } +#else +/* Perform <length> separate write transactions of one byte each */ while (length-- >0 ) {if (i2c_write (chip, devaddr++, alen, memaddr++,1 ) !=0 ) {puts ("Error writing to the chip.\n" );@@ -296,6 +308,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[udelay (11000 ); #endif } +#endif return 0 ; }
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
Hi Heiko,
Quoted 16 lines
Hello Lubomir,
Am 24.11.2014 17:00, schrieb Lubomir Popov:
Quoted 13 lines
I2C chips do exist that require a write of some multi-byte data to occur in a single bus transaction (aka atomic transfer), otherwise either the write does not come into effect at all, or normal operation of internal circuitry cannot be guaranteed. The current implementation of the 'i2c write' command (transfer of multiple bytes from a memory buffer) in fact performs a separate transaction for each byte to be written and thus cannot support such types of I2C slave devices.
This patch provides an alternative by allowing 'i2c write' to execute the write transfer of the given number of bytes in a single bus transaction if
CONFIG_SYS_I2C_BULK_WRITEis defined in the board header (otherwise the old method shall compile).
Quoted 8 lines
Quoted 4 lines
Signed-off-by Lubomir Popov <[email protected]>--- common/cmd_i2c.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)Could you rebase your patch against current mainline, please? As we have now DM in i2c subsystem your patch does not apply clean anymore ... thanks!
It looks like you are referring V1 of the patch here. The correct version is V2 (http://patchwork.ozlabs.org/patch/415117/). If it doesn't apply as well, I shall try to find some time to fix it.
Thanks,
Lubo
Quoted 45 lines
bye,
HeikoQuoted 30 lines
common/cmd_i2c.c +13
-1@@ -280,10 +280,22 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[return cmd_usage (cmdtp);/* -* Length is the number of objects, not number of bytes. +* Length is the number of bytes. */ length =simple_strtoul (argv[4 ],NULL ,16 ); +#if defined(CONFIG_SYS_I2C_BULK_WRITE ) +/* +* Write all bytes in a single I2C transaction. If the target +* device is an EEPROM, it is your responsibility to not cross +* a page bounady. +*/ +if (i2c_write (chip, devaddr, alen, memaddr, length) !=0 ) { +puts ("Error writing to the chip.\n" ); +return 1 ; + } +#else +/* Perform <length> separate write transactions of one byte each */ while (length-- >0 ) {if (i2c_write (chip, devaddr++, alen, memaddr++,1 ) !=0 ) {puts ("Error writing to the chip.\n" );common/cmd_i2c.c static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[ · line 314
Quoted 7 lines
common/cmd_i2c.c +1
-0@@ -296,6 +308,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[udelay (11000 ); #endif } +#endif return 0 ; }--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
Hello Lubomir,
Am 28.01.2015 09:32, schrieb Lubomir Popov:
Quoted 23 lines
Hi Heiko,
Quoted 21 lines
Hello Lubomir,
Am 24.11.2014 17:00, schrieb Lubomir Popov:
Quoted 17 lines
I2C chips do exist that require a write of some multi-byte data to occur in a single bus transaction (aka atomic transfer), otherwise either the write does not come into effect at all, or normal operation of internal circuitry cannot be guaranteed. The current implementation of the 'i2c write' command (transfer of multiple bytes from a memory buffer) in fact performs a separate transaction for each byte to be written and thus cannot support such types of I2C slave devices.
This patch provides an alternative by allowing 'i2c write' to execute the write transfer of the given number of bytes in a single bus transaction if
CONFIG_SYS_I2C_BULK_WRITEis defined in the board header (otherwise the old method shall compile).Signed-off-by Lubomir Popov <[email protected]>--- common/cmd_i2c.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
Quoted 7 lines
Quoted 3 lines
Could you rebase your patch against current mainline, please? As we have now DM in i2c subsystem your patch does not apply clean anymore ... thanks!
It looks like you are referring V1 of the patch here. The correct version is V2 (http://patchwork.ozlabs.org/patch/415117/). If it doesn't apply as well, I shall try to find some time to fix it.
Sorry, was the wrong EMail I replied ... but the v2 does not apply to current mainline. If you can fix it, that would be great.
Thanks!
bye,
Heiko
Quoted 51 lines
Thanks,
LuboQuoted 45 lines
bye,
HeikoQuoted 30 lines
common/cmd_i2c.c +13
-1@@ -280,10 +280,22 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[return cmd_usage (cmdtp);/* -* Length is the number of objects, not number of bytes. +* Length is the number of bytes. */ length =simple_strtoul (argv[4 ],NULL ,16 ); +#if defined(CONFIG_SYS_I2C_BULK_WRITE ) +/* +* Write all bytes in a single I2C transaction. If the target +* device is an EEPROM, it is your responsibility to not cross +* a page bounady. +*/ +if (i2c_write (chip, devaddr, alen, memaddr, length) !=0 ) { +puts ("Error writing to the chip.\n" ); +return 1 ; + } +#else +/* Perform <length> separate write transactions of one byte each */ while (length-- >0 ) {if (i2c_write (chip, devaddr++, alen, memaddr++,1 ) !=0 ) {puts ("Error writing to the chip.\n" );common/cmd_i2c.c static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[ · line 314
Quoted 7 lines
common/cmd_i2c.c +1
-0@@ -296,6 +308,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[udelay (11000 ); #endif } +#endif return 0 ; }--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
Hi Heiko,
Quoted 30 lines
Hello Lubomir,
Am 28.01.2015 09:32, schrieb Lubomir Popov:
Quoted 27 lines
Hi Heiko,
Quoted 24 lines
Hello Lubomir,
Am 24.11.2014 17:00, schrieb Lubomir Popov:
Quoted 13 lines
I2C chips do exist that require a write of some multi-byte data to occur in a single bus transaction (aka atomic transfer), otherwise either the write does not come into effect at all, or normal operation of internal circuitry cannot be guaranteed. The current implementation of the 'i2c write' command (transfer of multiple bytes from a memory buffer) in fact performs a separate transaction for each byte to be written and thus cannot support such types of I2C slave devices.
This patch provides an alternative by allowing 'i2c write' to execute the write transfer of the given number of bytes in a single bus transaction if
CONFIG_SYS_I2C_BULK_WRITEis defined in the board header (otherwise the old method shall compile).Quoted 4 lines
Signed-off-by Lubomir Popov <[email protected]>--- common/cmd_i2c.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)Could you rebase your patch against current mainline, please? As we have now DM in i2c subsystem your patch does not apply clean anymore ... thanks!
Quoted 6 lines
Quoted 3 lines
It looks like you are referring V1 of the patch here. The correct version is V2 (http://patchwork.ozlabs.org/patch/415117/). If it doesn't apply as well, I shall try to find some time to fix it.
Sorry, was the wrong EMail I replied ... but the v2 does not apply to current mainline. If you can fix it, that would be great.
OK. Do you have a deadline to finish the I2C updates? I'm really very busy right now and am not sure if I shall manage with this before the end of the week, but can try...
Regards,
Lubo
Quoted 61 lines
Thanks!
bye,
HeikoQuoted 51 lines
Thanks,
LuboQuoted 45 lines
bye,
HeikoQuoted 30 lines
common/cmd_i2c.c +13
-1@@ -280,10 +280,22 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[return cmd_usage (cmdtp);/* -* Length is the number of objects, not number of bytes. +* Length is the number of bytes. */ length =simple_strtoul (argv[4 ],NULL ,16 ); +#if defined(CONFIG_SYS_I2C_BULK_WRITE ) +/* +* Write all bytes in a single I2C transaction. If the target +* device is an EEPROM, it is your responsibility to not cross +* a page bounady. +*/ +if (i2c_write (chip, devaddr, alen, memaddr, length) !=0 ) { +puts ("Error writing to the chip.\n" ); +return 1 ; + } +#else +/* Perform <length> separate write transactions of one byte each */ while (length-- >0 ) {if (i2c_write (chip, devaddr++, alen, memaddr++,1 ) !=0 ) {puts ("Error writing to the chip.\n" );common/cmd_i2c.c static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[ · line 314
Quoted 7 lines
common/cmd_i2c.c +1
-0@@ -296,6 +308,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[udelay (11000 ); #endif } +#endif return 0 ; }--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 1/1 cmd_i2c: Provide option for bulk 'i2c write' in one transaction
Hello Lubomir,
Am 28.01.2015 10:00, schrieb Lubomir Popov:
Quoted 36 lines
Hi Heiko,
Quoted 34 lines
Hello Lubomir,
Am 28.01.2015 09:32, schrieb Lubomir Popov:
Quoted 30 lines
Hi Heiko,
Quoted 16 lines
Hello Lubomir,
Am 24.11.2014 17:00, schrieb Lubomir Popov:
Quoted 13 lines
I2C chips do exist that require a write of some multi-byte data to occur in a single bus transaction (aka atomic transfer), otherwise either the write does not come into effect at all, or normal operation of internal circuitry cannot be guaranteed. The current implementation of the 'i2c write' command (transfer of multiple bytes from a memory buffer) in fact performs a separate transaction for each byte to be written and thus cannot support such types of I2C slave devices.
This patch provides an alternative by allowing 'i2c write' to execute the write transfer of the given number of bytes in a single bus transaction if
CONFIG_SYS_I2C_BULK_WRITEis defined in the board header (otherwise the old method shall compile).Quoted 8 lines
Quoted 4 lines
Signed-off-by Lubomir Popov <[email protected]>--- common/cmd_i2c.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)Could you rebase your patch against current mainline, please? As we have now DM in i2c subsystem your patch does not apply clean anymore ... thanks!
It looks like you are referring V1 of the patch here. The correct version is V2 (http://patchwork.ozlabs.org/patch/415117/). If it doesn't apply as well, I shall try to find some time to fix it.
Quoted 5 lines
Quoted 2 lines
Sorry, was the wrong EMail I replied ... but the v2 does not apply to current mainline. If you can fix it, that would be great.
OK. Do you have a deadline to finish the I2C updates? I'm really very busy right now and am not sure if I shall manage with this before the end of the week, but can try...
No, I have no deadline for your patch, as you posted it before the current merge window opened ... but It would be nice to get it in, so we may have tester before the next release ...
Thanks!
bye,
Heiko
Quoted 67 lines
Regards,
LuboQuoted 61 lines
Thanks!
bye,
HeikoQuoted 51 lines
Thanks,
LuboQuoted 45 lines
bye,
HeikoQuoted 30 lines
common/cmd_i2c.c +13
-1@@ -280,10 +280,22 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[return cmd_usage (cmdtp);/* -* Length is the number of objects, not number of bytes. +* Length is the number of bytes. */ length =simple_strtoul (argv[4 ],NULL ,16 ); +#if defined(CONFIG_SYS_I2C_BULK_WRITE ) +/* +* Write all bytes in a single I2C transaction. If the target +* device is an EEPROM, it is your responsibility to not cross +* a page bounady. +*/ +if (i2c_write (chip, devaddr, alen, memaddr, length) !=0 ) { +puts ("Error writing to the chip.\n" ); +return 1 ; + } +#else +/* Perform <length> separate write transactions of one byte each */ while (length-- >0 ) {if (i2c_write (chip, devaddr++, alen, memaddr++,1 ) !=0 ) {puts ("Error writing to the chip.\n" );common/cmd_i2c.c static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[ · line 314
Quoted 7 lines
common/cmd_i2c.c +1
-0@@ -296,6 +308,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[udelay (11000 ); #endif } +#endif return 0 ; }--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany