[U-Boot] [PATCH] added i2c read function
Detlev Zundel
dzu at denx.de
Fri Feb 19 16:35:19 CET 2010
Hi Frans,
> The patch below adds a command i2c read which reads from i2c to memory.
Thanks for picking up the hint! ;)
> That way the value read can be used in later itest commands to control
> the boot process.
>
> I've tried to stay as close as possible to the i2c md command as far
> as command syntax concerns.
> main differences wrt the command syntax:
>
> - length is mandatory
> - additional argument memaddr
> - no repeat possibility (it didn't seem too useful to me and only uses bytes)
>
> While doing so I also have expanded the subcommand names to their full
> length instead of going to two character abbreviations
> (otherwise read and reset would clash). I saw other places also use
> longer commands.
>
> (actually personally I would have used strcmp instead of strncmp, but
> it seems most other files in common use strncmp, so I left that part
> as is).
Well actually if you _do_ touch this place, why not convert it to use
cmd_tbl which does all this handling for you? For an example, look at
common/cmd_bootm.c around line 465.
> PS: unfortunately git send-email does not pass our corp firewall and
> doing the patch as attachement is rejected by the mailing list.
> If there are problems with the patch, just drop me a note and I'll
> resend from home.
Even after manually stripping the header and the introductory text, the
patch is damaged:
[dzu at pollux u-boot-testing (master)]$ git am ~/p01
Applying: cmd_i2c.c: added command to read to memory
fatal: corrupt patch at line 75
Patch failed at 0001 cmd_i2c.c: added command to read to memory
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Cheers
Detlev
--
Programming X-Windows is like trying to find the square root of pi
using roman numerals.
-- The UNIX Haters Handbook
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
More information about the U-Boot
mailing list