[U-Boot-Users] RFQ: disable flash writes until after relocation?

Wolfgang Denk wd at denx.de
Mon Jul 21 20:33:20 CEST 2008


In message <4884AFE1.3080001 at 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




More information about the U-Boot mailing list