P1010 & I2C RTC DS1339

cancel
Showing results for 
Search instead for 
Did you mean: 

P1010 & I2C RTC DS1339

Jump to solution
2,624 Views
yensid
Contributor III

I'm using a custom PCB that is designed after the P1010RDB, with SDKv1.5. I'm trying to use the Maxim DS1339 RTC with this system.  The rtc-ds1307 driver that is in the kernel supports the chip.  I modified the dts file for the different chip and made the modifications to the defconfig noted below, however the probe function of the rtc-ds1307 driver is never called and the RTC cannot be accessed from Linux.  It was my understanding that after modifying the dts and enabling the driver the kernel would know that hardware was present and call the probe function for the driver.  Is that how this is suppose to work?  Any help is appreciated.

-The rtc itself can be set and read through U-Boot and works fine, I just can't access it from Linux

-Debug info was added to the probe function of the rtc-ds1307 driver and it is not displayed

-On the P1010RDB that I have, the RTC is not accessable through Linux either leading me to believe there is a configuration issue for the P1010RDB with SDK1.5

-I don't see any messages during boot about I2c or about loading the driver

-DTS Chages

I also tried "dallas, ds1307", which was unsuccessful

&board_soc {

  i2c@3000 {

  rtc@68 {

  compatible = "dallas,rtc-ds1307";

  reg = <0x68>;

  };

  };

...

-defconfig changes

CONFIG_I2C=y

CONFIG_RTC_LIB=y

CONFIG_RTC_CLASS=y

CONFIG_RTC_HCTOSYS=y

CONFIG_RTC_HCTOSYS_DEVICE="rtc0"

CONFIG_RTC_INTF_SYSFS=y

CONFIG_RTC_INTF_PROC=y

CONFIG_RTC_INTF_DEV=y

CONFIG_RTC_DRV_CMOS=y

CONFIG_RTC_DRV_DS1307=y

Thanks for your help! If I have missed something simple please let me know as I'm still a newbie.

0 Kudos
1 Solution
930 Views
scottwood
NXP Employee
NXP Employee

I don't see CONFIG_I2C_MPC in your config file, so you don't have the i2c bus driver built in.

Also note that when posting config files, you should post your actual .config, not the defconfig it was generated from.

View solution in original post

0 Kudos
9 Replies
930 Views
yensid
Contributor III

Hi, lunminlian and Yiping thanks for your replies.

I did make the changes noted from the infocenter originally. I tried changing the dts file to the actual chip "ds1339" and rebuilt both the kernel and rfs and there was no change, the probe function was not called.  The driver name is "rtc-ds1307" which is why I had tried that string in the past.

I attached both my defconfig and a copy of the system startup. Let me know if you have any other ideas.

Thanks

0 Kudos
930 Views
lunminliang
NXP Employee
NXP Employee

Can you please share your dts file?

0 Kudos
931 Views
scottwood
NXP Employee
NXP Employee

I don't see CONFIG_I2C_MPC in your config file, so you don't have the i2c bus driver built in.

Also note that when posting config files, you should post your actual .config, not the defconfig it was generated from.

0 Kudos
930 Views
yensid
Contributor III

Hi Scott,

Thanks for your help.  I was missing CONFIG_I2C_MPC in my config file. After adding it, the I2C bus and the RTC worked fine. 

I was unable to find CONFIG_I2C_MPC in menuconfig, where should I have found this option?

Thanks,

Matt

0 Kudos
930 Views
scottwood
NXP Employee
NXP Employee

It should show up in menuconfig as "MPC107/824x/85xx/512x/52xx/83xx/86xx" along with the other i2c bus drivers.

0 Kudos
930 Views
yensid
Contributor III

Thanks for your help, I found it.

0 Kudos
930 Views
scottwood
NXP Employee
NXP Employee

The compatible string describes the hardware, not the driver.  It should be "dallas,ds1339" (note the absence of a space before ds1339).

See Documentation/devicetree/bindings/i2c/trivial-devices.txt

0 Kudos
930 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello yensid,

In the dts file you could define as the following.

i2c@3000 {

      rtc@68 {

            compatible = "dallas,ds1339";

            reg = <0x68>;

      };

You can get the definition in drivers/rtc/rtc-ds1307.c.

static const struct i2c_device_id ds1307_id[] = {

        { "ds1307", ds_1307 },

        { "ds1337", ds_1337 },

        { "ds1338", ds_1338 },

        { "ds1339", ds_1339 },

        { "ds1388", ds_1388 },

        { "ds1340", ds_1340 },

        { "ds3231", ds_3231 },

        { "m41t00", m41t00 },

        { "mcp7941x", mcp7941x },

        { "pt7c4338", ds_1307 },

        { "rx8025", rx_8025 },

        { }

};

The Kernel configuration should be OK.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
930 Views
lunminliang
NXP Employee
NXP Employee

Below is copy from SDK 1.5 Infocenter, have you done that?

pastedImage_0.png

0 Kudos