DragonBoard 410c RTC with PM8916

Hi,
I want to set RTC time, but it can’t work.
And I check “lm80-p0436-36_a_pm8916_hrd.pdf” of 31.RTC_RW, it is not defined WRITE data register description.

The register define are as below:
0x00006004 RTC_RW_PERPH_TYPE
0x00006005 RTC_RW_PERPH_SUBTYPE
0x00006008 RTC_RW_STATUS1
0x00006046 RTC_RW_EN_CTL1
0x00006048 RTC_RW_RDATA0
0x00006049 RTC_RW_RDATA1
0x0000604A RTC_RW_RDATA2
0x0000604B RTC_RW_RDATA3

The source code define 0x00006040 of write address, but it still can’t work of RTC set time.
What address should I define to set RTC time?

fyi,

afaik we cannot modify the registers of RTC.

In android, date is set somewhere in the userdata partition ,RTC date is always 1970,
/system/vendor/lib64/libtime_genoff.so - library used to set the date.
delta between new date and 1970 will be stored if vcoin is present.

In general, when we erase userdata partion , date will get reset to 1970 even the vcoin is present.

regards,
vinaysimha

hello

Why can’t modify the registers of RTC?
Anyone Know any method to setup registers?
thanks…

Why do you want to modify the registers, when the date is working properly in android?
Are you trying in linux?

regards,
vinaysimha

Hi Vinaysimha

 i use in linux.
 when power off the date need working ,so need setup RTC time.

this is the driver for the RTC on this platform:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/rtc/rtc-pm8xxx.c?id=refs/tags/v4.2#n432

There should be a DT entry for it in the release that you are using and the driver should have been enabled in the kernel config (CONFIG_RTC_DRV_PM8XXX). could you check for these things?

also please do realize that there is no battery supporting the RTC hardware though.

Hi Miles,

Up until PM8921 you could enable support for RTC writes, but after that (i.e. on e.g. PM8916) the PMIC is configured so that the user cannot set the RTC. Most likely the RTC is made read only to allow the different subsystems in the SoC to read it directly, without it jumping around on them - but I’ve not found any documentation confirming this.

As Vinay mentioned Qualcomm handles this in their Android builds by keeping track of the offset from the RTC. And as Jorge mention there’s no coincell mounted on the DB410c, so unless you mount this your RTC will reset once you disconnect power and USB.

Regards,
Bjorn

Hi all,

I am sure to enable CONFIG_RTC_DRV_PM8XXX, and RTC can read via command “hwclock -r”.
Except RTC writing error, I have another RTC question.
The RTC counter was late 10 minutes for every 1 hour when power off, does anyone have the same question?
How should I resolve it?

Hi All,

I also meet RTC counter was late 10 minutes for every 1 hour when power off.
I’m using coin to keep RTC work when power off.
But RTC counter was late 10 minutes for every 1 hour.
Does anyone know how to increase the accuracy for RTC with coin?

Thanks.

Best regards,
Johnny

hi,
i also used coin battery to keep the rtc running and experience delay.
anyone got a solution or have any more information how this can happen?

Hi all,

Does anyone can check the question of “The RTC counter was late 10 minutes for every 1 hour when power off”
How could I resolve it?
Linaro kernel version 16.06

Thanks.

Hello,

I have also experience a delay.
Does any one found any workaround solution here ?

Dear all,

Anyone have solution to prevent delay of RTC?

I don’t think there is any way to prevent the RTC ticking at the wrong rate (at least not if are using firmware designed for DB410C).

However tools like hwclock can work with a control file called /etc/adjtime allowing a correction factor to be applied whenever the system clock is refreshed from the RTC.

hello, excuse me, is there any ready-made solution for offline use of dragonboard 410c? so that when the power is interrupted, time is maintained. so that when the power is interrupted, system processes end normally. To which pins should the battery be connected to the pm8916 for the built-in RTC to work. Will everything be fine if you connect 3.7 power to j14?