U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Seb James <seb@peak.uklinux.net>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] soft_i2c and ds1307 with tqm823l
Date: Mon, 30 Jun 2003 14:14:18 +0100	[thread overview]
Message-ID: <3F0037AA.7060205@peak.uklinux.net> (raw)
In-Reply-To: <20030630123934.19C10C592A@atlas.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 

  reply	other threads:[~2003-06-30 13:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-30 12:23 [U-Boot-Users] soft_i2c and ds1307 with tqm823l Seb James
2003-06-30 12:36 ` Seb James
2003-06-30 12:50   ` Wolfgang Denk
2003-06-30 12:39 ` Wolfgang Denk
2003-06-30 13:14   ` Seb James [this message]
2003-06-30 13:35     ` Wolfgang Denk
2003-06-30 14:08       ` Seb James
2003-06-30 14:18         ` Wolfgang Denk
2003-06-30 14:58           ` Seb James
2003-06-30 16:26             ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F0037AA.7060205@peak.uklinux.net \
    --to=seb@peak.uklinux.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox