Re: [U-Boot-Users] [PATCH] fsl-i2c: fix writes to data segment before relocation

2008-07-29 Thread Wolfgang Denk
In message <[EMAIL PROTECTED]> you wrote: > Prevent i2c_init() in fsl_i2c.c from writing to the data segment before > relocation. Commit d8c82db4 added the ability for i2c_init() to program the > I2C bus speed and save the value in i2c_bus_speed[], which is a global > variable. It is an error to

Re: [U-Boot-Users] [PATCH] fsl-i2c: fix writes to data segment before relocation

2008-07-21 Thread Wolfgang Denk
In message <[EMAIL PROTECTED]> you wrote: > > I guess in some cases a board with fixed DDR would not > need to initialize the I2C controller until after > relocation. If ever - let's keep in mind that U-Boot initializes only devices which it actually uses itself. Best regards, Wolfgang Denk --

Re: [U-Boot-Users] [PATCH] fsl-i2c: fix writes to data segment before relocation

2008-07-21 Thread Wolfgang Denk
In message <[EMAIL PROTECTED]> you wrote: > > > + if (gd->flags & GD_FLG_RELOC) > Maybe a macro will more clear like > if(is_relacated()) Actually, I disagree here. Also, for consistency you would have to change many other uses of (gd->flags & GD_FLG_???) as well. Let's keep as is. Best

Re: [U-Boot-Users] [PATCH] fsl-i2c: fix writes to data segment before relocation

2008-07-21 Thread Jerry Van Baren
Timur Tabi wrote: > David Hawkins wrote: >> Hi Timur, [snip] >> If you need I2C speed tracking code, why not just re-read >> the I2C controller registers, and determine the speed from >> there? That is independent of relocation. > > I suppose we could do that. That won't work for soft (bit-bang

Re: [U-Boot-Users] [PATCH] fsl-i2c: fix writes to data segment before relocation

2008-07-21 Thread Timur Tabi
David Hawkins wrote: > Hi Timur, > >> -i2c_bus_speed[0] = set_i2c_bus_speed(dev, gd->i2c1_clk, speed); >> +temp = set_i2c_bus_speed(dev, gd->i2c1_clk, speed); >> +if (gd->flags & GD_FLG_RELOC) >> +i2c_bus_speed[0] = temp; > > Does i2c_init() get called again after relocati

Re: [U-Boot-Users] [PATCH] fsl-i2c: fix writes to data segment before relocation

2008-07-21 Thread David Hawkins
Hi Timur, > - i2c_bus_speed[0] = set_i2c_bus_speed(dev, gd->i2c1_clk, speed); > + temp = set_i2c_bus_speed(dev, gd->i2c1_clk, speed); > + if (gd->flags & GD_FLG_RELOC) > + i2c_bus_speed[0] = temp; Does i2c_init() get called again after relocation? If the I2C code is only

Re: [U-Boot-Users] [PATCH] fsl-i2c: fix writes to data segment before relocation

2008-07-21 Thread Timur Tabi
Jean-Christophe PLAGNIOL-VILLARD wrote: > Maybe a macro will more clear like > if(is_relacated()) > i2c_bus_speed[0] = temp; I'm just following the same pattern as other code. The code "if (gd->flags & GD_FLG_RELOC)" is used in a number of other places. Someone else can crea

Re: [U-Boot-Users] [PATCH] fsl-i2c: fix writes to data segment before relocation

2008-07-21 Thread Jean-Christophe PLAGNIOL-VILLARD
On 14:26 Mon 21 Jul , Timur Tabi wrote: > Prevent i2c_init() in fsl_i2c.c from writing to the data segment before > relocation. Commit d8c82db4 added the ability for i2c_init() to program the > I2C bus speed and save the value in i2c_bus_speed[], which is a global > variable. It is an error t