[PATCH v2 0/2] rtc: provide an emulated RTC

Pablo Sebastián Greco pgreco at centosproject.org
Thu Oct 29 11:27:53 CET 2020


Can I suggest as a future enhancement adding an option to also be able 
to read U_BOOT_EPOCH from env? Userspace tools could write the time on 
shutdown (like fakehwclock).
Ok, adding `date xxxxx` to the start script could work too, but it seems 
messy.

Pablo.

On 25/10/20 04:13, Heinrich Schuchardt wrote:
> On a board without hardware clock this software real time clock can be
> used. The build time is used to initialize the RTC. So you will have
> to adjust the time either manually using the 'date' command  or use
> the 'sntp' to update the RTC with the time from a network time server.
> See CONFIG_CMD_SNTP and CONFIG_BOOTP_NTPSERVER. The RTC time is
> advanced according to CPU ticks.
>
> v2:
> 	more elaborate Kconfig message
> 	adjust device name properties
> 	use build time as initial time
>
> Heinrich Schuchardt (2):
>    Makefile: provide constant with seconds since epoch
>    rtc: provide an emulated RTC
>
>   MAINTAINERS            |  1 +
>   Makefile               |  2 ++
>   drivers/rtc/Kconfig    | 11 ++++++
>   drivers/rtc/Makefile   |  1 +
>   drivers/rtc/emul_rtc.c | 80 ++++++++++++++++++++++++++++++++++++++++++
>   5 files changed, 95 insertions(+)
>   create mode 100644 drivers/rtc/emul_rtc.c
>
> --
> 2.28.0
>


More information about the U-Boot mailing list