All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] External RTC in MPC860P (i2c - rtc DS1307)
@ 2006-05-10 12:21 Anand Mallya
  2006-05-10 13:32 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Anand Mallya @ 2006-05-10 12:21 UTC (permalink / raw)
  To: u-boot

Dear All,

We are interfacing external RTC DS1307 in MPC860P(40MHz core frequency).
I've configured the following files in U-boot-1.1.3.

1.    In i2c.c

#define    CFG_I2C_SPEED        50000
#define    CFG_I2C_SLAVE         0xFE


2.    In  include/configs/BOARD.h

#define    CFG_I2C_SPEED        50000
#define    CFG_I2C_SLAVE         0x7F
#define    CONFIG_HARD_I2C       1
#define    CONFIG_RTC_DS1307   1
#define    CFG_CMD_DATE           1

In this file I commented CONFIG_RTC_MPC8xx

3.    In <board/board.h>

#define    CONFIG_HARD_I2C       1
#define    CFG_I2C_SPEED        50000
#define    CFG_I2C_SLAVE         0xFE

Is the above things correct in order to get the date and time
up and running in an MPC860P based custom board.
Anything else I need to configure !? or any code changes
required here?

But I'm not able to get the date and time in my board.
I've captured the log of i2c with debug enabled.
Pleas edo have a look at it & Kindly let me know where
I've gone wrong .
Thanks in advance!!!!.

The U-boot log :
~~~~~~~~~~~~

U-Boot 1.1.3 (May  3 2006 - 15:06:18)

CPU:   XPC86xxxZPnnD4 at 40 MHz: 16 kB I-Cache 8 kB D-Cache FEC present
Board: Integrated Communications Manager - Beta  with MPC860P
UPMB Enabled for IDE
I2C:   [I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000
[I2C] Best is:
[I2C] CPU=40000000hz RATE=50000 F=0 I2MOD=00000001 I2BRG=00000016 DIFF=0hz
[I2C] i2mod=00000002 i2brg=00000016
[I2C] rbase = 0820
[I2C] tbase = 0840
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
ready
DRAM:  (16 MB SDRAM) 16 MB
Top of RAM usable for U-Boot at: 01000000
Reserving 378k for U-Boot at: 00fa1000
Reserving 400k for malloc() at: 00f3d000
Reserving 60 Bytes for Board Info at: 00f3cfc4
Reserving 48 Bytes for Global Data at: 00f3cf94
Stack Pointer at: 00f3cf78
New Stack Pointer is: 00f3cf78
Now running in RAM - U-Boot at: 00fa1000
FLASH: flash_protect ON: from 0xFF800000 to 0xFF829FFF
protect on 0
protect on 1
protect on 2
protect on 3
flash_protect ON: from 0xFF840000 to 0xFF843FFF
protect on 4
 AMD-LV160-B : 8 MB
*** Warning - bad CRC, using default environment

[I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000
[I2C] Best is:
[I2C] CPU=40000000hz RATE=50000 F=0 I2MOD=00000001 I2BRG=00000016 DIFF=0hz
[I2C] i2mod=00000002 i2brg=00000016
[I2C] rbase = 0820
[I2C] tbase = 0840
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
In:    serial
Out:   serial
Err:   serial
U-Boot relocated to 00fa1000
Net:   FEC ETHERNET
IDE:   Bus 0: not available  Status = 0x00
LECD:    4 Line D## main_loop entered: bootdelay=1

### main_loop: bootcmd="bootm 0xff900000"
Hit any key to stop autoboot:  1 \b\b\b 0
## Booting image at ff900000 ...
Bad Magic Number
[ICM] $
[ICM] $
[ICM] $date
[I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000
[I2C] Best is:
[I2C] CPU=40000000hz RATE=50000 F=0 I2MOD=00000001 I2BRG=00000016 DIFF=0hz
[I2C] i2mod=00000002 i2brg=00000016
[I2C] rbase = 0820
[I2C] tbase = 0840
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] i2c_newio
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] tx_buf = ff002860
[I2C] i2c_send add=104 sec=00 flag=02 size=1
[I2C] txbd = ff002840
[I2C] Formatting addresses...
[I2C] copy data...
[I2C] txbd: length=0x0002 status=0x8400 addr[0]=0xd0 addr[1]=0x00
[I2C] i2c_receive 104 00 04
[I2C] rxbd = ff002820
[I2C] txbd = ff002848
[I2C] txbd: length=0x0002 status=0xac00 addr[0]=0xd1 addr[1]=0x00
[I2C] rxbd: length=0x0001 status=0xa000 addr[0]=0x00 addr[1]=0xf3
[I2C] i2c_doio
[I2C] Enabling I2C...
[I2C] Transmitting...(txbd=0xff002848)
 [I2C] Receiving...(rxbd=0xff002820)

 2c_read: i2c_doio failed (-1)
[I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000
[I2C] Best is:
[I2C] CPU=40000000hz RATE=50000 F=0 I2MOD=00000001 I2BRG=00000016 DIFF=0htz
[I2C] i2mod=000002 i2brgR=00000016
[I2CC] tbase = 0840
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] i2c_newio
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] tx_buf = ff002860
[I2C] i2c_send add=104 sec=00 flag=02 size=1
[I2C] txbd = ff002840
[I2C] Formatting addresses...
[I2C] copy data...
[I2C] txbd: length=0x0002 status=0x8400 addr[0]=0xd0 addr[1]=0x01
[I2C] i2c_receive 104 00 04
[I2C] rxbd = ff002820
[I2C] txbd = ff002848
[I2C] txbd: length=0x0002 status=0xac00 addr[0]=0xd1 addr[1]=0x00
[I2C] rxbd: length=0x0001 status=0xa000 addr[0]=0x00 addr[1]=0xf3
[I2C] i2c_doio
[I2C] Enabling I2C...
[I2C] Transmitting...(txbd=0xff002848)

i2c_read: i2c_doio failed (-1)
[I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000
[I2C] Best is:
[I2C] CPU=40000000hz RATE=50000 F=0 I2MOD=00000001 I2BRG=00000016 DIFF=0hz
[I2C] i2mod=00000002 i2brg=00000016
[I2C] rbase = 0820
[I2C] tbase = 0840
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] i2c_newio
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] tx_buf = ff002860
[I2C] i2c_send add=104 sec=00 flag=02 size=1
[I2C] txbd = ff002840
[I2C] Formatting addresses...
[I2C] copy data...
[I2C] txbd: length=0x0002 status=0x8400 addr[0]=0xd0 addr[1]=0x02
[I2C] i2c_receive 104 00 04
[I2C] rxbd = ff002820
[I2C] txbd = ff002848
[I2C] txbd: length=0x0002 status=0xac00 addr[0]=0xd1 addr[1]=0x00
[I2C] rxbd: length=0x0001 status=0xa000 addr[0]=0x00 addr[1]=0xf3
[I2C] i2c_doio
[I2C] Enabling I2C...
[I2C] Transmitting...(txbd=0xff002848)

i2c_read: i2c_doio failed (-1)
[I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000
[I2C] Best is:
[I2C] CPU=40000000hz RATE=50000 F=0 I2MOD=00000001 I2BRG=00000016 DIFF=0hz
[I2C] i2mod=00000002 i2brg=00000016
[I2C] rbase = 0820
[I2C] tbase = 0840
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] i2c_newio
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] tx_buf = ff002860
[I2C] i2c_send add=104 sec=00 flag=02 size=1
[I2C] txbd = ff002840
[I2C] Formatting addresses...
[I2C] copy data...
[I2C] txbd: length=0x0002 status=0x8400 addr[0]=0xd0 addr[1]=0x03
[I2C] i2c_receive 104 00 04
[I2C] rxbd = ff002820
[I2C] txbd = ff002848
[I2C] txbd: length=0x0002 status=0xac00 addr[0]=0xd1 addr[1]=0x00
[I2C] rxbd: length=0x0001 status=0xa000 addr[0]=0x00 addr[1]=0xf3
[I2C] i2c_doio
[I2C] Enabling I2C...
[I2C] Transmitting...(txbd=0xff002848)
[I2C] Receiving...(rxbd=0xff002820)

i2c_read: i2c_doio failed (-1)
[I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000
[I2C] Best is:
[I2C] CPU=40000000hz RATE=50000 F=0 I2MOD=00000001 I2BRG=00000016 DIFF=0hz
[I2C] i2mod=00000002 i2brg=00000016
[I2C] rbase = 0820
[I2C] tbase = 0840
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] i2c_newio
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] tx_buf = ff002860
[I2C] i2c_send add=104 sec=00 flag=02 size=1
[I2C] txbd = ff002840
[I2C] Formatting addresses...
[I2C] copy data...
[I2C] txbd: length=0x0002 status=0x8400 addr[0]=0xd0 addr[1]=0x04
[I2C] i2c_receive 104 00 04
[I2C] rxbd = ff002820
[I2C] txbd = ff002848
[I2C] txbd: length=0x0002 status=0xac00 addr[0]=0xd1 addr[1]=0x00
[I2C] rxbd: length=0x0001 status=0xa000 addr[0]=0x00 addr[1]=0xf3
[I2C] i2c_doio
[I2C] Enabling I2C...
[I2C] Transmitting...(txbd=0xff002848)
[I2C] Receiving...(rxbd=0xff002820)

i2c_read: i2c_doio failed (-1)
[I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000
[I2C] Best is:
[I2C] CPU=40000000hz RATE=50000 F=0 I2MOD=00000001 I2BRG=00000016 DIFF=0hz
[I2C] i2mod=00000002 i2brg=00000016
[I2C] rbase = 0820
[I2C] tbase = 0840
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] i2c_newio
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] tx_buf = ff002860
[I2C] i2c_send add=104 sec=00 flag=02 size=1
[I2C] txbd = ff002840
[I2C] Formatting addresses...
[I2C] copy data...
[I2C] txbd: length=0x0002 status=0x8400 addr[0]=0xd0 addr[1]=0x05
[I2C] i2c_receive 104 00 04
[I2C] rxbd = ff002820
[I2C] txbd = ff002848
[I2C] txbd: length=0x0002 status=0xac00 addr[0]=0xd1 addr[1]=0x00
[I2C] rxbd: length=0x0001 status=0xa000 addr[0]=0x00 addr[1]=0xf3
[I2C] i2c_doio
[I2C] Enabling I2C...
[I2C] Transmitting...(txbd=0xff002848)

i2c_read: i2c_doio failed (-1)
[I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000
[I2C] Best is:
[I2C] CPU=40000000hz RATE=50000 F=0 I2MOD=00000001 I2BRG=00000016 DIFF=0hz
[I2C] i2mod=00000002 i2brg=00000016
[I2C] rbase = 0820
[I2C] tbase = 0840
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] i2c_newio
[I2C] rxbd = ff002820
[I2C] txbd = ff002840
[I2C] tx_buf = ff002860
[I2C] i2c_send add=104 sec=00 flag=02 size=1
[I2C] txbd = ff002840
[I2C] Formatting addresses...
[I2C] copy data...
[I2C] txbd: length=0x0002 status=0x8400 addr[0]=0xd0 addr[1]=0x06
[I2C] i2c_receive 104 00 04
[I2C] rxbd = ff002820
[I2C] txbd = ff002848
[I2C] txbd: length=0x0002 status=0xac00 addr[0]=0xd1 addr[1]=0x00
[I2C] rxbd: length=0x0001 status=0xa000 addr[0]=0x00 addr[1]=0xf3
[I2C] i2c_doio
[I2C] Enabling I2C...
[I2C] Transmitting...(txbd=0xff002848)
[I2C] Receiving...(rxbd=0xff002820)

i2c_read: i2c_doio failed (-1)
Get RTC year: 00 mon: 00 mday: 00 wday: 00 hr: 00 min: 00 sec: 00
Get DATE: 2000-00-00 (wday=7)  TIME:  0:00:00
Date: 2000-00-00 (unknown day)    Time:  0:00:00
[ICM] $i2cinfo
I2MOD = 03 I2ADD = fe
I2BRG = 16 I2COM = 01
I2CER = 10 I2CMR = 00
RBASE = 00000820 TBASE = 00000840
RFCR  =       10 TFCR  =       10
MRBLR =     0080
RSTATE= 00000000 RDP   = 61cf2623
RBPTR =     0820 RBC   =     c6ef
RXTMP = bd65484e
TSTATE= 10000000 TDP   = ff002864
TBPTR =     0840 TBC   =     0001
TXTMP = d10057e2
[ICM] $
I2MOD = 03 I2ADD = fe
I2BRG = 16 I2COM = 01
I2CER = 10 I2CMR = 00
RBASE = 00000820 TBASE = 00000840
RFCR  =       10 TFCR  =       10
MRBLR =     0080
RSTATE= 00000000 RDP   = 61cf2623
RBPTR =     0820 RBC   =     c6ef
RXTMP = bd65484e
TSTATE= 10000000 TDP   = ff002864
TBPTR =     0840 TBC   =     0001
TXTMP = d10057e2
02840
[I2C] Formatting addresses...
[I2C] copy data...
[I2C] txbd: length=0x0002 status=0x8400 addr[0]=0xd0 addr[1]=0x05
[I2C] i2c_receive 104 00 04
[I2C] rxbd = ff002820
[I2C] txbd = ff002848
[I2C] txbd: length=0x0002 status=0xac00 addr[0]=0xd1 addr[1]=0x00
[I2C] rxbd: length=0x0001 status=0xa000 addr[0]=0x00 addr[1]=0x00
[I2C] i2c_doio
[I2C] Enabling I2C...
[I2C] Transmitting...(txbd=0xff002848)
[I2C] Receiving...(rxbd=0xff002820)
[I2C] Receiving...(rxbd=0xff002820)
i2c_read: i2c_doio failed (-1)
[I2C] Setting rate...
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=0
  moddiv=32, brgdiv=25
  accepted brgval=10, totspeed=48076
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=1
  moddiv=16, brgdiv=50
  accepted brgval=22, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=2
  moddiv=8, brgdiv=100
  accepted brgval=47, totspeed=50000
 [I2C] trying hz=40000000, speed=50000, filter=0, modval=3
  moddiv=4, brgdiv=200
  accepted brgval=97, totspeed=50000


Regards,

ganesh


		
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1&cent;/min.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20060510/63da39be/attachment.htm 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] External RTC in MPC860P (i2c - rtc DS1307)
  2006-05-10 12:21 [U-Boot-Users] External RTC in MPC860P (i2c - rtc DS1307) Anand Mallya
@ 2006-05-10 13:32 ` Wolfgang Denk
  2006-05-12  8:53   ` Anand Mallya
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2006-05-10 13:32 UTC (permalink / raw)
  To: u-boot

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 <board/board.h>
...
> #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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] External RTC in MPC860P (i2c - rtc DS1307)
  2006-05-10 13:32 ` Wolfgang Denk
@ 2006-05-12  8:53   ` Anand Mallya
  2006-05-12  9:04     ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Anand Mallya @ 2006-05-12  8:53 UTC (permalink / raw)
  To: u-boot


Dear Wolfgang,


>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.

    Now I've taken reference of the TQM866M.h for the I2C RTC and
changed the the "include/configs/BOARD.h" as below:


/* enable I2C and select the hardware/software driver */

#undef  CONFIG_HARD_I2C                 /* I2C with hardware support    
*/
#define CONFIG_SOFT_I2C         1       /* I2C bit-banged               
*/
#define  CONFIG_RTC_DS1307      1
#define CFG_I2C_SPEED           93000   /* 93 kHz is supposed to work   
*/
#define CFG_I2C_SLAVE           0xFE
#ifdef CONFIG_SOFT_I2C
  /*
 *  * Software (bit-bang) I2C driver configuration
 *   */
#define PB_SCL          0x00000020      /* PB 26 */
#define PB_SDA          0x00000010      /* PB 27 */
#define I2C_INIT        (immr->im_cpm.cp_pbdir |=  PB_SCL)
#define I2C_ACTIVE      (immr->im_cpm.cp_pbdir |=  PB_SDA)
#define I2C_TRISTATE    (immr->im_cpm.cp_pbdir &= ~PB_SDA)
#define I2C_READ        ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
#define I2C_SDA(bit)    if(bit) immr->im_cpm.cp_pbdat |=  PB_SDA; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SDA
#define I2C_SCL(bit)    if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
                        else    immr->im_cpm.cp_pbdat &= ~PB_SCL
#define I2C_DELAY       udelay(2)       /* 1/4 I2C clock duration */
#endif  /* CONFIG_SOFT_I2C */


All other definitions I've reverted back. But now after the changes 
done
following is what I get:


[ICM] $date
i2c_read: chip 68 addr 00 alen 1 buffer 00f3dbf8 len 1
i2c_read, no chip responded 68
i2c_read: chip 68 addr 01 alen 1 buffer 00f3dbf8 len 1
i2c_read, no chip responded 68
i2c_read: chip 68 addr 02 alen 1 buffer 00f3dbf8 len 1
i2c_read, no chip responded 68
i2c_read: chip 68 addr 03 alen 1 buffer 00f3dbf8 len 1
i2c_read, no chip responded 68
i2c_read: chip 68 addr 04 alen 1 buffer 00f3dbf8 len 1
i2c_read, no chip responded 68
i2c_read: chip 68 addr 05 alen 1 buffer 00f3dbf8 len 1
i2c_read, no chip responded 68
i2c_read: chip 68 addr 06 alen 1 buffer 00f3dbf8 len 1
i2c_read, no chip responded 68
Get RTC year: 00 mon: 00 mday: 00 wday: 00 hr: 00 min: 00 sec: 00
Get DATE: 2000-00-00 (wday=7)  TIME:  0:00:00
Date: 2000-00-00 (unknown day)    Time:  0:00:00
[ICM] $

Is there anything still I'm missing, Please do help me in this regard.

Thanks in Advance!

--Ganesh


 


		
---------------------------------
Blab-away for as little as 1?/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20060512/971a8567/attachment.htm 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] External RTC in MPC860P (i2c - rtc DS1307)
  2006-05-12  8:53   ` Anand Mallya
@ 2006-05-12  9:04     ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2006-05-12  9:04 UTC (permalink / raw)
  To: u-boot

In message <20060512085300.48840.qmail@web36913.mail.mud.yahoo.com> you wrote:
> 
> All other definitions I've reverted back. But now after the changes done

I don;t see where you defined your RTC's I2C address...

> [ICM] $date
> i2c_read: chip 68 addr 00 alen 1 buffer 00f3dbf8 len 1
> i2c_read, no chip responded 68
...

What do you see when running the "iprobe" command? Does the  RTC  get
detected correctly?

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
Horses just naturally have mohawk haircuts.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-05-12  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-10 12:21 [U-Boot-Users] External RTC in MPC860P (i2c - rtc DS1307) Anand Mallya
2006-05-10 13:32 ` Wolfgang Denk
2006-05-12  8:53   ` Anand Mallya
2006-05-12  9:04     ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.