Skip to contentSkip to conversation

added i2c read function

PATCH New Frans Meulenbroeks 2 participants 2 messages Feb 19, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 added i2c read function

Dear all,

The patch below adds a command i2c read which reads from i2c to memory.

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).

Feel free to comment.

Frans

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.

Frans.

#2 lore raw

PATCH 1/1 added i2c read function

Hi Frans,

Quoted 1 line

The patch below adds a command i2c read which reads from i2c to memory.

Thanks for picking up the hint! ;)

Quoted 11 lines

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)

Quoted 8 lines

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.

Quoted 4 lines

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

Signature · 7 lines
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