summaryrefslogtreecommitdiff
path: root/drivers/rtc
AgeCommit message (Collapse)Author
2025-06-25rtc: add ds1672 driverTim Harvey
Add support for Dallas/Maxim ds1672 32bit counter RTC. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2025-02-10rtc: emul_rtc: Make emul_rtc_probe() staticMichal Simek
emul_rtc_probe() is not called from anywhere else that's why make it static. Issue is reported by build with W=1. Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-01-26drivers: rtc: max313xx: Ensure correct date is read after settingMark Tomlinson
When setting the time on the MAX31343, the time is not updated for one second, and reading the time in this interval will give the old time. Wait one second after writing so that the date command will show the correct time when setting the clock. Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz> Cc: Chris Packham <judge.packham@gmail.com> Reviewed-by: Chris Packham <judge.packham@gmail.com>
2025-01-26drivers: rtc: max313xx: Fix setting years 2100-2199Mark Tomlinson
An invalid calculation made setting years 2100-2199 impossible. Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz> Cc: Chris Packham <judge.packham@gmail.com> Reviewed-by: Chris Packham <judge.packham@gmail.com>
2025-01-14rtc: zynqmp: allow on Versal architecturesVincent Fazio
Allow the ZyncMP RTC driver to be enabled on Versal architectures. Also, require DM_RTC since the driver uses the RTC driver model. Signed-off-by: Vincent Fazio <vfazio@xes-inc.com> Link: https://lore.kernel.org/r/20250114135812.2605618-1-vfazio@xes-inc.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-12-06rtc: CONFIGS_RTC_PL031 must depend on CONFIGS_DM_RTCHeinrich Schuchardt
Building qemu_arm64_defconfig with CONFIGS_DM_RTC=n and CONFIGS_RTC_PL031=y leads to a build failure. Adjust the vexpress64 configuration to avoid circular dependency. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-10-11Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"Tom Rini
Simon Glass <sjg@chromium.org> says: When the SPL build-phase was first created it was designed to solve a particular problem (the need to init SDRAM so that U-Boot proper could be loaded). It has since expanded to become an important part of U-Boot, with three phases now present: TPL, VPL and SPL Due to this history, the term 'SPL' is used to mean both a particular phase (the one before U-Boot proper) and all the non-proper phases. This has become confusing. For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL' phases, not just SPL. So code which can only be compiled for actual SPL, for example, must use something like this: #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) In Makefiles we have similar issues. SPL_ has been used as a variable which expands to either SPL_ or nothing, to chose between options like CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was updated to support 'VPL_' as well. This series starts a change in terminology and usage to resolve the above issues: - The word 'xPL' is used instead of 'SPL' to mean a non-proper build - A new CONFIG_XPL_BUILD define indicates that the current build is an 'xPL' build - The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now defined for TPL and VPL phases - The existing SPL_ Makefile variable is renamed to SPL_ - The existing SPL_TPL Makefile variable is renamed to PHASE_ It should be noted that xpl_phase() can generally be used instead of the above CONFIGs without a code-space or run-time penalty. This series does not attempt to convert all of U-Boot to use this new terminology but it makes a start. In particular, renaming spl.h and common/spl seems like a bridge too far at this point. The series is fully bisectable. It has also been checked to ensure there are no code-size changes on any commit.
2024-10-11global: Rename SPL_TPL_ to PHASE_Simon Glass
Use PHASE_ as the symbol to select a particular XPL build. This means that SPL_TPL_ is no-longer set. Update the comment in bootstage to refer to this symbol, instead of SPL_ Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-02rtc: rv3028: add support to manage VDD regulatorArturo Buzarra
This commit adds support to manage an external regulator to enable the main power supply VDD. Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2024-07-22drivers: rtc: Remove duplicate newlinesMarek Vasut
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-07-14rtc: fix the description of the Goldfish RTC driverHeinrich Schuchardt
Replace the incorrect description that was copied from another driver. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07rtc: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06global: Audit usage of <eeprom.h>Tom Rini
The file include/eeprom.h is used only in some legacy non-DM I2C EEPROM access cases. Remove most inclusions of this file as they are not needed. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-10rtc: goldfish_rtc_probe should be staticHeinrich Schuchardt
There is no need to export goldfish_rtc_probe(). Fixes: 2d6dc19fd25d ("rtc: driver for Goldfish RTC") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-01-29treewide: Remove clk_freeSean Anderson
This function is a no-op. Remove it. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20231216193843.2463779-3-seanga2@gmail.com
2024-01-17rtc: driver for Goldfish RTCHeinrich Schuchardt
The Goldfish RTC is a virtual device which may be supplied by QEMU. It is enabled by default on QEMU's RISC-V virt machine. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-07-25drivers: rtc: max313xx: provide read8/write8Chris Packham
In some designs the MAX313xx RTC may need calibration to cope with oscillator inaccuracies. Provide read8/write8 ops so that the registers can be accessed. Because the driver covers a range of MAX313xx variants no attempt is made to ensure the register is valid. Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-03-30drivers: rtc: add max313xx series rtc driverChris Packham
Adding support for Analog Devices MAX313XX series RTCs. This is ported from the Linux driver and adapted for use in u-boot. Notable differences are - handling of tm_year and tm_mon differ - clock source support is omitted - hwmon support for the MAX31328 and MAX31343 is omitted - rtc_ops->reset is added Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30rtc: m41t62: implements read8/write8 operationsThomas Perrot
These operations are required by dm_rtc_read and dm_bootcount_get helpers. Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-02sandbox: Tidy up RTC optionsSimon Glass
At present we enable the sandbox RTC driver for all builds. Add a separate Kconfig option to control this, so that it can be disabled in TPL, where it is not needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07rtc: Drop old and unused driversSimon Glass
These drivers are not used and have not been converted to driver model. Drop them and references to the non-existent CONFIG options they use. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-11rtc: abx8xx: Add support for reading RAMSean Anderson
This adds support for reading the battery-backed memory present on these RTCs. This modifies the read/write methods to access the RAM instead of raw register offsets. No one was using these in-tree, so we should be fine changing them. We use the "standard" address space window to access the RAM. The extension RAM address register has some reserved bits, but we write the whole thing for simplicity (as these bits default to 0). Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2023-01-02rtc: add ht1380 driverSergei Antonov
Support Holtek HT1380/HT1381 Serial Timekeeper Chip. It provides seconds , minutes, hours, day of the week, date, month and year information. Datasheet: https://www.holtek.com.tw/documents/10179/11842/ht1380_1v130.pdf Signed-off-by: Sergei Antonov <saproj@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-23global: Migrate CONFIG_FTRTC010_PCLK to CFGTom Rini
Perform a simple rename of CONFIG_FTRTC010_PCLK to CFG_FTRTC010_PCLK Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-23global: Migrate CONFIG_FTRTC010_EXTCLK to CFGTom Rini
Perform a simple rename of CONFIG_FTRTC010_EXTCLK to CFG_FTRTC010_EXTCLK Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-22malta: Rename CONFIG_MALTA to CONFIG_TARGET_MALTATom Rini
Fixup this last remnant of CONFIG_MALTA. Cc: Paul Burton <paul.burton@mips.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-05Convert CONFIG_RTC_DS1337 et al to KconfigTom Rini
This converts the following to Kconfig: CONFIG_RTC_DS1337 CONFIG_RTC_DS1337_NOOSC CONFIG_RTC_DS1338 CONFIG_RTC_DS1374 CONFIG_RTC_DS3231 CONFIG_RTC_MC13XXX CONFIG_RTC_MXS CONFIG_RTC_PT7C4338 Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-05global: Move remaining CONFIG_SYS_* to CFG_SYS_*Tom Rini
The rest of the unmigrated CONFIG symbols in the CONFIG_SYS namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-05rtc: Remove unused driversTom Rini
These RTC drivers are currently unused and reference other unused CONFIG variables, so remove them. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10rtc: Remove unused driversTom Rini
These drivers are not enabled anywhere, remove them. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10Convert CONFIG_SYS_INTERLAKEN et al to KconfigTom Rini
This converts the following to Kconfig: CONFIG_SYS_INTERLAKEN CONFIG_SYS_ISA_IO CONFIG_SYS_ISA_IO_BASE_ADDRESS Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-07-21treewide: Fix Marek's name and change my e-mail addressMarek Behún
Fix diacritics in some instances of my name and change my e-mail address to kabel@kernel.org. Add corresponding .mailmap entries. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-06-08test: Load mac address using RTCSean Anderson
This uses the nvmem API to load a mac address from an RTC. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-05-05rtc: rv8803: fix off-by-one in month countingOliver Graute
tm_mon has a range from 0..11, but the RTC expects 1..12. So we adapt the month accordingly. This was determined when comparing the driver with the corresponding linux kernel driver. Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com> Reviewed-by: Michael Walle <michael@walle.cc> Reviewed-by: Heiko Schocher <hs@denx.de>
2022-05-02vpl: Add Kconfig options for VPLSimon Glass
Add VPL versions of commonly used Kconfig options. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-01Convert CONFIG_MCFRTC et al to KconfigTom Rini
This converts the following to Kconfig: CONFIG_MCFRTC CONFIG_SYS_MCFRTC_BASE While at it, remove '#undef RTC_DEBUG' from these config files. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-04drivers: rtc: fix null pointer access in armada38x_rtc_resetFrancois Berder
Replace null pointer by pointer to device registers when calling armada38x_rtc_write. Signed-off-by: Francois Berder <fberder@outlook.fr> Reviewed-by: Stefan Roese <sr@denx.de>
2022-02-17rtc: ds1307: Add bindings for microchip, mcp7940xPali Rohár
Compatible string microchip,mcp7940x is used by Turris Mox DTS file in Linux kernel and U-Boot ds1307.c driver works fine with it. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-02-01rtc: pcf2127: remove U-Boot specific compatible stringVladimir Oltean
Now that all in-tree boards have been converted to the compatible strings from Linux, delete the support for the ad-hoc "pcf2127-rtc" one. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Michael Walle <michael@walle.cc> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-02-01rtc: pcf2127: sync with Linux compatible stringsVladimir Oltean
Allow this driver to be used by boards which inherit their device trees from Linux. Compatibility is temporarily retained with the old compatible string which is U-Boot specific, and will be removed after a few changes. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Michael Walle <michael@walle.cc> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-11-11rtc: ds1337: fix compatible string typoClemens Gruber
The driver supports the ds1339 as well, which was probably intended by the author but prevented by a typo. Fix the typo. Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
2021-10-20Merge tag 'u-boot-imx-20211020' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20211020 ------------------- First PR from u-boot-imx for 2022.01 CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/9535 - new board: kontron-sl-mx8mm - imx8m: - fix secure boot - imx ESDHC: fixes - i.MX53: Support thum2, bmode and fixes for Menlo board usbarmory switch to Ethernet driver model - imx6 : - DDR calibration for Toradex boards - imx7: - Fixes - Updated gateworks boards (ventana / venice) # gpg verification failed.
2021-10-12rtc: ds1307: Handle oscillator-stop bit correctlyMark Tomlinson
The DS1307 driver was originally based on the DS1337 driver. However, the functionality of the clock set/get functions has diverged. In the original DS1337 driver, the set/get functions did the following: 1) Setting the clock ensured the oscillator was enabled. 2) Getting the clock checked and reset the oscillator-stop flag. The DS1307 does not have an oscillator-stop flag, but the driver tried (incorrectly) to emulate this by ensuring the oscillator was running. It really makes no sense to start a stopped clock without setting it. This patch makes the DS1307 driver behave like the original DS1337 driver again. For the DS1307 itself, this is just a removal of code, since there is no oscillator-fail bit to check or reset, and the clock is started when it is set. Since the DS1307 driver can now also be used for the DS1337 and DS1340 which do have this bit, add code to handle the oscillator-stop bit in the same was the original DS1337 driver did -- i.e. report that the oscillator had stopped and clear the flag. This means that setting the date using the date command (which does both a get and a set) will now clear the oscillator-stop flag in addition to setting and starting the clock. The old-style (non-DM) code has not been updated and will be removed in a future patch. Note that this older code does not support the DS1337, as there is a separate driver for this. Also note that the original (DM) code used the wrong control-register address for the DS1337. Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
2021-10-07rtc: rv8803: add epson,rx8803 and epson,rx8900 compatibleHeiko Thiery
The RX8803 and RX8900 register layouts are compatible with the one of the RV8803. So add these to the compatibles. The same compatible strings are used and approved in linux kernel. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Michael Walle <michael@walle.cc>
2021-10-03rtc: rx8025: revise single register write to use offsetMathew McBride
Writing of individual registers was not functioning correctly as a 0 'offset' byte under DM-managed I2C was being appended in front of register we wanted to access. Signed-off-by: Mathew McBride <matt@traverse.com.au>
2021-10-03rtc: rx8025: set date in a single i2c transactionMathew McBride
The RX8025/RX8035 does not like having it's time registers set byte-by-byte in separate I2C transactions. From the note at the top of the file, it appears target-dependent workarounds have been used in the past for this. Resolve this by setting the time registers in a single I2C transaction. As part of this, also ensure the '24/12' flag in the RTC is reset before writing the date (instead of after), otherwise the RX8035 will clear the seconds and minutes registers. Tested on Traverse Ten64 (NXP LS1088A) with RX8035. Signed-off-by: Mathew McBride <matt@traverse.com.au>
2021-10-03rtc: rx8025: add support for EPSON RX8035.Mathew McBride
The RX8035 is a newer model from EPSON which is very similar in operation to the RX8025. The changes mirror similar ones that will be in Linux 5.15: https://lore.kernel.org/all/20210709044518.28769-2-matt@traverse.com.au/ The UBOOT_DRIVER ID has also been corrected, previously it declared itself as rx8010sj_rtc which is a different driver. Signed-off-by: Mathew McBride <matt@traverse.com.au>
2021-10-03rtc: rx8025: drop non-DM supportMathew McBride
A search of the tree showed there is only one user of this driver (soon to be two) - board/socrates The second user will be the Traverse Ten64 board. Both these boards have DM_RTC. Signed-off-by: Mathew McBride <matt@traverse.com.au>