Hi, our custom board will use the on-board battery backed RTC on the LS1020a processor. In the meantime, I'm trying to use that (on-chip) RTC on the LS1021ATWR dev board. Eventually I would like to configure it as RTC0 and link it to hwclock. I can't seem to get my system to link the driver and the device (if the device is even recognized).
Can anyone help me configure Linux to use the on-chip LP RTC as RTC0?
Here is what I've done:
To ls1021a.dtsi I added the following node under "soc":
sec_mon: sec_mon@1e90000 {
compatible = "fsl,sec-v4.0-mon";
#address-cells = <1>;
#size_cells = <1>;
ranges = <0 0x01e90000 0x10000>;
interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
snvs_rtc: snvc_rtc_lp@34 {
compatible = "fsl, sec-v4.0-mon-rtc-lp";
reg = <0x34 0x58>;
};
};
To ls1021atwr.dts I added the following node at the end of the file:
&svns_rtc {
status = "okay";
};
--------------------------------------------------------------------------------
Now, when I load and run, I see:
But, the driver doesn't seem to be bound to the device. I actually tried:
echo -n "sec_mon.3" > /sys/bus/platform/drivers/snvs_rtc/bind
but the OS returned "No such device"
Some things I think might be wrong:
Thanks in advance.
I've made more progress, getting the driver bound to the device (it even shows up as RTC0!). The required change from my previous post was to move the "interrupts = ..." line from the sec_mon parent node into the snvs_rtc child node.
Now the problem is that the system crashes, I assume when the alarm interrupt fires or is supposed to fire. The interrupts I've configured are mapped to the SEC_MON, without a real SEC_MON driver, we may not be able to handle interrupts properly. Does anyone have any suggestions for SVNS_RTC interrupt values for the LS1021A? Thanks.
Or, the problem could be stalls due to the fact that there is no 32KHz clock on the BB_RTC pin on this LS1021aTWR dev board.
I've made some progress - I now see "1e90034.snvs_rtc_lp " in /sys/bus/platform/devices. It's still not bound to the snvs_rtc driver, but it's progress. Here's the .dts tree entry:
sec_mon: sec_mon@1e90000 {
compatible = "fsl,sec-v4.0-mon", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0 0x01e90000 0x10000>;
interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
snvs_rtc: snvs_rtc_lp@34 {
compatible = "fsl,sec-v4.0-mon-rtc-lp";
reg = <0x34 0x58>;
};
};
The feature you are trying to use is not officially supported by the SDK. You can try following the instructions given
in Chapter 27 of i.MX Linux Reference Manual. There is, however, no guarantee that it will work as you expect.
If it does not, debug your kernel.
Have a great day,
Platon
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Have a great day,
Platon