Since the Beaglebone Black RTC is not usable (I believe due to a hw bug), I’m using an external RTC chip (A Maxim / Dallas DS1338 on i2c2 at address 0x68), and informing the kernel about this using a device tree overlay.
I’m also disabling the onboard RTC using a (currently separate) device tree overlay, this is because otherwise the omap rtc gets enumerated first which leaves the kernel time starting at jan 1st 2000 on cold boot. The onboard rtc ends up being /dev/rtc0 (which is linked to by /dev/rtc) and ntpd does its clock drift adjustment vs this rtc-with-no-battery-backup etc. - it seemed best to just disable it, since I have another one which is actually battery-backed.
This seem to work, but I wanted to check that there wasn’t some other functionality I’d be harming by doing this?
If anyone is familiar with device tree overlays, I would also appreciate a review of these:
Firstly BB-DS1388-I2C2-68.dts - which I compile with:
dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o BB-DS1388-I2C2-68-00A0.dtbo BB-DS1388-I2C2-68.dts
/dts-v1/;
/plugin/;
/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”;
part-number = “BB-DS1388-I2C2-68”;
version = “00A0”;
fragment@0 {
target = <&i2c2>;
overlay {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&i2c2_pins>;
clock-frequency = <100000>;
status = “okay”;
capertc: rtc@68 { /* Real time clock defined as a child of the i2c2 bus */
compatible = “maxim,ds1338”;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x68>;
};
};
};
};
Secondly to disable the onboard RTC - BB-NO-OMAP-RTC.dts
dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o BB-NO-OMAP-RTC-00A0.dtbo BB-NO-OMAP-RTC.dts
/dts-v1/;
/plugin/;
/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”;
part-number = “BB-NO-OMAP-RTC”;
version = “00A0”;
fragment@0 {
target = <&rtc>;
overlay {
status = “disabled”;
};
};
};
Any feedback welcome!
Thanks,
Tim.