summaryrefslogtreecommitdiff
path: root/drivers/rtc
AgeCommit message (Collapse)Author
2026-02-02rtc: goldfish: Support platform data for non-DT probingKuan-Wei Chiu
Currently, the Goldfish RTC driver exclusively relies on device tree to retrieve the base address, failing immediately if dev_read_addr() returns FDT_ADDR_T_NONE. This restriction prevents the driver from being used on platforms that instantiate devices via U_BOOT_DRVINFO() instead of device tree, such as the QEMU m68k virt machine. Add support for platform data to address this limitation. Introduce a new .of_to_plat hook to handle device tree parsing and populate the platform data. Update the probe function to rely exclusively on this platform data, enabling support for both Device Tree and manual instantiation. Introduce a new header file include/goldfish_rtc.h to define the platform data structure. Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-11-28drivers: rtc: add RV3032 supportMichael Walle
Add support for the Microcrystal RV3032 RTC. Signed-off-by: Michael Walle <mwalle@kernel.org>
2025-11-28drivers: rtc: add PCF85063 supportMichael Walle
Add support for the Microcrystal RV8263 and compatible RTCs. The driver's name was taken from linux. It should work with any NXP PCF85063 compatible RTCs. It was tested with a RV8263. Signed-off-by: Michael Walle <mwalle@kernel.org>
2025-11-28drivers: rtc: convert tristate to boolMichael Walle
As u-boot doesn't have any loadable modules, tristate doesn't make sense. Convert it to bool. Signed-off-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-10-08rtc: Make U_BOOT_DRIVER entries uniqueTom Rini
All instances of the U_BOOT_DRIVER must use a unique name or they will lead to link time failures due to name space conflicts when both are present. In this case the driver was reusing the max313xx name. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-09-09drivers: rtc: max313xx: Add delay after setting dateBen Hoelker
The MAX31331 was not correctly updating the seconds when setting the time and would return the seconds previously set. Like the MAX31343, a delay needs to be added after setting the time. Wait one second after writing so that the date command shows the correct time. Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: Bruce Adams <bruce.adams@alliedtelesis.co.nz> Signed-off-by: Ben Hoelker <ben.hoelker@alliedtelesis.co.nz>
2025-08-14rtc: pl031: Correct function type of pl031_write_regTom Rini
When calling writel we do not have a return value to check or pass along. This function should therefore be void and not return what writel gives us. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-08-14rtc: mc146818: Fix building on more architecturesTom Rini
This driver makes calls to in8/out8(). On PowerPC these are separate and real calls but elsewhere they are able to simply be wrappers to inb/outb. Rework this logic to be able to build this driver on more platforms. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-08-14rtc: Tighten some rtc driver dependenciesTom Rini
The Marvell RTC rtc driver cannot build without access to some platform specific header files. Express that requirements in Kconfig as well. Signed-off-by: Tom Rini <trini@konsulko.com>
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>