Re: [U-Boot] [PATCH v3 4/7] drivers/i2c/omap24xx_i2c.c: move all local variables to SRAM

2012-01-10 Thread Heiko Schocher
Hello Andreas,

Andreas Müller wrote:
 At old overo boards TWL4030 RTC irq is connected to gpio112. Unfortunately
 this pin is also used for revision detection. Therefore we need to send
 shut-up to TWL4030 to avoid reading wrong revision. In SPL this must
 be done before SDRAM is set up because the type of SDRAM is revision 
 dependent.
 By this patch it is ensured that all variables used by omap24xx_i2c.c are
 located in SRAM.
 
 Signed-off-by: Andreas Müller schnitzelt...@gmx.de
 ---
  drivers/i2c/omap24xx_i2c.c |   13 +
  1 files changed, 9 insertions(+), 4 deletions(-)

Acked-by: Heiko Schocher h...@denx.de

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 4/7] drivers/i2c/omap24xx_i2c.c: move all local variables to SRAM

2012-01-04 Thread Andreas Müller
At old overo boards TWL4030 RTC irq is connected to gpio112. Unfortunately
this pin is also used for revision detection. Therefore we need to send
shut-up to TWL4030 to avoid reading wrong revision. In SPL this must
be done before SDRAM is set up because the type of SDRAM is revision dependent.
By this patch it is ensured that all variables used by omap24xx_i2c.c are
located in SRAM.

Signed-off-by: Andreas Müller schnitzelt...@gmx.de
---
 drivers/i2c/omap24xx_i2c.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 271ed60..44290b4 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -35,10 +35,15 @@ static void wait_for_bb(void);
 static u16 wait_for_pin(void);
 static void flush_fifo(void);
 
-static struct i2c *i2c_base = (struct i2c *)I2C_DEFAULT_BASE;
-
-static unsigned int bus_initialized[I2C_BUS_MAX];
-static unsigned int current_bus;
+/*
+ * For SPL boot some boards need i2c before SDRAM is initialised so force
+ * variables to live in SRAM
+ */
+static struct i2c __attribute__ ((section (.data))) *i2c_base =
+   (struct i2c *)I2C_DEFAULT_BASE;
+static unsigned int __attribute__ ((section (.data))) 
bus_initialized[I2C_BUS_MAX] =
+   { [0 ... (I2C_BUS_MAX-1)] = 0 };
+static unsigned int __attribute__ ((section (.data))) current_bus = 0;
 
 void i2c_init(int speed, int slaveadd)
 {
-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot