I'm trying to add new RTC driver, the ST41M62. I've added this code to the dts file i2c-rtc-overlay.dts:
Code: Select all
/dts-v1/;
/ {
compatible = "brcm,bcm2708";
[email protected] {
target = <0xdeadbeef>;
__overlay__ {
#address-cells = <0x1>;
#size-cells = <0x0>;
status = "okay";
[email protected] {
compatible = "maxim,ds1307";
reg = <0x68>;
status = "disable";
linux,phandle = <0x1>;
phandle = <0x1>;
};
[email protected] {
compatible = "maxim,ds3231";
reg = <0x68>;
status = "disable";
linux,phandle = <0x2>;
phandle = <0x2>;
};
[email protected] {
compatible = "microchip,mcp7941x";
reg = <0x6f>;
status = "disable";
linux,phandle = <0x3>;
phandle = <0x3>;
};
[email protected] {
compatible = "nxp,pcf2127";
reg = <0x51>;
status = "disable";
linux,phandle = <0x4>;
phandle = <0x4>;
};
[email protected] {
compatible = "nxp,pcf8523";
reg = <0x68>;
status = "disable";
linux,phandle = <0x5>;
phandle = <0x5>;
};
[email protected] {
compatible = "nxp,pcf8563";
reg = <0x51>;
status = "disable";
linux,phandle = <0x6>;
phandle = <0x6>;
};
[email protected] {
compatible = "st,m41t62";
reg = <0x68>;
status = "disable";
linux,phandle = <0x7>;
phandle = <0x7>;
};
};
};
__overrides__ {
ds1307 = [00 00 00 01 73 74 61 74 75 73 00];
ds3231 = [00 00 00 02 73 74 61 74 75 73 00];
mcp7941x = [00 00 00 03 73 74 61 74 75 73 00];
pcf2127 = [00 00 00 04 73 74 61 74 75 73 00];
pcf8523 = [00 00 00 05 73 74 61 74 75 73 00];
pcf8563 = [00 00 00 06 73 74 61 74 75 73 00];
m41t62 = [00 00 00 07 73 74 61 74 75 73 00];
};
__symbols__ {
ds1307 = "/[email protected]/__overlay__/[email protected]";
mcp7941x = "/[email protected]/__overlay__/[email protected]";
ds3231 = "/[email protected]/__overlay__/[email protected]";
pcf2127 = "/[email protected]/__overlay__/[email protected]";
pcf8523 = "/[email protected]/__overlay__/[email protected]";
pcf8563 = "/[email protected]/__overlay__/[email protected]";
m41t62 = "/[email protected]/__overlay__/[email protected]";
};
__fixups__ {
i2c_arm = "/[email protected]:target:0";
};
__local_fixups__ {
fixup = "/__overrides__:ds1307:0", "/__overrides__:ds3231:0", "/__overrides__:mcp7941x:0", "/__overrides__:pcf2127:0", "/__overrides__:pcf8523:0", "/__overrides__:pcf8563:0", "/__overrides__:m41t62:0";
};
};
The driver is working fine, but the RTC has an initial value that it seems to be wrong:dtoverlay=i2c-rtc,m41t62
Code: Select all
# hwclock -r
hwclock: RTC_RD_TIME: Invalid argument
Code: Select all
# date
Thu Jan 1 00:00:31 UTC 1970
# hwclock -r
hwclock: RTC_RD_TIME: Invalid argument
# hwclock -w
# hwclock -r
Wed Dec 31 23:59:59 1969 0.000000 seconds
# date -s "2017-07-05 15:48:00"
Wed Jul 5 15:48:00 UTC 2017
# hwclock -w
# hwclock -r
Wed Jul 5 15:48:03 2017 0.000000 seconds
Best reagrds.