2019-03-04 20:12:17 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-03-04 20:17:38 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rtc: rv8803: re-initialize all Epson RX8803 registers on voltage loss
The reference manuals of both the RX8803 and RV8803 dictate that
"[On V2F/VLF = ] all registers must be initialized".
The RV-8803 application manual (rev. 1.6) further specifies that crossing
V_LOW2 threshold enables flag V2F and triggers a Power-On reset.
According to table 3.11 in the document, all control registers are
defined to sensible values.
However, The Epson RX-8803 doesn't offer the same guarantees.
It explicitly states:
During the initial power-up, the TEST bit is reset to "0" and the VLF
bit is set to "1".
∗ At this point, all other register values are _undefined_, so be sure to
perform a reset before using the module.
Commit d3700b6b6479 ("rtc: rv8803: Stop the clock while setting the time")
also had this rationale:
Indeed, all the registers must be initialized if the voltage has been
lower than VLOW2 (triggering V2F), but not low enough to trigger a POR.
We should follow the advice and initialize all applicable registers.
We can group the registers into 3 groups:
A) Already correctly handled registers:
* 0B-0Ch | Timer Counter | unused and disabled by clearing TE in 0Dh
* 0Dh | Extension Reg | already initialized in rv8803_regs_configure
* 0Eh | Flag Reg | handled in IRQ handler, except for VLF, VDET
* 0Eh | VLF, VDET | cleared in ->set_time
* 10h | 100th Seconds | Already reset via RESET bit
* 20-21h | Capture Buffer | holds timestamp unused by driver
* 2Fh | Event Control | resets automatically
B) Registers that are hardware initialized on POR, but not on VLF:
* 0Fh | Control Reg
* 2Ch | OSC Offset
C) RAM that is undefined on voltage loss:
* 00-06h | Date/Time
* 07h | RAM
* 08-0Ah | Alarm
This means we should initialize after VLF the registers in group B
(RV8803_CTRL and RV8803_OSC_OFFSET).
Group C is all-zero after voltage loss on the RV-8803, but undefined on
the RX-8803. This is ok for Date/Time because ->get_time returns an
error code for as long as the voltage loss flag is active. It's cleared
on ->set_time however. Zeroing both RAM and alarm ensures a fixed value
is read afterwards.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220426071056.1187235-4-s.hauer@pengutronix.de
2022-04-26 09:10:54 +02:00
|
|
|
|
2016-07-21 12:41:29 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-24 14:54:54 -06:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2023-11-22 19:16:11 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rtc: rv8803: re-initialize all Epson RX8803 registers on voltage loss
The reference manuals of both the RX8803 and RV8803 dictate that
"[On V2F/VLF = ] all registers must be initialized".
The RV-8803 application manual (rev. 1.6) further specifies that crossing
V_LOW2 threshold enables flag V2F and triggers a Power-On reset.
According to table 3.11 in the document, all control registers are
defined to sensible values.
However, The Epson RX-8803 doesn't offer the same guarantees.
It explicitly states:
During the initial power-up, the TEST bit is reset to "0" and the VLF
bit is set to "1".
∗ At this point, all other register values are _undefined_, so be sure to
perform a reset before using the module.
Commit d3700b6b6479 ("rtc: rv8803: Stop the clock while setting the time")
also had this rationale:
Indeed, all the registers must be initialized if the voltage has been
lower than VLOW2 (triggering V2F), but not low enough to trigger a POR.
We should follow the advice and initialize all applicable registers.
We can group the registers into 3 groups:
A) Already correctly handled registers:
* 0B-0Ch | Timer Counter | unused and disabled by clearing TE in 0Dh
* 0Dh | Extension Reg | already initialized in rv8803_regs_configure
* 0Eh | Flag Reg | handled in IRQ handler, except for VLF, VDET
* 0Eh | VLF, VDET | cleared in ->set_time
* 10h | 100th Seconds | Already reset via RESET bit
* 20-21h | Capture Buffer | holds timestamp unused by driver
* 2Fh | Event Control | resets automatically
B) Registers that are hardware initialized on POR, but not on VLF:
* 0Fh | Control Reg
* 2Ch | OSC Offset
C) RAM that is undefined on voltage loss:
* 00-06h | Date/Time
* 07h | RAM
* 08-0Ah | Alarm
This means we should initialize after VLF the registers in group B
(RV8803_CTRL and RV8803_OSC_OFFSET).
Group C is all-zero after voltage loss on the RV-8803, but undefined on
the RX-8803. This is ok for Date/Time because ->get_time returns an
error code for as long as the voltage loss flag is active. It's cleared
on ->set_time however. Zeroing both RAM and alarm ensures a fixed value
is read afterwards.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220426071056.1187235-4-s.hauer@pengutronix.de
2022-04-26 09:10:54 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rtc: rv8803: re-initialize all Epson RX8803 registers on voltage loss
The reference manuals of both the RX8803 and RV8803 dictate that
"[On V2F/VLF = ] all registers must be initialized".
The RV-8803 application manual (rev. 1.6) further specifies that crossing
V_LOW2 threshold enables flag V2F and triggers a Power-On reset.
According to table 3.11 in the document, all control registers are
defined to sensible values.
However, The Epson RX-8803 doesn't offer the same guarantees.
It explicitly states:
During the initial power-up, the TEST bit is reset to "0" and the VLF
bit is set to "1".
∗ At this point, all other register values are _undefined_, so be sure to
perform a reset before using the module.
Commit d3700b6b6479 ("rtc: rv8803: Stop the clock while setting the time")
also had this rationale:
Indeed, all the registers must be initialized if the voltage has been
lower than VLOW2 (triggering V2F), but not low enough to trigger a POR.
We should follow the advice and initialize all applicable registers.
We can group the registers into 3 groups:
A) Already correctly handled registers:
* 0B-0Ch | Timer Counter | unused and disabled by clearing TE in 0Dh
* 0Dh | Extension Reg | already initialized in rv8803_regs_configure
* 0Eh | Flag Reg | handled in IRQ handler, except for VLF, VDET
* 0Eh | VLF, VDET | cleared in ->set_time
* 10h | 100th Seconds | Already reset via RESET bit
* 20-21h | Capture Buffer | holds timestamp unused by driver
* 2Fh | Event Control | resets automatically
B) Registers that are hardware initialized on POR, but not on VLF:
* 0Fh | Control Reg
* 2Ch | OSC Offset
C) RAM that is undefined on voltage loss:
* 00-06h | Date/Time
* 07h | RAM
* 08-0Ah | Alarm
This means we should initialize after VLF the registers in group B
(RV8803_CTRL and RV8803_OSC_OFFSET).
Group C is all-zero after voltage loss on the RV-8803, but undefined on
the RX-8803. This is ok for Date/Time because ->get_time returns an
error code for as long as the voltage loss flag is active. It's cleared
on ->set_time however. Zeroing both RAM and alarm ensures a fixed value
is read afterwards.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220426071056.1187235-4-s.hauer@pengutronix.de
2022-04-26 09:10:54 +02:00
|
|
|
|
|
|
|
|
|
2016-06-29 16:40:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rtc: rv8803: re-initialize all Epson RX8803 registers on voltage loss
The reference manuals of both the RX8803 and RV8803 dictate that
"[On V2F/VLF = ] all registers must be initialized".
The RV-8803 application manual (rev. 1.6) further specifies that crossing
V_LOW2 threshold enables flag V2F and triggers a Power-On reset.
According to table 3.11 in the document, all control registers are
defined to sensible values.
However, The Epson RX-8803 doesn't offer the same guarantees.
It explicitly states:
During the initial power-up, the TEST bit is reset to "0" and the VLF
bit is set to "1".
∗ At this point, all other register values are _undefined_, so be sure to
perform a reset before using the module.
Commit d3700b6b6479 ("rtc: rv8803: Stop the clock while setting the time")
also had this rationale:
Indeed, all the registers must be initialized if the voltage has been
lower than VLOW2 (triggering V2F), but not low enough to trigger a POR.
We should follow the advice and initialize all applicable registers.
We can group the registers into 3 groups:
A) Already correctly handled registers:
* 0B-0Ch | Timer Counter | unused and disabled by clearing TE in 0Dh
* 0Dh | Extension Reg | already initialized in rv8803_regs_configure
* 0Eh | Flag Reg | handled in IRQ handler, except for VLF, VDET
* 0Eh | VLF, VDET | cleared in ->set_time
* 10h | 100th Seconds | Already reset via RESET bit
* 20-21h | Capture Buffer | holds timestamp unused by driver
* 2Fh | Event Control | resets automatically
B) Registers that are hardware initialized on POR, but not on VLF:
* 0Fh | Control Reg
* 2Ch | OSC Offset
C) RAM that is undefined on voltage loss:
* 00-06h | Date/Time
* 07h | RAM
* 08-0Ah | Alarm
This means we should initialize after VLF the registers in group B
(RV8803_CTRL and RV8803_OSC_OFFSET).
Group C is all-zero after voltage loss on the RV-8803, but undefined on
the RX-8803. This is ok for Date/Time because ->get_time returns an
error code for as long as the voltage loss flag is active. It's cleared
on ->set_time however. Zeroing both RAM and alarm ensures a fixed value
is read afterwards.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220426071056.1187235-4-s.hauer@pengutronix.de
2022-04-26 09:10:54 +02:00
|
|
|
|
2021-11-30 09:58:30 -03:00
|
|
|
|
2016-06-29 16:40:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2022-04-26 09:10:52 +02:00
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
2016-06-29 16:40:01 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rtc: rv8803: re-initialize all Epson RX8803 registers on voltage loss
The reference manuals of both the RX8803 and RV8803 dictate that
"[On V2F/VLF = ] all registers must be initialized".
The RV-8803 application manual (rev. 1.6) further specifies that crossing
V_LOW2 threshold enables flag V2F and triggers a Power-On reset.
According to table 3.11 in the document, all control registers are
defined to sensible values.
However, The Epson RX-8803 doesn't offer the same guarantees.
It explicitly states:
During the initial power-up, the TEST bit is reset to "0" and the VLF
bit is set to "1".
∗ At this point, all other register values are _undefined_, so be sure to
perform a reset before using the module.
Commit d3700b6b6479 ("rtc: rv8803: Stop the clock while setting the time")
also had this rationale:
Indeed, all the registers must be initialized if the voltage has been
lower than VLOW2 (triggering V2F), but not low enough to trigger a POR.
We should follow the advice and initialize all applicable registers.
We can group the registers into 3 groups:
A) Already correctly handled registers:
* 0B-0Ch | Timer Counter | unused and disabled by clearing TE in 0Dh
* 0Dh | Extension Reg | already initialized in rv8803_regs_configure
* 0Eh | Flag Reg | handled in IRQ handler, except for VLF, VDET
* 0Eh | VLF, VDET | cleared in ->set_time
* 10h | 100th Seconds | Already reset via RESET bit
* 20-21h | Capture Buffer | holds timestamp unused by driver
* 2Fh | Event Control | resets automatically
B) Registers that are hardware initialized on POR, but not on VLF:
* 0Fh | Control Reg
* 2Ch | OSC Offset
C) RAM that is undefined on voltage loss:
* 00-06h | Date/Time
* 07h | RAM
* 08-0Ah | Alarm
This means we should initialize after VLF the registers in group B
(RV8803_CTRL and RV8803_OSC_OFFSET).
Group C is all-zero after voltage loss on the RV-8803, but undefined on
the RX-8803. This is ok for Date/Time because ->get_time returns an
error code for as long as the voltage loss flag is active. It's cleared
on ->set_time however. Zeroing both RAM and alarm ensures a fixed value
is read afterwards.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220426071056.1187235-4-s.hauer@pengutronix.de
2022-04-26 09:10:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-26 09:10:53 +02:00
|
|
|
|
|
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
2022-04-26 09:10:53 +02:00
|
|
|
|
rtc: rv8803: re-initialize all Epson RX8803 registers on voltage loss
The reference manuals of both the RX8803 and RV8803 dictate that
"[On V2F/VLF = ] all registers must be initialized".
The RV-8803 application manual (rev. 1.6) further specifies that crossing
V_LOW2 threshold enables flag V2F and triggers a Power-On reset.
According to table 3.11 in the document, all control registers are
defined to sensible values.
However, The Epson RX-8803 doesn't offer the same guarantees.
It explicitly states:
During the initial power-up, the TEST bit is reset to "0" and the VLF
bit is set to "1".
∗ At this point, all other register values are _undefined_, so be sure to
perform a reset before using the module.
Commit d3700b6b6479 ("rtc: rv8803: Stop the clock while setting the time")
also had this rationale:
Indeed, all the registers must be initialized if the voltage has been
lower than VLOW2 (triggering V2F), but not low enough to trigger a POR.
We should follow the advice and initialize all applicable registers.
We can group the registers into 3 groups:
A) Already correctly handled registers:
* 0B-0Ch | Timer Counter | unused and disabled by clearing TE in 0Dh
* 0Dh | Extension Reg | already initialized in rv8803_regs_configure
* 0Eh | Flag Reg | handled in IRQ handler, except for VLF, VDET
* 0Eh | VLF, VDET | cleared in ->set_time
* 10h | 100th Seconds | Already reset via RESET bit
* 20-21h | Capture Buffer | holds timestamp unused by driver
* 2Fh | Event Control | resets automatically
B) Registers that are hardware initialized on POR, but not on VLF:
* 0Fh | Control Reg
* 2Ch | OSC Offset
C) RAM that is undefined on voltage loss:
* 00-06h | Date/Time
* 07h | RAM
* 08-0Ah | Alarm
This means we should initialize after VLF the registers in group B
(RV8803_CTRL and RV8803_OSC_OFFSET).
Group C is all-zero after voltage loss on the RV-8803, but undefined on
the RX-8803. This is ok for Date/Time because ->get_time returns an
error code for as long as the voltage loss flag is active. It's cleared
on ->set_time however. Zeroing both RAM and alarm ensures a fixed value
is read afterwards.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220426071056.1187235-4-s.hauer@pengutronix.de
2022-04-26 09:10:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
rtc: rv8803: re-initialize all Epson RX8803 registers on voltage loss
The reference manuals of both the RX8803 and RV8803 dictate that
"[On V2F/VLF = ] all registers must be initialized".
The RV-8803 application manual (rev. 1.6) further specifies that crossing
V_LOW2 threshold enables flag V2F and triggers a Power-On reset.
According to table 3.11 in the document, all control registers are
defined to sensible values.
However, The Epson RX-8803 doesn't offer the same guarantees.
It explicitly states:
During the initial power-up, the TEST bit is reset to "0" and the VLF
bit is set to "1".
∗ At this point, all other register values are _undefined_, so be sure to
perform a reset before using the module.
Commit d3700b6b6479 ("rtc: rv8803: Stop the clock while setting the time")
also had this rationale:
Indeed, all the registers must be initialized if the voltage has been
lower than VLOW2 (triggering V2F), but not low enough to trigger a POR.
We should follow the advice and initialize all applicable registers.
We can group the registers into 3 groups:
A) Already correctly handled registers:
* 0B-0Ch | Timer Counter | unused and disabled by clearing TE in 0Dh
* 0Dh | Extension Reg | already initialized in rv8803_regs_configure
* 0Eh | Flag Reg | handled in IRQ handler, except for VLF, VDET
* 0Eh | VLF, VDET | cleared in ->set_time
* 10h | 100th Seconds | Already reset via RESET bit
* 20-21h | Capture Buffer | holds timestamp unused by driver
* 2Fh | Event Control | resets automatically
B) Registers that are hardware initialized on POR, but not on VLF:
* 0Fh | Control Reg
* 2Ch | OSC Offset
C) RAM that is undefined on voltage loss:
* 00-06h | Date/Time
* 07h | RAM
* 08-0Ah | Alarm
This means we should initialize after VLF the registers in group B
(RV8803_CTRL and RV8803_OSC_OFFSET).
Group C is all-zero after voltage loss on the RV-8803, but undefined on
the RX-8803. This is ok for Date/Time because ->get_time returns an
error code for as long as the voltage loss flag is active. It's cleared
on ->set_time however. Zeroing both RAM and alarm ensures a fixed value
is read afterwards.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220426071056.1187235-4-s.hauer@pengutronix.de
2022-04-26 09:10:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-26 09:10:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:29 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:28 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:31 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-07-21 12:41:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-27 16:08:22 +08:00
|
|
|
|
|
|
|
|
|
2022-04-26 09:10:53 +02:00
|
|
|
|
2022-06-27 16:08:22 +08:00
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
|
|
|
|
|
2022-04-26 09:10:53 +02:00
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2016-07-21 12:41:32 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2022-11-23 10:55:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-01 10:33:59 +09:00
|
|
|
|
|
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-14 23:02:57 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-14 23:02:57 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2019-12-14 23:02:57 +01:00
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2019-12-14 23:02:57 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2019-12-14 23:02:57 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-14 23:02:56 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-06 11:42:04 +02:00
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2020-09-21 16:24:49 +08:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2017-07-06 11:42:04 +02:00
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-06 11:42:04 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-06 11:42:04 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2017-07-06 11:42:04 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2021-01-11 00:17:51 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-11 00:17:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2016-06-29 16:40:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-26 09:10:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-29 16:40:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-26 09:10:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-22 19:16:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-21 15:07:05 +02:00
|
|
|
|
2026-05-15 17:47:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-21 15:07:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2019-06-08 12:56:07 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2018-02-12 23:47:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 13:45:20 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2026-03-05 13:35:44 -06:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2016-07-21 12:41:30 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-06 11:42:03 +02:00
|
|
|
|
2019-08-19 00:00:41 +02:00
|
|
|
|
2017-07-06 11:42:03 +02:00
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2023-01-23 21:02:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2023-01-23 21:02:17 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-22 19:16:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2024-01-08 01:43:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
2022-04-26 09:10:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-12 23:47:33 +01:00
|
|
|
|
2019-03-04 11:03:46 +01:00
|
|
|
|
|
|
|
|
|
2020-11-09 17:34:08 +01:00
|
|
|
|
2018-02-12 23:47:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-09 17:34:06 +01:00
|
|
|
|
2018-02-12 23:47:33 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-02 12:22:14 +01:00
|
|
|
|
2017-03-03 11:29:12 -03:00
|
|
|
|
|
|
|
|
|
2018-08-27 23:23:43 +02:00
|
|
|
|
2017-03-03 11:29:12 -03:00
|
|
|
|
2018-08-27 23:23:44 +02:00
|
|
|
|
|
|
|
|
|
rtc: rv8803: re-initialize all Epson RX8803 registers on voltage loss
The reference manuals of both the RX8803 and RV8803 dictate that
"[On V2F/VLF = ] all registers must be initialized".
The RV-8803 application manual (rev. 1.6) further specifies that crossing
V_LOW2 threshold enables flag V2F and triggers a Power-On reset.
According to table 3.11 in the document, all control registers are
defined to sensible values.
However, The Epson RX-8803 doesn't offer the same guarantees.
It explicitly states:
During the initial power-up, the TEST bit is reset to "0" and the VLF
bit is set to "1".
∗ At this point, all other register values are _undefined_, so be sure to
perform a reset before using the module.
Commit d3700b6b6479 ("rtc: rv8803: Stop the clock while setting the time")
also had this rationale:
Indeed, all the registers must be initialized if the voltage has been
lower than VLOW2 (triggering V2F), but not low enough to trigger a POR.
We should follow the advice and initialize all applicable registers.
We can group the registers into 3 groups:
A) Already correctly handled registers:
* 0B-0Ch | Timer Counter | unused and disabled by clearing TE in 0Dh
* 0Dh | Extension Reg | already initialized in rv8803_regs_configure
* 0Eh | Flag Reg | handled in IRQ handler, except for VLF, VDET
* 0Eh | VLF, VDET | cleared in ->set_time
* 10h | 100th Seconds | Already reset via RESET bit
* 20-21h | Capture Buffer | holds timestamp unused by driver
* 2Fh | Event Control | resets automatically
B) Registers that are hardware initialized on POR, but not on VLF:
* 0Fh | Control Reg
* 2Ch | OSC Offset
C) RAM that is undefined on voltage loss:
* 00-06h | Date/Time
* 07h | RAM
* 08-0Ah | Alarm
This means we should initialize after VLF the registers in group B
(RV8803_CTRL and RV8803_OSC_OFFSET).
Group C is all-zero after voltage loss on the RV-8803, but undefined on
the RX-8803. This is ok for Date/Time because ->get_time returns an
error code for as long as the voltage loss flag is active. It's cleared
on ->set_time however. Zeroing both RAM and alarm ensures a fixed value
is read afterwards.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220426071056.1187235-4-s.hauer@pengutronix.de
2022-04-26 09:10:54 +02:00
|
|
|
|
2018-08-27 23:23:44 +02:00
|
|
|
|
2021-11-30 09:58:30 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-03 11:29:12 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-03 11:29:12 -03:00
|
|
|
|
2023-11-22 19:16:11 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
2023-05-05 14:11:36 +02:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-03-04 20:17:38 +01:00
|
|
|
|
2015-11-02 23:48:32 +01:00
|
|
|
|
|
|
|
|
|