History log of /u-boot/drivers/rtc/m41t62.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""

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>

# 16a50b66 01-May-2024 Tom Rini <trini@konsulko.com>

rtc: Remove <common.h> and add needed includes

Remove <common.h> from this driver directory and when needed
add missing include files directly.

Signed-off-by: Tom Rini <trini@konsulko.com>

# fdef6b98 17-Mar-2023 Thomas Perrot <thomas.perrot@bootlin.com>

rtc: m41t62: implements read8/write8 operations

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>

# 65cc0e2a 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_* to CFG_SYS_*

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>

# 92cf458f 09-May-2021 Max Yang <MAX.YANG@deltaww.com>

rtc: m41t62: fix wrong register use for set/reset ST bit

Fix wrong register use when set/reset ST bit.
ST bit is in register M41T62_REG_SEC not in M41T62_REG_ALARM_HOUR.

I have not actually tested this. But this seemed buggy from inspection.

Fixes: 9bbe210512c4539 ("rtc: m41t62: add oscillator fail bit reset support")
Signed-off-by: Max Yang <max.yang@deltaww.com>

# 9bbe2105 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: add oscillator fail bit reset support

In case of empty battery or glitches the oscillator fail
bit might be set. This will reset the bit in the reset
routine.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# 8691198d 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: reset SQW in m41t62_rtc_reset

This takes care of resetting the 32kHz square wave, which is
used by some boards as clock source for the SoC.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b371accc 15-Feb-2020 Marek Vasut <marex@denx.de>

rtc: m41t62: add compatible for m41st87

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>

# 4e829e98 28-Mar-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

rtc: m41t62: add compatible for m41t82

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>

# c8c0242f 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Convert the RTC driver to support the driver model (DM)

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>

# 7afc4155 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Extract common RTC handling code to facilitate DM conversion

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>

# 4d3df956 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Break i2c_write() arguments to fix checkpatch warning

No functional change for this commit.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>

# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>

# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>

# 16a50b66 01-May-2024 Tom Rini <trini@konsulko.com>

rtc: Remove <common.h> and add needed includes

Remove <common.h> from this driver directory and when needed
add missing include files directly.

Signed-off-by: Tom Rini <trini@konsulko.com>

# fdef6b98 17-Mar-2023 Thomas Perrot <thomas.perrot@bootlin.com>

rtc: m41t62: implements read8/write8 operations

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>

# 65cc0e2a 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_* to CFG_SYS_*

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>

# 92cf458f 09-May-2021 Max Yang <MAX.YANG@deltaww.com>

rtc: m41t62: fix wrong register use for set/reset ST bit

Fix wrong register use when set/reset ST bit.
ST bit is in register M41T62_REG_SEC not in M41T62_REG_ALARM_HOUR.

I have not actually tested this. But this seemed buggy from inspection.

Fixes: 9bbe210512c4539 ("rtc: m41t62: add oscillator fail bit reset support")
Signed-off-by: Max Yang <max.yang@deltaww.com>

# 9bbe2105 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: add oscillator fail bit reset support

In case of empty battery or glitches the oscillator fail
bit might be set. This will reset the bit in the reset
routine.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# 8691198d 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: reset SQW in m41t62_rtc_reset

This takes care of resetting the 32kHz square wave, which is
used by some boards as clock source for the SoC.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b371accc 15-Feb-2020 Marek Vasut <marex@denx.de>

rtc: m41t62: add compatible for m41st87

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>

# 4e829e98 28-Mar-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

rtc: m41t62: add compatible for m41t82

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>

# c8c0242f 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Convert the RTC driver to support the driver model (DM)

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>

# 7afc4155 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Extract common RTC handling code to facilitate DM conversion

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>

# 4d3df956 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Break i2c_write() arguments to fix checkpatch warning

No functional change for this commit.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>

# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>

# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>

# fdef6b98 17-Mar-2023 Thomas Perrot <thomas.perrot@bootlin.com>

rtc: m41t62: implements read8/write8 operations

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>

# 65cc0e2a 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_* to CFG_SYS_*

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>

# 92cf458f 09-May-2021 Max Yang <MAX.YANG@deltaww.com>

rtc: m41t62: fix wrong register use for set/reset ST bit

Fix wrong register use when set/reset ST bit.
ST bit is in register M41T62_REG_SEC not in M41T62_REG_ALARM_HOUR.

I have not actually tested this. But this seemed buggy from inspection.

Fixes: 9bbe210512c4539 ("rtc: m41t62: add oscillator fail bit reset support")
Signed-off-by: Max Yang <max.yang@deltaww.com>

# 9bbe2105 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: add oscillator fail bit reset support

In case of empty battery or glitches the oscillator fail
bit might be set. This will reset the bit in the reset
routine.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# 8691198d 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: reset SQW in m41t62_rtc_reset

This takes care of resetting the 32kHz square wave, which is
used by some boards as clock source for the SoC.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b371accc 15-Feb-2020 Marek Vasut <marex@denx.de>

rtc: m41t62: add compatible for m41st87

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>

# 4e829e98 28-Mar-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

rtc: m41t62: add compatible for m41t82

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>

# c8c0242f 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Convert the RTC driver to support the driver model (DM)

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>

# 7afc4155 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Extract common RTC handling code to facilitate DM conversion

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>

# 4d3df956 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Break i2c_write() arguments to fix checkpatch warning

No functional change for this commit.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>

# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>

# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>

# 65cc0e2a 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_* to CFG_SYS_*

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>

# 92cf458f 09-May-2021 Max Yang <MAX.YANG@deltaww.com>

rtc: m41t62: fix wrong register use for set/reset ST bit

Fix wrong register use when set/reset ST bit.
ST bit is in register M41T62_REG_SEC not in M41T62_REG_ALARM_HOUR.

I have not actually tested this. But this seemed buggy from inspection.

Fixes: 9bbe210512c4539 ("rtc: m41t62: add oscillator fail bit reset support")
Signed-off-by: Max Yang <max.yang@deltaww.com>

# 9bbe2105 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: add oscillator fail bit reset support

In case of empty battery or glitches the oscillator fail
bit might be set. This will reset the bit in the reset
routine.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# 8691198d 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: reset SQW in m41t62_rtc_reset

This takes care of resetting the 32kHz square wave, which is
used by some boards as clock source for the SoC.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b371accc 15-Feb-2020 Marek Vasut <marex@denx.de>

rtc: m41t62: add compatible for m41st87

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>

# 4e829e98 28-Mar-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

rtc: m41t62: add compatible for m41t82

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>

# c8c0242f 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Convert the RTC driver to support the driver model (DM)

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>

# 7afc4155 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Extract common RTC handling code to facilitate DM conversion

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>

# 4d3df956 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Break i2c_write() arguments to fix checkpatch warning

No functional change for this commit.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>

# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>

# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>

# 92cf458f 09-May-2021 Max Yang <MAX.YANG@deltaww.com>

rtc: m41t62: fix wrong register use for set/reset ST bit

Fix wrong register use when set/reset ST bit.
ST bit is in register M41T62_REG_SEC not in M41T62_REG_ALARM_HOUR.

I have not actually tested this. But this seemed buggy from inspection.

Fixes: 9bbe210512c4539 ("rtc: m41t62: add oscillator fail bit reset support")
Signed-off-by: Max Yang <max.yang@deltaww.com>

# 9bbe2105 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: add oscillator fail bit reset support

In case of empty battery or glitches the oscillator fail
bit might be set. This will reset the bit in the reset
routine.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# 8691198d 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: reset SQW in m41t62_rtc_reset

This takes care of resetting the 32kHz square wave, which is
used by some boards as clock source for the SoC.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b371accc 15-Feb-2020 Marek Vasut <marex@denx.de>

rtc: m41t62: add compatible for m41st87

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>

# 4e829e98 28-Mar-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

rtc: m41t62: add compatible for m41t82

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>

# c8c0242f 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Convert the RTC driver to support the driver model (DM)

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>

# 7afc4155 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Extract common RTC handling code to facilitate DM conversion

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>

# 4d3df956 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Break i2c_write() arguments to fix checkpatch warning

No functional change for this commit.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>

# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>

# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>

# 9bbe2105 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: add oscillator fail bit reset support

In case of empty battery or glitches the oscillator fail
bit might be set. This will reset the bit in the reset
routine.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# 8691198d 02-Sep-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

rtc: m41t62: reset SQW in m41t62_rtc_reset

This takes care of resetting the 32kHz square wave, which is
used by some boards as clock source for the SoC.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b371accc 15-Feb-2020 Marek Vasut <marex@denx.de>

rtc: m41t62: add compatible for m41st87

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>

# 4e829e98 28-Mar-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

rtc: m41t62: add compatible for m41t82

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>

# c8c0242f 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Convert the RTC driver to support the driver model (DM)

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>

# 7afc4155 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Extract common RTC handling code to facilitate DM conversion

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>

# 4d3df956 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Break i2c_write() arguments to fix checkpatch warning

No functional change for this commit.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>

# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>

# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b371accc 15-Feb-2020 Marek Vasut <marex@denx.de>

rtc: m41t62: add compatible for m41st87

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>

# 4e829e98 28-Mar-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

rtc: m41t62: add compatible for m41t82

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>

# c8c0242f 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Convert the RTC driver to support the driver model (DM)

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>

# 7afc4155 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Extract common RTC handling code to facilitate DM conversion

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>

# 4d3df956 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Break i2c_write() arguments to fix checkpatch warning

No functional change for this commit.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>

# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>

# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>

# b371accc 15-Feb-2020 Marek Vasut <marex@denx.de>

rtc: m41t62: add compatible for m41st87

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>

# 4e829e98 28-Mar-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

rtc: m41t62: add compatible for m41t82

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>

# c8c0242f 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Convert the RTC driver to support the driver model (DM)

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>

# 7afc4155 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Extract common RTC handling code to facilitate DM conversion

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>

# 4d3df956 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Break i2c_write() arguments to fix checkpatch warning

No functional change for this commit.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>

# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>

# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>

# 4e829e98 28-Mar-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

rtc: m41t62: add compatible for m41t82

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>

# c8c0242f 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Convert the RTC driver to support the driver model (DM)

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>

# 7afc4155 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Extract common RTC handling code to facilitate DM conversion

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>

# 4d3df956 22-Nov-2018 Lukasz Majewski <lukma@denx.de>

rtc: m41t62: Break i2c_write() arguments to fix checkpatch warning

No functional change for this commit.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>

# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>

# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>

# 5d889024 07-Jul-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

rtc: remove CONFIG_CMD_DATE dependency

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>


# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>


# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>


# 038f3c54 20-Jan-2012 Stefan Roese <sr@denx.de>

rtc/m41t62: Add support for M41T82 with HT (Halt Update)

Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.

The M41T82 support will be used by the X600 (SPEAr600)
board support.

Signed-off-by: Stefan Roese <sr@denx.de>


# 885fc78c 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Switch from per-driver to common definition of bin2bcd and bcd2bin

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>


# e84aba13 13-Aug-2009 Albin Tonnerre <albin.tonnerre@free-electrons.com>

Replace BCD2BIN and BIN2BCD macros with inline functions

In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>


# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>


# d1e23194 01-Sep-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rtc: allow rtc_set to return an error and use it in cmd_date

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>


# 0072b78b 30-Apr-2008 Stefan Roese <sr@denx.de>

RTC: Fix month offset by one problem in M41T62 RTC driver

This patch fixes a problem with the month being read and written
incorrectly (offset by one). This only gets visible by also using
the Linux driver (rtc-m41t80).

Tested on AMCC Canyonlands.

Signed-off-by: Stefan Roese <sr@denx.de>


# b73a19e1 20-Mar-2008 Yuri Tikhonov <yur@emcraft.com>

LWMON5: POST RTC fix

Modify the RTC API to provide one a status for the time reported by
the rtc_get() function:
0 - a reliable time is guaranteed,
< 0 - a reliable time isn't guaranteed (power fault, clock issues,
and so on).

The RTC chip drivers are responsible for providing this info if the
corresponding chip supports such functionality. If not - always
report that the time is reliable.

The POST RTC test was modified to detect the RTC faults utilizing
this new rtc_get() feature.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>


# 88aff62d 19-Feb-2008 Stefan Roese <sr@denx.de>

rtc: Add M41T62 support

This patch add support for the STM M41T62 RTC. It is used and tested
on the AMCC Canyonlands 406EX platform.

Signed-off-by: Stefan Roese <sr@denx.de>