From: Wolfgang Denk Date: Wed, 10 May 2006 15:32:09 +0200 Subject: [U-Boot-Users] External RTC in MPC860P (i2c - rtc DS1307) In-Reply-To: Your message of "Wed, 10 May 2006 05:21:58 PDT." <20060510122158.47635.qmail@web36907.mail.mud.yahoo.com> Message-ID: <20060510133209.751EE352B0C@atlas.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 In message <20060510122158.47635.qmail@web36907.mail.mud.yahoo.com> you wrote: > > We are interfacing external RTC DS1307 in MPC860P(40MHz core frequency). > I've configured the following files in U-boot-1.1.3. Why are you using old code? > 1. In i2c.c You should never have to modify this file. > #define CFG_I2C_SLAVE 0xFE ... > 2. In include/configs/BOARD.h ... > #define CFG_I2C_SLAVE 0x7F SO what is your slave address? 0xFE or 0x7F ? > #define CONFIG_HARD_I2C 1 Makes not much sense to me. I prefer to use soft-I2C. > 3. In ... > #define CONFIG_HARD_I2C 1 > #define CFG_I2C_SPEED 50000 > #define CFG_I2C_SLAVE 0xFE And yet another set of definitions? Do NOT do this. > Is the above things correct in order to get the date and time > up and running in an MPC860P based custom board. No, this is NOT correct. You must not define the same things in several place, and differently. Use a single definition in your board config file, and make sure it is correct. Best regards, Wolfgang Denk -- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Ill-chosen abstraction is particularly evident in the design of the ADA runtime system. The interface to the ADA runtime system is so opaque that it is impossible to model or predict its performance, making it effectively useless for real-time systems. - Marc D. Donner and David H. Jameson.