From: Wolfgang Denk Date: Mon, 21 Jul 2008 20:33:20 +0200 Subject: [U-Boot-Users] RFQ: disable flash writes until after relocation? In-Reply-To: Your message of "Mon, 21 Jul 2008 10:48:49 CDT." <4884AFE1.3080001@freescale.com> Message-ID: <20080721183320.B37562488A@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 In message <4884AFE1.3080001@freescale.com> you wrote: > > > Which exact driver are you referring to? If any driver has such a bug, > > it should be fixed. > > drivers/i2c/fsl_i2c.c > > The function is i2c_init(). I recently posted a patch that added this line of code: > > i2c_bus_speed[0] = set_i2c_bus_speed(dev, gd->i2c1_clk, speed); > > And this is what causes the problem. i2c_bus_speed[] is a global variable, and > i2c_init() is called before relocation. Therefore, this function writes to > flash the first time it's called. The driver is broken if it writes to the data segment before relocation. That's a bug that should be fixed. 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 The only solution is ... a balance of power. We arm our side with exactly that much more. A balance of power -- the trickiest, most difficult, dirtiest game of them all. But the only one that preserves both sides. -- Kirk, "A Private Little War", stardate 4211.8