From: Wolfgang Denk Date: Sun, 10 May 2009 14:29:24 +0200 Subject: [U-Boot] [PATCH 22/29] cpu/mpc512x/i2c.c: use immr offsets from C struct instead of #define In-Reply-To: <4A069233.2080101@denx.de> References: <1241898668-11903-1-git-send-email-wd@denx.de> <1241898668-11903-23-git-send-email-wd@denx.de> <4A069233.2080101@denx.de> Message-ID: <20090510122924.30911832E416@gemini.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 Dear Heiko, In message <4A069233.2080101@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