How to set external RTC in kernel

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set external RTC in kernel

Jump to solution
196 Views
Contributor IV

Hi 

Some days ago,I asked a question about RTC RTC always reset to 19700101

After investigation, I find it can not register the external RTC (BM8563ESA, I2C RTC) if I close all the on-cpu RTC in "menuconfig". And the RTC_VBAT is unused so that the on-cpu RTC which I have been using will be reset after power off.

So could you please give me a hand for adding this I2C RTC into kernel.

now my devices tree for this external RTC:

&i2c3 {
   clock-frequency = <100000>;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_i2c3>;
   status = "okay";

   rtc@51{
      compatible = "pcf8563";
      reg = <0x51>;
   };

   hdmi: edid@50 {
      compatible = "fsl,imx6-hdmi-i2c";
      reg = <0x50>;
      status = "okay";
   };
};

Regards

Mihan

Labels (1)
1 Solution
113 Views
Contributor IV

Thanks 

I have solve this problem.

First, I found I used the on-cpu RTC before.

Second, I found the I2C address (get from `i2cdetect` and set in the device tree) was mismatched.

So, now I close all the on-cpu RTC on `make menuconfig-> device drivers-> Real time clock`, and make sure the all about pcf8563 are opened.

it works well for my device.

Regards

Mihan

View solution in original post

3 Replies
113 Views
Senior Contributor II

Hi 铭恒 李 ,

It seems like your compatible property is not getting matched with the driver's compatible property name. You can check drivers/rtc/rtc-pcf8563.c at least once and make sure your node's compatible property matches with driver's compatible property. (here compatible = "nxp,pcf8563")

You can refer Documentation/devicetree/bindings/rtc/pcf8563.txt. to add a node of etc.

Also, make sure you have enabled this driver with the help of menuconfig. 

Regards,

Karan Gajjar

0 Kudos
114 Views
Contributor IV

Thanks 

I have solve this problem.

First, I found I used the on-cpu RTC before.

Second, I found the I2C address (get from `i2cdetect` and set in the device tree) was mismatched.

So, now I close all the on-cpu RTC on `make menuconfig-> device drivers-> Real time clock`, and make sure the all about pcf8563 are opened.

it works well for my device.

Regards

Mihan

View solution in original post

113 Views
Senior Contributor II

Hi 铭恒 李,

We are glad you solved your issue.

Kindly let us know in case of any other concerns.

Regards,

Karan Gajjar

0 Kudos