From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Sun, 24 Jun 2012 10:47:15 +0200 Subject: [U-Boot] [PATCH 16/24] mxc_i2c: prep work for multiple busses support In-Reply-To: <1340338339-11626-16-git-send-email-troy.kisky@boundarydevices.com> References: <1340338339-11626-1-git-send-email-troy.kisky@boundarydevices.com> <1340338339-11626-16-git-send-email-troy.kisky@boundarydevices.com> Message-ID: <4FE6D413.60201@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 Hello Troy, On 22.06.2012 06:12, Troy Kisky wrote: > Signed-off-by: Troy Kisky > --- > drivers/i2c/mxc_i2c.c | 121 ++++++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 100 insertions(+), 21 deletions(-) > > diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c > index cb061f7..ec05798 100644 > --- a/drivers/i2c/mxc_i2c.c > +++ b/drivers/i2c/mxc_i2c.c [...] > @@ -359,10 +351,97 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len) > return ret; > } > > +typedef void (*toggle_i2c_fn)(void *p); > + > +#ifdef CONFIG_I2C_MULTI_BUS > +static unsigned g_bus; This is only valid after relocation ... and i2c is maybe used before relocation. Try something (not tested) like that: static unsigned int __attribute__((section (".data"))) g_bus = 0; > +#else > +#define g_bus 0 > +#endif > + > +struct i2c_parms { > + void *base; > + void *toggle_data; > + toggle_i2c_fn toggle_fn; For what is this toggle_* needed? bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany