
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@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