This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM4388: System date is reset on reboot

Part Number: AM4388

Tool/software: Linux

Dear Team

When we set date on the secure custom board, the date is reset again on next booting. We have tried the following so far:

# dmesg | grep rtc

root@am438x-epos-evm:~# dmesg | grep rtc
[ 0.280336] platform 44e3e000.rtc: Cannot lookup hwmod 'rtc'
[ 2.517325] hctosys: unable to open rtc device (rtc0)
[ 11.059882] omap_rtc 44e3e000.rtc: _od_fail_runtime_resume: FIXME: missing hwmod/omap_dev info
[ 11.060973] Modules linked in: rtc_omap(+) wkup_m3_rproc(+) remoteproc sch_fq_codel uio_module_drv(O) uio cryptodev(O) cmemk(O)
[ 11.061363] [<bf057ee4>] (omap_rtc_probe [rtc_omap]) from [<c054b53c>] (platform_drv_probe+0x58/0xb4)
[ 11.061472] [<c054b44c>] (__platform_driver_register) from [<bf05d01c>] (omap_rtc_driver_init+0x1c/0x1000 [rtc_omap])
[ 11.061490] [<bf05d000>] (omap_rtc_driver_init [rtc_omap]) from [<c0101a7c>] (do_one_initcall+0x4c/0x170)
[ 11.087344] Modules linked in: omap_wdt(+) rtc_omap(+) wkup_m3_rproc(+) remoteproc sch_fq_codel uio_module_drv(O) uio cryptodev(O) cmemk(O)
[ 11.087673] [<bf057ee4>] (omap_rtc_probe [rtc_omap]) from [<c054b53c>] (platform_drv_probe+0x58/0xb4)
[ 11.087784] [<c054b44c>] (__platform_driver_register) from [<bf05d01c>] (omap_rtc_driver_init+0x1c/0x1000 [rtc_omap])
[ 11.087802] [<bf05d000>] (omap_rtc_driver_init [rtc_omap]) from [<c0101a7c>] (do_one_initcall+0x4c/0x170)
[ 11.088075] Modules linked in: omap_wdt(+) rtc_omap(+) wkup_m3_rproc(+) remoteproc sch_fq_codel uio_module_drv(O) uio cryptodev(O) cmemk(O)
[ 11.088126] PC is at omap_rtc_probe+0x150/0x524 [rtc_omap]
[ 11.088396] [<bf057ee4>] (omap_rtc_probe [rtc_omap]) from [<c054b53c>] (platform_drv_probe+0x58/0xb4)
[ 11.088502] [<c054b44c>] (__platform_driver_register) from [<bf05d01c>] (omap_rtc_driver_init+0x1c/0x1000 [rtc_omap])
[ 11.088517] [<bf05d000>] (omap_rtc_driver_init [rtc_omap]) from [<c0101a7c>] (do_one_initcall+0x4c/0x170)

So, I try to manually set the date in linux as:

root@am438x-epos-evm:~# date 121015182018

Mon Dec 10 15:18:00 UTC 2018


root@am438x-epos-evm:~# hwclock -w
hwclock: can't open '/dev/misc/rtc': No such file or directory


root@am438x-epos-evm:~# hwclock -r
hwclock: can't open '/dev/misc/rtc': No such file or directory

Since, it is showing the device is not created at /dev/misc/rtc, thus I modified the .dts file to add the following lines:

/* fixed 32k external oscillator clock */

clk_32k_rtc: clk_32k_rtc 

{
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <32768>;
};

&rtc {
clocks = <&clk_32k_rtc>, <&clk_32768_ck>;
clock-names = "ext-clk", "int-clk";
status = "okay";
};

But still to no avail. Please provide your suggestions to get the linux to read proper RTC time.