[U-Boot] [PATCH 16/24] mxc_i2c: prep work for multiple busses support

Heiko Schocher
2012-06-24T08:47:15Z

Hello Troy,

On 22.06.2012 06:12, Troy Kisky wrote:
> Signed-off-by: Troy Kisky<troy.kisky@boundarydevices.com>
> ---
> 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