summaryrefslogtreecommitdiff
path: root/drivers/rtc
Commit message (Collapse)AuthorAgeFilesLines
* common: Drop linux/bitops.h from common headerWIP/2020-05-18-reduce-size-of-common.hSimon Glass2020-05-185-0/+5
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/delay.h from common headerSimon Glass2020-05-188-0/+8
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* Fix some checkpatch warnings in calls to udelay()Simon Glass2020-05-181-13/+13
| | | | | | | Fix up some incorrect code style in calls to functions in the linux/time.h header, mostly udelay(). Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop log.h from common headerSimon Glass2020-05-1817-0/+17
| | | | | | Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* Fix some checkpatch warnings in calls to debug()Simon Glass2020-05-181-6/+6
| | | | | | | Fix up some incorrect code style in calls to functions in the log.h header, mostly debug(). Signed-off-by: Simon Glass <sjg@chromium.org>
* rtc: pt7c4338: Add driver model supportBiwen Li2020-05-041-0/+100
| | | | | | | Add support of driver model of pt7c4338 Signed-off-by: Biwen Li <biwen.li@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
* rtc: ds1337: Add driver model supportBiwen Li2020-05-041-0/+128
| | | | | | | Add support of driver model of ds1337 Signed-off-by: Biwen Li <biwen.li@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
* rtc: pcf2127: don't add/subtract 1 to tm_monRasmus Villemoes2020-05-011-2/+2
| | | | | | | | | | | | As noted in rtc_def.h, the tm_mon field in struct rtc_time is 1-12, unlike in struct tm where it is 0-11. Currently, running "date" prints the wrong Date: 2020-04-01 (Friday) Time: 13:05:30 and setting the RTC via the date command is also broken. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
* rtc: ds1374: typo WatchdogHeinrich Schuchardt2020-04-241-1/+1
| | | | | | %s/Watchdoc/Watchdog/ Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* rtc: m41t62: add compatible for m41st87Marek Vasut2020-03-011-0/+1
| | | | | | | | | | This adds a compatible string for m41st87. This ensures that this driver can be used for m41st87. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Stefan Roese <sr@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
* dm: core: Create a new header file for 'compat' featuresSimon Glass2020-02-053-0/+4
| | | | | | | | | | | | At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* rtc: pcf8563: Add driver model supportBiwen Li2020-02-041-0/+107
| | | | | | | Add support of driver model of pcf8563 Signed-off-by: Biwen Li <biwen.li@nxp.com> Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
* rtc: s35392a: encode command correctlyIan Ray2020-01-271-11/+18
| | | | | | | | | The 3-bit "command", or register, is encoded within the device address. Configure the device accordingly, and pass command in DM I2C read/write calls correctly. Signed-off-by: Ian Ray <ian.ray@ge.com> Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* rtc: add support for DS3232 deviceHan Nandor2020-01-103-0/+283
| | | | | | | | | | DS3232 is an i2c RTC with 236 bytes of battery-backed SRAM. Add an RTC driver for DS3232 device, which provides time and date support. Also read and write functions are provided, which can be used to access the SRAM memory. Signed-off-by: Nandor Han <nandor.han@vaisala.com>
* rtc: rx8010js: add compatible stringRobert Beckett2019-12-271-0/+1
| | | | | | | Add compatible string used by Linux. Allows for simpler syncing of device trees. Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* rtc: s35392a: add compatible stringsRobert Beckett2019-12-271-0/+2
| | | | | | | Add compatible strings used by Linux. Allows for simpler syncing of device trees. Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* rtc: rx8010sj: fix DM initializationRobert Beckett2019-12-271-1/+1
| | | | | | pass the udevice by reference instead of double ref Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* rtc: move date.c from drivers/rtc/ to lib/AKASHI Takahiro2019-12-063-101/+1
| | | | | | | | In the next commit, rtc_mktime(), for compatibility with linux, will be implemented using rtc_mktime(), which is no longer drivers/rtc specific. So move this file under lib/. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* common: Move old EEPROM functions into a new headerWIP/2019-12-02-master-importsSimon Glass2019-12-021-0/+1
| | | | | | | | These functions do not use driver model but are still used. Move them to a new eeprom.h header file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* rtc: ds3231/ds3232: fix coding styleBiwen Li2019-09-191-1/+2
| | | | | | The patch fixes coding style Signed-off-by: Biwen Li <biwen.li@nxp.com>
* rtc: stm32: manage 2 digit limitation on yearPatrick Delaunay2019-08-271-2/+7
| | | | | | | | | | | STM32 RTC manages only 2 digits for YEAR (Year tens and units in BCD format in RTC_DR register). With this patch, RTC driver assumes that tm->tm_years is between 2000 and 2099; tm->tm_year - 2000 have only 2 digit (0 > and <= 99). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* rtc: ds3232/ds3231: Add support to generate 32KHz output for driver moduleChuanhua Han2019-08-222-0/+23
| | | | | | | | | | | Add an implementation of the rtc_enable_32khz_output() that uses the driver model i2c APIs. Also put code related to rtc_enable_32khz_output under CONFIG_RTC_ENABLE_32KHZ_OUTPUT. Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com> Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
* env: Move env_get() to env.hSimon Glass2019-08-111-0/+1
| | | | | | | Move env_get() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* rtc, rx8025: add DM supportHeiko Schocher2019-07-291-19/+135
| | | | | | add DM support for this RTC driver. Signed-off-by: Heiko Schocher <hs@denx.de>
* rtc, rx8025: fix Coding StyleHeiko Schocher2019-07-291-29/+29
| | | | | | fix Coding Style for this driver. Signed-off-by: Heiko Schocher <hs@denx.de>
* rtc: move RTC_RX8025 to KconfigHeiko Schocher2019-07-291-0/+5
| | | | | | move RTC_RX8025 to Kconfig and fixup board configs. Signed-off-by: Heiko Schocher <hs@denx.de>
* rtc: Add rtc driver for stm32mp1Patrick Delaunay2019-07-223-0/+330
| | | | | | | Add support of STM32MP1 rtc driver. Enable it for basic and trusted configurations. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
* rtc: Add DM support to ds3231Chuanhua Han2019-07-181-0/+107
| | | | | | | | Add an implementation of the ds3231 driver that uses the driver model i2c APIs. Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
* rtc: add Microcrystal RV-8803 driverMichael Walle2019-07-133-0/+178
| | | | Signed-off-by: Michael Walle <michael@walle.cc>
* rtc: ds1307: add support for m41t11Heiko Schocher2019-07-131-0/+14
| | | | | | | | | | add m41t11 support in ds1307 driver. changes: - add compatible string for m41t11 - check if RTC clock is running, if not enable the clock Signed-off-by: Heiko Schocher <hs@denx.de>
* rtc: pcf2127: Fixed bug with rtc settings and getting error timeChuanhua Han2019-07-091-9/+24
| | | | | | | | | | | | | | | | | | The previous pcf2127 RTC chip could not read and set the correct time. When reading the data of internal registers, the read address was the value of register plus 1. This is because this chip requires the host to send a stop signal after setting the register address and before reading the register data. This patch sets the register address using dm_i2c_write and reads the register data using the original dm_i2c_xfer in order to generate a stop signal after the register address is set, and fixes the bug of the original read and write time. Signed-off-by: Biwen Li <biwen.li@nxp.com> Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
* rtc: export rtc_month_days()Heinrich Schuchardt2019-05-311-1/+1
| | | | | | Export function rtc_month_days() for reuse in the UEFI subsystem. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* rtc: m41t62: add compatible for m41t82Simon Goldschmidt2019-04-251-0/+11
| | | | | | | | | | | | | | This adds a compatible string for m41t82. This ensures that this driver can be used for m41t82 in DM mode, too (asit was usable for this model in non-DM mode before). In addition, the HT bit has to be reset during probe, since the m41t82 chip sets it when entering battery standby mode. This patch ensures this driver works on socfpga_socrates. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
* rtc: m41t62: Convert the RTC driver to support the driver model (DM)Lukasz Majewski2018-12-031-0/+77
| | | | | | | | After this change the m41t62.c can be used with RTC subsystem (i.e. date command) which uses device model (DM). Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
* rtc: m41t62: Extract common RTC handling code to facilitate DM conversionLukasz Majewski2018-12-031-12/+20
| | | | | | | | This change facilitates the conversion of m41t62 RTC driver to device model (DM). Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
* rtc: m41t62: Break i2c_write() arguments to fix checkpatch warningLukasz Majewski2018-12-031-1/+2
| | | | | | | No functional change for this commit. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
* Kconfig: Migrate CONFIG_RTC_M41T62 define to KconfigLukasz Majewski2018-12-031-0/+6
| | | | | | | | This patch moves the RTC M41T62 config define to Kconfig. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* drivers: rtc: correctly convert seconds to time structureHeinrich Schuchardt2018-12-011-1/+5
| | | | | | | | | Variable 'days' must be defined as signed int. Otherwise the conversion fails for some dates, e.g. 2004-08-25. Cf function rtc_time64_to_tm() in the Linux kernel source. Fixes: 992c1db45591 "drivers: rtc: resolve year 2038 problem in rtc_to_tm" Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Merge tag 'for-master-20181130' of git://git.denx.de/u-boot-rockchipTom Rini2018-12-012-137/+453
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Improvements: - RK3188 USB-UART functionality - errors triggering a hard-stop in SPL on the RK3399 are reported - Rockchip RV1108 (SoC) support - MicroCrystal RV3029 (RTC) DM driver Fixes: - RK3188 early UART setup - limit SD-card frequency to 40MHz on the RK3399-Q7 - MIPI fixes - RK3399 CPUB clock initialisation
| * rtc: rv3029: update to support DM and sync with Linux 4.17Philipp Tomsich2018-11-301-137/+443
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Flamingo" carrier-board for the RK3399-Q7 has a RV3029 populated and the application will use the off-module RV3029 RTC including the battery backed SRAM. To support this use case, this commit includes the following changes: * updates the rv3029 driver to use DM * implements the read8/write8 operations This syncs the implementation with the Linux code (based on 4.17), porting the trickle-charger support from there (with improvements to avoid unnecessary EEPROM updates) and adheres to the Linux DTS binding. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
| * rtc: rv3029: add to KconfigPhilipp Tomsich2018-11-301-0/+10
| | | | | | | | | | | | | | | | The MicroCrystal RV3029 driver didn't have a Kconfig entry and was not used anywhere. Add it to Kconfig to make it selectable. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
* | rtc: Allow child driversSimon Glass2018-11-291-0/+1
|/ | | | | | | Some RTC chips have child drivers, e.g. to provide access to their non-volatile RAM. Scan for these when binding. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge tag 'dm-9oct18' of git://git.denx.de/u-boot-dmTom Rini2018-10-102-1/+27
|\ | | | | | | | | | | Test improvements to tidy up output and drop duplicate tests Sandbox SPL/TPL support Various dm-related improvements
| * rtc: Allow use of RTC in SPL and TPLSimon Glass2018-10-092-1/+19
| | | | | | | | | | | | | | Add Kconfig options so that the RTC can be used in SPL and TPL. This is helpful for accessing the contents of CMOS RAM, for example. Signed-off-by: Simon Glass <sjg@chromium.org>
| * Kconfig: Convert CONFIG_RTC_MC146818 to KconfigSimon Glass2018-10-091-0/+8
| | | | | | | | | | | | Move this option to Kconfig and tidy up the two boards which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | rtc: Add read8 and write8 support to isl1208 driverTrent Piepho2018-10-081-0/+20
|/ | | | | | | | | | | | | This can be used for device register access from board code. This allows access to capabilities in the RTC chip not abstracted in U-Boot's RTC class. E.g., device NVRAM or a tamper detection circuit. Cc: Klaus Goger <klaus.goger@theobroma-systems.com> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Trent Piepho <tpiepho@impinj.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* rtc: pl031: convert the driver to driver modelAKASHI Takahiro2018-09-231-46/+80
| | | | | | | | With this patch, PL031 driver is converted to driver-model-compliant driver. In addition, CONFIG_SYS_RTC_PL031_BASE is no longer valid. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini2018-07-3024-89/+0
|\ | | | | | | | | | | | | | | | | | | | | Patch queue for efi - 2018-07-25 Highlights this time: - Many small fixes to improve spec compatibility (found by SCT) - Almost enough to run with sandbox target - GetTime() improvements - Enable EFI_LOADER and HYP entry on ARMv7 with NONSEC=y
| * rtc: remove CONFIG_CMD_DATE dependencyHeinrich Schuchardt2018-07-2524-89/+0
| | | | | | | | | | | | | | | | | | The EFI subsystem accesses the real time clock and is enabled by default. So we should drop any CONFIG_CMD_DATE dependency from the real time clock drivers. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* | drivers: rtc: correctly set week day for mc146818Heinrich Schuchardt2018-07-281-1/+2
| | | | | | | | | | | | | | | | | | | | The driver sets the weekday incorrectly when called by the 'date set' command. Sunday is 1, Saturday is 7 unlike in U-Boot (see data sheet https://www.nxp.com/docs/en/data-sheet/MC146818.pdf, table 3). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>