u-boot/drivers/rtc
Heinrich Schuchardt fb71c3f490 rtc: initialize emulated RTC from environment variable
Up to now the emulated RTC is initialized using the U-Boot build time.

With this patch the environment variable 'rtc_emul_epoch' can be used to
provide a better initial time. The variable is a decimal string with
the number of seconds since 1970-01-01. Here is an example where the RTC
had not been probed yet:

    => setenv rtc_emul_epoch 1610109000
    => date
    Date: 2021-01-08 (Friday)    Time: 12:30:00

If the variable does not exist, the U-Boot build time is used as fallback.

The environment variable may be set when shutting down the operating system
if the U-Boot environment is exposed to the OS (cf. ENV_IS_IN_FAT and
ENV_IS_IN_EXT4).

Suggested-by: Pablo Sebastián Greco <pgreco@centosproject.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30 14:20:27 +01:00
..
at91sam9_rtt.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
davinci.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ds164x.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
ds174x.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
ds1302.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ds1306.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ds1307.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
ds1337.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
ds1374.c rtc: ds1374: typo Watchdog 2020-04-24 16:40:09 -04:00
ds1556.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ds3231.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
ds3232.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
emul_rtc.c rtc: initialize emulated RTC from environment variable 2020-10-30 14:20:27 +01:00
ftrtc010.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
i2c_rtc_emul.c rtc: i2c_rtc_emul: catch any write to the "reset" register 2020-07-09 06:02:45 +02:00
imxdi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
isl1208.c rtc: Add read8 and write8 support to isl1208 driver 2018-10-08 14:45:02 -04:00
Kconfig rtc: initialize emulated RTC from environment variable 2020-10-30 14:20:27 +01:00
m41t11.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
m41t60.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
m41t62.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
m41t94.c Fix for Void function returning value in sbc35-a9g20 2009-11-27 16:26:11 -06:00
m48t35ax.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
Makefile rtc: provide an emulated RTC 2020-10-27 21:13:15 +01:00
max6900.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
mc13xxx-rtc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mc146818.c Patch queue for efi - 2018-07-25 2018-07-30 16:02:29 -04:00
mcfrtc.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
mk48t59.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
mvrtc.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
mvrtc.h drivers/rtc: convert mvrtc to DM 2018-06-05 20:19:09 -04:00
mx27rtc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mxsrtc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pcf2127.c rtc: pcf2127: provide ->write method 2020-07-09 06:02:45 +02:00
pcf8563.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
pl031.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
pt7c4338.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
rs5c372.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
rtc-lib.c rtc: export rtc_month_days() 2019-05-31 23:27:12 +02:00
rtc-uclass.c rtc: fall back to ->{read, write} if ->{read, write}8 are not provided 2020-07-09 06:02:45 +02:00
rv3029.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rv8803.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rx8010sj.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rx8025.c rtc, rx8025: add DM support 2019-07-29 09:32:12 -04:00
s3c24x0_rtc.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
s35392a.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
sandbox_rtc.c acpi: Support generation of I2C descriptor 2020-07-17 14:32:24 +08:00
stm32_rtc.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
x1205.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00