[U-Boot] [PATCH 22/29] cpu/mpc512x/i2c.c: use immr offsets from C struct instead of #define

Wolfgang Denk wd at denx.de
Sun May 10 14:29:24 CEST 2009


Dear Heiko,

In message <4A069233.2080101 at denx.de> you wrote:
> 
> > -#define immr ((immap_t *)CONFIG_SYS_IMMR)
> > -
> >  /* by default set I2C bus 0 active */
> >  static unsigned int bus_num = 0;
> 
> If no other bus then the first needed, when running from Flash,
> its okay for me.

Actually no I2C is needed while running from flash. In most cases,
I2C will not be touched at all in U-Boot (i. e. only when a user runs
a I2C command).

> > @@ -222,9 +226,9 @@ void i2c_init (int speed, int saddr)
> >  	}
> >  
> >  	/* Disable interrupts */
> > -	immr->i2c.icr = 0;
> > +	im->i2c.icr = 0;
> 
> shouldn;t we use in/out accessors for this?
> 
> >  	/* Turn off filters */
> > -	immr->i2c.mifr = 0;
> > +	im->i2c.mifr = 0;
> 
> here too (and so on) ...

Yes - as you saw later, I decided to do this in a separate commit.

Would you prefer if I squashed these commits into one? I can do that,
of course. But I found debugging easier as is now...


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Perfection is reached, not when there is no longer anything  to  add,
but when there is no longer anything to take away.
                                           - Antoine de Saint-Exupery


More information about the U-Boot mailing list