RTC integration with kernel

77 views
Skip to first unread message

Neil Cobbett

unread,
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:

echo ds3232 0x68 > /sys/class/i2c-adapter/i2c-2/new_device

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

unread,
Jul 11, 2018, 9:05:47 PM7/11/18
to beagl...@googlegroups.com
--
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

unread,
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>;
};
};
Reply all
Reply to author
Forward
0 new messages