2010-04-22 10:52:34     Problem with External I2C RTC

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

2010-04-22 10:52:34     Problem with External I2C RTC

J V (GERMANY)

Message: 88771   

 

Hello,

i am working with a custum BF548 Board with, among others, M41T81S Real Time Clock chip.

The problem is that i dont have any RTC device under /dev/.

 

This RTC chip is connected to DSP via I2C_0. The driver to this chip is available in the uClinux distribution - i am using (uClinux 2009R1 RC6).

 

I thing the driver get registred:

root: /> dmesg | grep rtc

i2c-core: driver [rtc-m41t80] registered

drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

 

the I2C interface looks ok as well - I was able to read/write registers of the RTC chip and other I2C devices on my board via I2C Tools (i2cget/i2cset).

 

root: /> dmesg | grep i2c

i2c-core: driver [dummy] registered

i2c-core: driver [rtc-m41t80] registered

i2c /dev entries driver

i2c-core: driver [dev_driver] registered

i2c-adapter i2c-0: adapter [i2c-bfin-twi] registered

i2c-dev: adapter [i2c-bfin-twi] registered as minor 0

i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc00700

i2c-adapter i2c-1: adapter [i2c-bfin-twi] registered

i2c-dev: adapter [i2c-bfin-twi] registered as minor 1

i2c-bfin-twi i2c-bfin-twi.1: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc02200

 

My config:

 

--- Real Time Clock 

CONFIG_RTC_LIB=y

CONFIG_RTC_CLASS=y

CONFIG_RTC_HCTOSYS=y

CONFIG_RTC_HCTOSYS_DEVICE="rtc0"

CONFIG_RTC_DEBUG=y

 

#

# RTC interfaces

#

CONFIG_RTC_INTF_SYSFS=y

CONFIG_RTC_INTF_PROC=y

CONFIG_RTC_INTF_DEV=y

# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set

# CONFIG_RTC_DRV_TEST is not set

 

#

# I2C RTC drivers

#

CONFIG_RTC_DRV_M41T80=y

CONFIG_RTC_DRV_M41T80_WDT=y

 

CONFIG_I2C=y

CONFIG_I2C_BOARDINFO=y

CONFIG_I2C_CHARDEV=y

CONFIG_I2C_HELPER_AUTO=y

 

#

# I2C Hardware Bus support

#

 

#

# I2C system bus drivers (mostly embedded / system-on-chip)

#

CONFIG_I2C_BLACKFIN_TWI=y

CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=400

# CONFIG_I2C_GPIO is not set

# CONFIG_I2C_OCORES is not set

# CONFIG_I2C_SIMTEC is not set

 

#

# External I2C/SMBus adapter drivers

#

# CONFIG_I2C_PARPORT_LIGHT is not set

# CONFIG_I2C_TAOS_EVM is not set

# CONFIG_I2C_TINY_USB is not set

 

#

# Other I2C/SMBus bus drivers

#

# CONFIG_I2C_PCA_PLATFORM is not set

# CONFIG_I2C_STUB is not set

 

CONFIG_I2C_DEBUG_CORE=y

CONFIG_I2C_DEBUG_ALGO=y

CONFIG_I2C_DEBUG_BUS=y

CONFIG_I2C_DEBUG_CHIP=y

 

Does anybody has an idea what else to set up? What is the configuration i am missing?

Thanks very much for your help.

JV

 

PS: some other outputs:

 

root: /> cat /proc/devices

Character devices:

  1 mem

  4 /dev/vc/0

  4 tty

  5 /dev/tty

  5 /dev/console

  5 /dev/ptmx

  7 vcs

10 misc

13 input

21 sg

89 i2c

90 mtd

128 ptm

136 pts

180 usb

189 usb_device

204 ttyBF

252 usbmon

253 rtc

254 usb_endpoint

 

Block devices:

  1 ramdisk

259 blkext

  8 sd

11 sr

31 mtdblock

65 sd

66 sd

67 sd

68 sd

69 sd

70 sd

71 sd

128 sd

129 sd

130 sd

131 sd

132 sd

133 sd

134 sd

135 sd

179 mmc

 

root:/sys/class/rtc> ls -all

drwxr-xr-x 2 root root 0 Jan 1 00:00 .

drwxr-xr-x 27 root root 0 Jan 1 00:00 ..

QuoteReplyEditDelete

 

 

2010-04-22 13:22:05     Re: Problem with External I2C RTC

Mike Frysinger (UNITED STATES)

Message: 88777   

 

getting a registered message just means the driver is available, not that it found any devices

 

please read the documentation:

https://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:dev-management#no_such_device

QuoteReplyEditDelete

 

 

2010-04-23 04:30:45     Re: Problem with External I2C RTC

J V (GERMANY)

Message: 88810   

 

Thanks for your Reply!

 

I understand that only the driver gets registered and the device wasnt found, but why wasnt it found? I assume that the device driver is ok, as it was delivered with the uClinux distribution.

 

The thing i am not sure about it, are the platform resources in my linux-2.6.x/arch/blackfin/mach-bf548/boards/bf548board.c file.

 

Could you please help me to find out what should be added to this file?

 

I tried following, but i dont  really know where to start - where to get help:

 

#if defined(CONFIG_RTC_DRV_M41T80) || defined(CONFIG_RTC_DRV_M41T80_MODULE)

static struct platform_device rtc_i2c_device = {

.name = "rtc-m41t80",

.id = 0,

.num_resources = 0,

};

#endif

.

 

.

 

.

 

#if defined(CONFIG_RTC_DRV_M41T80) || defined(CONFIG_RTC_DRV_M41T80_MODULE)

&rtc_i2c_device,

#endif

 

Thanks for any ideas.

 

JV

 

 

 

QuoteReplyEditDelete

 

 

2010-04-23 11:30:18     Re: Problem with External I2C RTC

Mike Frysinger (UNITED STATES)

Message: 88832   

 

you never declared the I2C slave address.  how is the I2C controller supposed to know what to bind to ?

Attachments

    Outcomes