[U-Boot] [PATCH]fsl_i2c: Move i2c_board_init to after i2c_init operations

Wolfgang Denk wd at denx.de
Mon Apr 12 20:17:50 CEST 2010


Dear richardretanubun at ruggedcom.com,

In message <20100412180215.GA11973 at richardretanubun.eng.lan> you wrote:
> From 00f84e4a9a2d13971c9328fc815825456b25f760 Mon Sep 17 00:00:00 2001
> From: Richard Retanubun <richardretanubun at ruggedcom.com>
> Date: Mon, 12 Apr 2010 13:32:09 -0400
> Subject: [PATCH] fsl_i2c: Move the call for i2c_init_board to the end of i2c_init
> 
> This patch moved the call to i2c_init_board to the end of i2c_init.
> This allows the board fixup functions to take advantage of the
> setups done by i2c_init (i.e. bus speed and slave address).
> 
> On other boards, i2c_init_board is called before i2c_init operation
> because the method of resetting i2c bus typically uses GPIOs
> to bit-bang SCLK. For i2c controllers that is using fsl_i2c this is
> unneccessary because there is a i2c register access sequence that
> accomplish the same thing, and it is better to do the accesses
> after the bus speed and slave address have been configured.

I dislike such inconsitent behaviour. It would be better if we could
rely on a specific initialization sequence, i. e. the function always
be called at the beginning or always at the end. Having to deal with
a situation where one or the other might happen, even on the same
hardware, depending on if we use the HW or the SW I2C driver, sounds
like a nightmare to me.

If you need a late init function, then better add a new one.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Have you lived in this village all your life?"        "No, not yet."


More information about the U-Boot mailing list