2009-01-20 14:57:36     RTC Clock support for DS1340

Document created by Aaronwu Employee on Aug 9, 2013
Version 1Show Document
  • View in full screen mode

2009-01-20 14:57:36     RTC Clock support for DS1340

Kevin Dimmer (UNITED KINGDOM)

Message: 68162   

 

Hi have just configured our kernel to support a Dallas/Maxim DS1340 RTC.

I've looked at the source and it seems to expect this device on I2C address 0x68 which is where ours is.

 

The changes were made in make menuconfig (Device Driver) to select:

 

RTC Class

/proc/driver/rtc (procfs for rtc0)        << I have tried it without this same result

Dallas/Maxim DS1307/37/38/39/40, ST M41T00

 

The Linux kernel version is:-

 

Linux version 2.6.22.19-ADI-2008R1.5-svn (iand@vgc-ds1.vitecnet.local) (gcc version 4.1.2 (ADI svn)) #48 Mon Jan 19 15:43:45 GMT 2009

 

 

Which now simply stops when it gets to:-

 

bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, r

egs_base@ffc00500, dma channel@7

i2c /dev entries driver

 

in the boot sequence.

 

Any suggestions of how to progress, or documentation i might look at to resolve the hang ?

 

Thanks

 

Kevin

QuoteReplyEditDelete

 

 

2009-01-22 07:39:53     Re: RTC Clock support for DS1340

Kevin Dimmer (UNITED KINGDOM)

Message: 68231   

 

I have done a bit more digging now, and it seems as though the driver hangs when calling i2c_transfer, it looks as though it is stuck waiting for a mutex.

 

We have other modular I2C drivers that are working, (but not loaded at the time of this test) .

 

cat /proc/locks is empty.

 

Any suggestions as to how I find who has the lock.

 

Thanks

 

Kevin

QuoteReplyEditDelete

 

 

2009-01-22 10:06:55     Re: RTC Clock support for DS1340

Mike Frysinger (UNITED STATES)

Message: 68240   

 

has the i2c bus layer been probed by that time ?  is the driver calling i2c_transfer in its module init or the i2c callback func ?

QuoteReplyEditDelete

 

 

2009-01-22 14:09:15     Re: RTC Clock support for DS1340

Kevin Dimmer (UNITED KINGDOM)

Message: 68250   

 

This driver was originally as shipped with the kernel, source uClinux-dist-2008R1.5-RC3/linux-2.6.x/drivers/rtc/rtc-ds1307.c I've added some debug to it now.

 

I wondered in anyone might have tested it with the Blackfin TWI interface.

Our configuration is probably a bit unusual as we are not not using the BF internal RTC but this I2C device instead.

 

To answer your question, module init  calls i2c_add_driver

 

The attach function calls i2c_check_functionality (with a FLAG of I2C_FUNC_I2C ??)

It then calls i2c_probe.

 

The probe call back function (ds1307_detect) gets called

it calls i2c_set_clientdata then attempts to call i2c_transfer to read the registers from the RTC in an attempt to identify the chip type.

 

This is where it hangs, i'm guessing waiting for mutex_lock_nested.

 

I have the hardware guys checking the I2C bus now as this is a new board we are bringing up.

QuoteReplyEditDelete

 

 

2009-01-22 14:16:07     Re: RTC Clock support for DS1340

Mike Frysinger (UNITED STATES)

Message: 68251   

 

the only rtc we've tested is the Blackfin on-chip RTC.  all other drivers are provided by someone else in the open source world.

 

rather than enable the driver for the rtc, you could enable the i2c-tools user space package and use those to manually poke and prod the bus and the slaves on it to make sure that much works first.

QuoteReplyEditDelete

 

 

2009-01-23 14:00:32     Re: RTC Clock support for DS1340

Kevin Dimmer (UNITED KINGDOM)

Message: 68303   

 

The hardware guys discovered we had 2 problems, too high a value pull ups on the I2C clock & data lines giving slow edges, and 2 devices clashing on the same I2C address.

Problem solved.

 

Thanks for the help.

 

Kevin

Attachments

    Outcomes