From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Mon, 12 Apr 2010 20:17:50 +0200 Subject: [U-Boot] [PATCH]fsl_i2c: Move i2c_board_init to after i2c_init operations In-Reply-To: <20100412180215.GA11973@richardretanubun.eng.lan> References: <4BBF6266.8040508@RuggedCom.com> <4BC2B9A5.70001@denx.de> <20100412180215.GA11973@richardretanubun.eng.lan> Message-ID: <20100412181750.9581F19F60@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear richardretanubun at ruggedcom.com, In message <20100412180215.GA11973@richardretanubun.eng.lan> you wrote: > From 00f84e4a9a2d13971c9328fc815825456b25f760 Mon Sep 17 00:00:00 2001 > From: Richard Retanubun > 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."