Add new RTC to device tree

Hi everyone,

I am using a customised Keith & Koep trizeps 7 board with a imx6 processor. The board has an external rtc fitted and i want the system to use this rtc rather than the ones by default. I am new to the world of embedded linux.

At boot time the RTC (a DS1388) is not loaded :

dmesg |grep rtc

[    1.893420] rtc-pcf8563 1-0051: chip found, driver version 0.4.3
[    1.899764] rtc-pcf8563 1-0051: pcf8563_write_block_data: err=-5 addr=0e, data=03
[    1.907291] rtc-pcf8563 1-0051: pcf8563_probe: write error
[    1.912798] rtc-pcf8563: probe of 1-0051 failed with error -5
[    1.919363] snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r as rtc0
[    3.587480] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:01 UTC (1)

apparently there is a problem with one of the rtc by default in the board and there is only one detected :

ls -l /dev/rtc*

lrwxrwxrwx 1 root root 4 Feb 11 2016 /dev/rtc → rtc0
crw------- 1 root root 254, 0 Feb 11 2016 /dev/rtc0

i edited the device tree .dts and tried to add the rtc description but i don’t think i am doing right

rtc@68 {
     				compatible = "maxim,ds1388";
     				reg = <0x68>;
     				};

i am not totally sure of the position to put this description and wether or not it is complete.

I think i may also need to add a .rules file for this device.

Any advice ?

hi @ouss91

Could you provide the version of the hardware and software ( uname -a ) of your module?

Which RTC are you using? How is it connected to the module? Could you provide all the changes you have done to the device tree ( git diff )?

Best regards, Jaski

hi jaski,

Thank you very much for your answer.

The module name is : Linux Trizeps-VII 4.1.39-Com #1 SMP PREEMPT Thu Feb 8 11:53:11 CET 2018 armv7l armv7l armv7l GNU/Linux

The RTC i want to use is the DS1388 of Maxim integrated, it is connected via i2c.

In changing the device tree i tried 3 things in vain:

  • first i added the description of the DS1388 that i wrote in the original post under the same i2c node as the other rtc pcf8563 (the one with an error ). may be i am missing something in the description ?
  • i tried replacing it.
  • i put it under other i2c nodes because i am not sure wish i2c is i2c1 (in the device trees the adresse in the bus nodes is not clear to me. for example for i2c devices it is the slave adress in hex)

Thank you in advance.

Please note that this community forum is about topics related to Toradex products only.