public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] added i2c read function
       [not found] <mailman.5361.1266585700.8190.u-boot@lists.denx.de>
@ 2010-02-19 14:17 ` Frans Meulenbroeks
  2010-02-19 15:35   ` Detlev Zundel
  0 siblings, 1 reply; 2+ messages in thread
From: Frans Meulenbroeks @ 2010-02-19 14:17 UTC (permalink / raw)
  To: u-boot

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] added i2c read function
  2010-02-19 14:17 ` [U-Boot] [PATCH] added i2c read function Frans Meulenbroeks
@ 2010-02-19 15:35   ` Detlev Zundel
  0 siblings, 0 replies; 2+ messages in thread
From: Detlev Zundel @ 2010-02-19 15:35 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-19 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5361.1266585700.8190.u-boot@lists.denx.de>
2010-02-19 14:17 ` [U-Boot] [PATCH] added i2c read function Frans Meulenbroeks
2010-02-19 15:35   ` Detlev Zundel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox