public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/3] Reset interrupted i2c slaves (galaxy5200)
Date: Wed, 26 Aug 2009 08:57:46 +0200	[thread overview]
Message-ID: <4A94DCEA.6040200@denx.de> (raw)
In-Reply-To: <20090825151517.M3271@coldhaus.com>

Hello Eric,

Eric Millbrandt wrote:
> Reset any i2c devices that may have been interrupted by a system reset.
> Normally this would be accomplished by clocking the line until SCL and SDA
> are released and then sending a start condtiion (From an Atmel datasheet).
> But since there is only write access to these lines on the MPC5200 we can
> only attempt to reset any slave devices by sending more start commands than
> bits the slave is attempting to transmit.
> 
> Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>
> ---
> 
> Changes since v1:
> - Remove non-related modifications to a different patch per Peter's suggestion

one common comment:

Can you please use in_*/out_* accessors for accessing mpc52xx registers.

> 
>  board/galaxy5200/galaxy5200.c |   41 +++++++++++++++++++++++++++++++++++++++++
>  include/configs/galaxy5200.h  |    1 +
>  2 files changed, 42 insertions(+), 0 deletions(-)
> 
> diff --git a/board/galaxy5200/galaxy5200.c b/board/galaxy5200/galaxy5200.c
> index 5aa9d3a..c38e7de 100644
> --- a/board/galaxy5200/galaxy5200.c
> +++ b/board/galaxy5200/galaxy5200.c
> @@ -155,6 +155,47 @@ phys_size_t initdram(int board_type)
>  	return dramsize + dramsize2;
>  }
>  
> +/*
> + * Reset any i2c devices that may have been interrupted by a system reset.
> + * Normally this would be accomplished by clocking the line until SCL and SDA
> + * are released and then sending a start condtiion (From an Atmel datasheet).
> + * But since there is only write access to these lines on the MPC5200 we can
> + * only attempt to reset any slave devices by sending more start commands than
> + * bits the slave is attempting to transmit.
> + */
> +int misc_init_f(void)

Hmm.. why in misc_init_f? Can you move this function to the mpc52xx i2c
driver, and add this in a manner like the send_reset() function
in drivers/i2c/soft_i2c.c? And call this send_reset() in the
i2c_init() from the mpc52xx i2c driver. As I don;t know, if this
is valid for all mpc52xx boards, it should be then also per
CONFIG_SYS_* define selectable.

thanks.

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2009-08-26  6:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25 15:26 [U-Boot] [PATCH v2 2/3] Reset interrupted i2c slaves (galaxy5200) Eric Millbrandt
2009-08-26  6:57 ` Heiko Schocher [this message]
2009-08-26 18:38   ` Eric Millbrandt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A94DCEA.6040200@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox