# RTC integration with kernel

66 views

### Neil Cobbett

Jul 11, 2018, 7:44:50 AM7/11/18
to BeagleBoard

HI,

I'm trying to get a  battery backed RTC chip to work with the Beaglebone.  It works on 4.14 kernel but I am trying to do the same on 3.8 kernel and I can't get it to appear as a device in /dev

So far I have the device tree mappings for BB-I2C1 installed. (Which is referenced as i2c-2 - a known issue that is fixed in kernel 4).  This seems to be ok as I can see the device:

root@beaglebone:~# i2cdetect -r 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I mount it with:

dmesg shows:

[ 7242.287395] i2c i2c-2: new_device: Instantiated device ds3232 at 0x68

However a new device /dev/rtc1 is not created and only the rtc built into the BBB is visable.

I'n not sure what to try next...  Can anyone help?

Neil

### Mike

Jul 11, 2018, 9:05:47 PM7/11/18
--
If memory serves you need to insmod the driver for those chips on 3.x.  I forget offhand what driver covers that chip, google should easily produce that answer.

Mike

### Alex Ferm

Oct 17, 2018, 6:04:34 PM10/17/18
to BeagleBoard
I use the following device tree fragment to set up my battery backed DS1307. I imagine all you have to do for the 3232 is change the compatible parameter.

&i2c2 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c2_pins>;

clock-frequency = <100000>;

cape_rtc0: cape_rtc0@68 {
compatible = "maxim,ds1307";
reg = <0x68>;
};
};