From mboxrd@z Thu Jan 1 00:00:00 1970 From: Seb James Date: Mon, 30 Jun 2003 14:14:18 +0100 Subject: [U-Boot-Users] soft_i2c and ds1307 with tqm823l In-Reply-To: <20030630123934.19C10C592A@atlas.denx.de> References: <20030630123934.19C10C592A@atlas.denx.de> Message-ID: <3F0037AA.7060205@peak.uklinux.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Thanks for the help Wolfgang, Wolfgang Denk wrote: >Dear Seb, > >in message <3F002BCA.9070609@peak.uklinux.net> you wrote: > > >>I'm working on getting a ds1307 realtime clock working with a tqm823l as >>a new user to u-boot (I've never compiled u-boot or ppcboot before). >> >> > >This is not correct. You compiled and installed PPCBoot in our >training a year and a couple of days ago :-) > > That's true. Ok, not for a while though... > > >>Firstly, the ds1307 code compiles fine, but of course it needs the i2c >>code to be compiled alongside it. Although this is obvious, the newcomer >>to u-boot doesn't (i.e. I didn't) know that calling for ds1307.c to be >>compiled doesn't in itself cause the i2c code to be compiled, so a note >>to this effect in the realtime clock section of the README would be a >>helpful addition. >> >> > >Please feel free to submit a patch... > > Yes, I'll do that when I'm sure I think there needs to be one and what it should be :) > > >>Here's a line from the README (starting at line 907): >> >>"If this is selected, either CONFIG_HARD_I2C or CONFIG_SOFT_I2C must >>be defined to include the appropriate I2C driver." >> >> >>No mention is made of what values the 'appropriate driver' might have or >>where to look for them. I assume you might define something like this: >> >>#define CONFIG_HARD_I2C mpc8xx >> >> > >No. Just "#define CONFIG_HARD_I2C" is OK, as for each CPU there is >always exactly one hard-i2c and one soft-i2c driver. > > > >>But I can't see what you'd write for CONFIG_SOFT_I2C. A bit more >>clarification here would be useful. >> >> > >Just: > #define CONFIG_SOFT_I2C > >It must be defined - that's all :-) > > > Ok, well I've successfully compiled with CONFIG_HARD_I2C and have communicated with my clock, so that is good. Next up is transferring the date in u-boot to linux, but I'm sure that will be documented somewhere. As for CONFIG_SOFT_I2C; Attached (really this time) is a diff between the original u-boot-0.4.0/include/configs/TQM823L.h and the one that I have altered. The compile of soft_i2c.c fails with the following error messages: ppc_8xx-gcc -g -Os -mrelocatable -ffixed-r14 -meabi -D__KERNEL__ -DTEXT_BASE=0x40000000 -I/eldk/ppc_8xx/usr/src/u-boot-0.4.0/include -fno-builtin -nostdinc -isystem /eldk/usr/lib/gcc-lib/ppc-linux/2.95.4/include -pipe -DCONFIG_PPC -D__powerpc__ -DCONFIG_8xx -ffixed-r2 -ffixed-r29 -mstring -mcpu=860 -msoft-float -Wall -Wstrict-prototypes -c -o soft_i2c.o soft_i2c.c soft_i2c.c: In function `send_reset': soft_i2c.c:86: warning: implicit declaration of function `I2C_SCL' soft_i2c.c:87: warning: implicit declaration of function `I2C_SDA' soft_i2c.c:91: `I2C_TRISTATE' undeclared (first use in this function) soft_i2c.c:91: (Each undeclared identifier is reported only once soft_i2c.c:91: for each function it appears in.) soft_i2c.c:94: `I2C_DELAY' undeclared (first use in this function) soft_i2c.c:82: warning: unused variable `immr' soft_i2c.c: In function `send_start': soft_i2c.c:116: `I2C_DELAY' undeclared (first use in this function) soft_i2c.c:118: `I2C_ACTIVE' undeclared (first use in this function) soft_i2c.c:113: warning: unused variable `immr' soft_i2c.c: In function `send_stop': soft_i2c.c:139: `I2C_DELAY' undeclared (first use in this function) soft_i2c.c:141: `I2C_ACTIVE' undeclared (first use in this function) soft_i2c.c:147: `I2C_TRISTATE' undeclared (first use in this function) soft_i2c.c:135: warning: unused variable `immr' soft_i2c.c: In function `send_ack': soft_i2c.c:163: `I2C_ACTIVE' undeclared (first use in this function) soft_i2c.c:165: `I2C_DELAY' undeclared (first use in this function) soft_i2c.c:160: warning: unused variable `immr' soft_i2c.c: In function `write_byte': soft_i2c.c:193: `I2C_ACTIVE' undeclared (first use in this function) soft_i2c.c:196: `I2C_DELAY' undeclared (first use in this function) soft_i2c.c:212: `I2C_TRISTATE' undeclared (first use in this function) soft_i2c.c:217: `I2C_READ' undeclared (first use in this function) soft_i2c.c:188: warning: unused variable `immr' soft_i2c.c:191: warning: `nack' might be used uninitialized in this function soft_i2c.c: In function `read_byte': soft_i2c.c:244: `I2C_TRISTATE' undeclared (first use in this function) soft_i2c.c:248: `I2C_DELAY' undeclared (first use in this function) soft_i2c.c:252: `I2C_READ' undeclared (first use in this function) soft_i2c.c:236: warning: unused variable `immr' make[1]: *** [soft_i2c.o] Error 1 make[1]: Leaving directory `/eldk/ppc_8xx/usr/src/u-boot-0.4.0/common' make: *** [subdirs] Error 1 [seb at mst26 u-boot-0.4.0]$ -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: changes.diff Url: http://lists.denx.de/pipermail/u-boot/attachments/20030630/a532463b/attachment.txt