From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Mon, 21 Jul 2008 10:48:49 -0500 Subject: [U-Boot-Users] RFQ: disable flash writes until after relocation? In-Reply-To: <20080720200750.F16F8248BF@gemini.denx.de> References: <20080720200750.F16F8248BF@gemini.denx.de> Message-ID: <4884AFE1.3080001@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk 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. > This is not the way to go. Hushing up problems has never been a > solution. Instead, let's find and fix the culprit. I'm working on a patch that blocks i2c_init() from writing to global variables before relocation has occurred. But if you're saying that this patch should not be necessary, then that would be better. -- Timur Tabi Linux kernel developer at Freescale