linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Enable backup switch mode on RTCs via devicetree
@ 2023-02-01 14:34 Frieder Schrempf
  2023-02-01 14:34 ` [PATCH 6/7] arm64: dts: imx8mm-kontron: Remove useless trickle-diode-disable from RTC node Frieder Schrempf
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Frieder Schrempf @ 2023-02-01 14:34 UTC (permalink / raw)
  To: Alexandre Belloni, devicetree, linux-arm-kernel, linux-kernel,
	linux-rtc
  Cc: Frieder Schrempf, Alessandro Zummo, Krzysztof Kozlowski,
	Rob Herring, Sascha Hauer, Shawn Guo

From: Frieder Schrempf <frieder.schrempf@kontron.de>

Some RTC devices like the RV3028 have BSM disabled as factory default.
This makes the RTC quite useless if it is expected to preserve the
time on hardware that has a battery-buffered supply for the RTC.

Let boards that have a buffered supply for the RTC force the BSM to the
desired value via devicetree by setting the 'backup-switch-mode' property.

That way the RTC on the boards work as one would expect them to do without
any per-board intervention through userspace tools to enable BSM.

Frieder Schrempf (7):
  dt-bindings: rtc: Move RV3028 to separate binding file
  dt-bindings: rtc: Add backup-switch-mode property
  dt-bindings: rtc: microcrystal,rv3032: Add backup-switch-mode property
  rtc: Move BSM defines to separate header for DT usage
  rtc: class: Support setting backup switch mode from devicetree
  arm64: dts: imx8mm-kontron: Remove useless trickle-diode-disable from
    RTC node
  arm64: dts: imx8mm-kontron: Enable backup switch mode for RTC on OSM-S
    module

 .../bindings/rtc/microcrystal,rv3028.yaml     | 60 +++++++++++++++++++
 .../devicetree/bindings/rtc/rtc.yaml          |  7 +++
 .../devicetree/bindings/rtc/trivial-rtc.yaml  |  2 -
 .../dts/freescale/imx8mm-kontron-osm-s.dtsi   |  3 +-
 drivers/rtc/class.c                           | 14 +++++
 include/dt-bindings/rtc/rtc.h                 | 11 ++++
 include/uapi/linux/rtc.h                      |  6 +-
 7 files changed, 95 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/microcrystal,rv3028.yaml
 create mode 100644 include/dt-bindings/rtc/rtc.h

-- 
2.39.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 6/7] arm64: dts: imx8mm-kontron: Remove useless trickle-diode-disable from RTC node
  2023-02-01 14:34 [PATCH 0/7] Enable backup switch mode on RTCs via devicetree Frieder Schrempf
@ 2023-02-01 14:34 ` Frieder Schrempf
  2023-02-01 14:34 ` [PATCH 7/7] arm64: dts: imx8mm-kontron: Enable backup switch mode for RTC on OSM-S module Frieder Schrempf
  2023-02-01 16:15 ` [PATCH 0/7] Enable backup switch mode on RTCs via devicetree Alexandre Belloni
  2 siblings, 0 replies; 10+ messages in thread
From: Frieder Schrempf @ 2023-02-01 14:34 UTC (permalink / raw)
  To: devicetree, Krzysztof Kozlowski, linux-arm-kernel, linux-kernel,
	Rob Herring, Sascha Hauer, Shawn Guo
  Cc: Frieder Schrempf, Fabio Estevam, Heiko Thiery,
	Krzysztof Kozlowski, Marek Vasut, NXP Linux Team,
	Pengutronix Kernel Team

From: Frieder Schrempf <frieder.schrempf@kontron.de>

The RV3028 driver doesn't use this property. Remove it.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
 arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi
index 5172883717d1..131f98cf5a04 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi
@@ -206,7 +206,6 @@ rtc@52 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_rtc>;
 		interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_HIGH>;
-		trickle-diode-disable;
 	};
 };
 
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/7] arm64: dts: imx8mm-kontron: Enable backup switch mode for RTC on OSM-S module
  2023-02-01 14:34 [PATCH 0/7] Enable backup switch mode on RTCs via devicetree Frieder Schrempf
  2023-02-01 14:34 ` [PATCH 6/7] arm64: dts: imx8mm-kontron: Remove useless trickle-diode-disable from RTC node Frieder Schrempf
@ 2023-02-01 14:34 ` Frieder Schrempf
  2023-02-01 16:15 ` [PATCH 0/7] Enable backup switch mode on RTCs via devicetree Alexandre Belloni
  2 siblings, 0 replies; 10+ messages in thread
From: Frieder Schrempf @ 2023-02-01 14:34 UTC (permalink / raw)
  To: devicetree, Krzysztof Kozlowski, linux-arm-kernel, linux-kernel,
	Rob Herring, Sascha Hauer, Shawn Guo
  Cc: Frieder Schrempf, Fabio Estevam, Heiko Thiery,
	Krzysztof Kozlowski, Marek Vasut, NXP Linux Team,
	Pengutronix Kernel Team

From: Frieder Schrempf <frieder.schrempf@kontron.de>

The board has a battery backup supply for the RTC, but the factory
default is to have BSM disabled. Therefore the time will not be
preserved if the board is not supplied. Fix this by forcing the RTC
into BSM level mode.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
 arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi
index 131f98cf5a04..5188b5b718a0 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/rtc/rtc.h>
 #include "imx8mm.dtsi"
 
 / {
@@ -206,6 +207,7 @@ rtc@52 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_rtc>;
 		interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_HIGH>;
+		backup-switch-mode = <RTC_BSM_LEVEL>;
 	};
 };
 
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] Enable backup switch mode on RTCs via devicetree
  2023-02-01 14:34 [PATCH 0/7] Enable backup switch mode on RTCs via devicetree Frieder Schrempf
  2023-02-01 14:34 ` [PATCH 6/7] arm64: dts: imx8mm-kontron: Remove useless trickle-diode-disable from RTC node Frieder Schrempf
  2023-02-01 14:34 ` [PATCH 7/7] arm64: dts: imx8mm-kontron: Enable backup switch mode for RTC on OSM-S module Frieder Schrempf
@ 2023-02-01 16:15 ` Alexandre Belloni
  2023-02-01 16:26   ` Frieder Schrempf
  2 siblings, 1 reply; 10+ messages in thread
From: Alexandre Belloni @ 2023-02-01 16:15 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-rtc,
	Frieder Schrempf, Alessandro Zummo, Krzysztof Kozlowski,
	Rob Herring, Sascha Hauer, Shawn Guo

Hello,

You can't do that, this breaks an important use case and it is the
reason why I didn't use device tree in the beginning. What is wrong with
setting BSM from userspace? You will anyway have to set the time and
date from userspace for it to be saved.

On 01/02/2023 15:34:22+0100, Frieder Schrempf wrote:
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> Some RTC devices like the RV3028 have BSM disabled as factory default.
> This makes the RTC quite useless if it is expected to preserve the
> time on hardware that has a battery-buffered supply for the RTC.
> 
> Let boards that have a buffered supply for the RTC force the BSM to the
> desired value via devicetree by setting the 'backup-switch-mode' property.
> 
> That way the RTC on the boards work as one would expect them to do without
> any per-board intervention through userspace tools to enable BSM.
> 
> Frieder Schrempf (7):
>   dt-bindings: rtc: Move RV3028 to separate binding file
>   dt-bindings: rtc: Add backup-switch-mode property
>   dt-bindings: rtc: microcrystal,rv3032: Add backup-switch-mode property
>   rtc: Move BSM defines to separate header for DT usage
>   rtc: class: Support setting backup switch mode from devicetree
>   arm64: dts: imx8mm-kontron: Remove useless trickle-diode-disable from
>     RTC node
>   arm64: dts: imx8mm-kontron: Enable backup switch mode for RTC on OSM-S
>     module
> 
>  .../bindings/rtc/microcrystal,rv3028.yaml     | 60 +++++++++++++++++++
>  .../devicetree/bindings/rtc/rtc.yaml          |  7 +++
>  .../devicetree/bindings/rtc/trivial-rtc.yaml  |  2 -
>  .../dts/freescale/imx8mm-kontron-osm-s.dtsi   |  3 +-
>  drivers/rtc/class.c                           | 14 +++++
>  include/dt-bindings/rtc/rtc.h                 | 11 ++++
>  include/uapi/linux/rtc.h                      |  6 +-
>  7 files changed, 95 insertions(+), 8 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/rtc/microcrystal,rv3028.yaml
>  create mode 100644 include/dt-bindings/rtc/rtc.h
> 
> -- 
> 2.39.1

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] Enable backup switch mode on RTCs via devicetree
  2023-02-01 16:15 ` [PATCH 0/7] Enable backup switch mode on RTCs via devicetree Alexandre Belloni
@ 2023-02-01 16:26   ` Frieder Schrempf
  2023-02-13  9:18     ` Frieder Schrempf
  0 siblings, 1 reply; 10+ messages in thread
From: Frieder Schrempf @ 2023-02-01 16:26 UTC (permalink / raw)
  To: Alexandre Belloni, Frieder Schrempf
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-rtc,
	Alessandro Zummo, Krzysztof Kozlowski, Rob Herring, Sascha Hauer,
	Shawn Guo

On 01.02.23 17:15, Alexandre Belloni wrote:
> Hello,
> 
> You can't do that, this breaks an important use case and it is the
> reason why I didn't use device tree in the beginning. What is wrong with
> setting BSM from userspace? You will anyway have to set the time and
> date from userspace for it to be saved.

Ok, I was already afraid there is something I missed. Can you give a
short explanation of what use case this would break?

There is nothing wrong with setting BSM from userspace. It's just the
fact that users expect BSM to be enabled in any case as there is a
battery on the board. It is much more effort to ensure that production,
user, etc. are aware of an extra step required than to let the kernel
deal with it behind the scenes.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] Enable backup switch mode on RTCs via devicetree
  2023-02-01 16:26   ` Frieder Schrempf
@ 2023-02-13  9:18     ` Frieder Schrempf
  2023-03-06 13:27       ` Frieder Schrempf
  0 siblings, 1 reply; 10+ messages in thread
From: Frieder Schrempf @ 2023-02-13  9:18 UTC (permalink / raw)
  To: Alexandre Belloni, Frieder Schrempf
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-rtc,
	Alessandro Zummo, Krzysztof Kozlowski, Rob Herring, Sascha Hauer,
	Shawn Guo

Hi Alexandre,

On 01.02.23 17:26, Frieder Schrempf wrote:
> On 01.02.23 17:15, Alexandre Belloni wrote:
>> Hello,
>>
>> You can't do that, this breaks an important use case and it is the
>> reason why I didn't use device tree in the beginning. What is wrong with
>> setting BSM from userspace? You will anyway have to set the time and
>> date from userspace for it to be saved.
> 
> Ok, I was already afraid there is something I missed. Can you give a
> short explanation of what use case this would break?
> 
> There is nothing wrong with setting BSM from userspace. It's just the
> fact that users expect BSM to be enabled in any case as there is a
> battery on the board. It is much more effort to ensure that production,
> user, etc. are aware of an extra step required than to let the kernel
> deal with it behind the scenes.

Would you mind elaborating on your argument that this would break stuff?
I currently don't see how an additional optional devicetree property
would break anything.

Thanks
Frieder

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] Enable backup switch mode on RTCs via devicetree
  2023-02-13  9:18     ` Frieder Schrempf
@ 2023-03-06 13:27       ` Frieder Schrempf
  2023-03-22 13:14         ` Frieder Schrempf
  0 siblings, 1 reply; 10+ messages in thread
From: Frieder Schrempf @ 2023-03-06 13:27 UTC (permalink / raw)
  To: Alexandre Belloni, Frieder Schrempf
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-rtc,
	Alessandro Zummo, Krzysztof Kozlowski, Rob Herring, Sascha Hauer,
	Shawn Guo

On 13.02.23 10:18, Frieder Schrempf wrote:
> Hi Alexandre,
> 
> On 01.02.23 17:26, Frieder Schrempf wrote:
>> On 01.02.23 17:15, Alexandre Belloni wrote:
>>> Hello,
>>>
>>> You can't do that, this breaks an important use case and it is the
>>> reason why I didn't use device tree in the beginning. What is wrong with
>>> setting BSM from userspace? You will anyway have to set the time and
>>> date from userspace for it to be saved.
>>
>> Ok, I was already afraid there is something I missed. Can you give a
>> short explanation of what use case this would break?
>>
>> There is nothing wrong with setting BSM from userspace. It's just the
>> fact that users expect BSM to be enabled in any case as there is a
>> battery on the board. It is much more effort to ensure that production,
>> user, etc. are aware of an extra step required than to let the kernel
>> deal with it behind the scenes.
> 
> Would you mind elaborating on your argument that this would break stuff?
> I currently don't see how an additional optional devicetree property
> would break anything.

Ping!?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] Enable backup switch mode on RTCs via devicetree
  2023-03-06 13:27       ` Frieder Schrempf
@ 2023-03-22 13:14         ` Frieder Schrempf
  2023-03-22 22:19           ` Alexandre Belloni
  0 siblings, 1 reply; 10+ messages in thread
From: Frieder Schrempf @ 2023-03-22 13:14 UTC (permalink / raw)
  To: Alexandre Belloni, Frieder Schrempf
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-rtc,
	Alessandro Zummo, Krzysztof Kozlowski, Rob Herring, Sascha Hauer,
	Shawn Guo

Hi Alexandre,

On 06.03.23 14:27, Frieder Schrempf wrote:
> On 13.02.23 10:18, Frieder Schrempf wrote:
>> Hi Alexandre,
>>
>> On 01.02.23 17:26, Frieder Schrempf wrote:
>>> On 01.02.23 17:15, Alexandre Belloni wrote:
>>>> Hello,
>>>>
>>>> You can't do that, this breaks an important use case and it is the
>>>> reason why I didn't use device tree in the beginning. What is wrong with
>>>> setting BSM from userspace? You will anyway have to set the time and
>>>> date from userspace for it to be saved.
>>>
>>> Ok, I was already afraid there is something I missed. Can you give a
>>> short explanation of what use case this would break?
>>>
>>> There is nothing wrong with setting BSM from userspace. It's just the
>>> fact that users expect BSM to be enabled in any case as there is a
>>> battery on the board. It is much more effort to ensure that production,
>>> user, etc. are aware of an extra step required than to let the kernel
>>> deal with it behind the scenes.
>>
>> Would you mind elaborating on your argument that this would break stuff?
>> I currently don't see how an additional optional devicetree property
>> would break anything.
> 
> Ping!?

It seems like you decided to ignore me for whatever reasons there are.
I'm sure we can sort it out in some way if you would respond, please.

Thanks
Frieder

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] Enable backup switch mode on RTCs via devicetree
  2023-03-22 13:14         ` Frieder Schrempf
@ 2023-03-22 22:19           ` Alexandre Belloni
  2023-03-28  7:10             ` Frieder Schrempf
  0 siblings, 1 reply; 10+ messages in thread
From: Alexandre Belloni @ 2023-03-22 22:19 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: Frieder Schrempf, devicetree, linux-arm-kernel, linux-kernel,
	linux-rtc, Alessandro Zummo, Krzysztof Kozlowski, Rob Herring,
	Sascha Hauer, Shawn Guo

Hello,

On 22/03/2023 14:14:50+0100, Frieder Schrempf wrote:
> On 06.03.23 14:27, Frieder Schrempf wrote:
> > On 13.02.23 10:18, Frieder Schrempf wrote:
> >> Hi Alexandre,
> >>
> >> On 01.02.23 17:26, Frieder Schrempf wrote:
> >>> On 01.02.23 17:15, Alexandre Belloni wrote:
> >>>> Hello,
> >>>>
> >>>> You can't do that, this breaks an important use case and it is the
> >>>> reason why I didn't use device tree in the beginning. What is wrong with
> >>>> setting BSM from userspace? You will anyway have to set the time and
> >>>> date from userspace for it to be saved.
> >>>
> >>> Ok, I was already afraid there is something I missed. Can you give a
> >>> short explanation of what use case this would break?
> >>>
> >>> There is nothing wrong with setting BSM from userspace. It's just the
> >>> fact that users expect BSM to be enabled in any case as there is a
> >>> battery on the board. It is much more effort to ensure that production,
> >>> user, etc. are aware of an extra step required than to let the kernel
> >>> deal with it behind the scenes.
> >>
> >> Would you mind elaborating on your argument that this would break stuff?
> >> I currently don't see how an additional optional devicetree property
> >> would break anything.
> > 
> > Ping!?
> 
> It seems like you decided to ignore me for whatever reasons there are.
> I'm sure we can sort it out in some way if you would respond, please.

I do what I can with the time I have.

There are 2 issues:
 - the first one is that this is encoding device configuration in the
   device tree which is forbidden. BSM is not really hardware related.
The worse that could happen is that the backup voltage is not present
and so the RTC will never switch to the backup source.

 - the second one is why I got to a userspace solution. There are RTC
   where it is crucial to be able to change BSM dynamically. Those RTCs
have a standby mode: they will only draw current from the backup source
once they have seen VDD once. This is useful when you install a battery
in a product and this products stays on the shelf for a while before
being used. However, if your production line needs to powerup the device
to flash it or perform tests, the RTC will get out of standby mode and
you need a way to get it back to standby. This is possible with the
current interface, I'm not going to have a second interface.

Regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] Enable backup switch mode on RTCs via devicetree
  2023-03-22 22:19           ` Alexandre Belloni
@ 2023-03-28  7:10             ` Frieder Schrempf
  0 siblings, 0 replies; 10+ messages in thread
From: Frieder Schrempf @ 2023-03-28  7:10 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Frieder Schrempf, devicetree, linux-arm-kernel, linux-kernel,
	linux-rtc, Alessandro Zummo, Krzysztof Kozlowski, Rob Herring,
	Sascha Hauer, Shawn Guo

On 22.03.23 23:19, Alexandre Belloni wrote:
> Hello,
> 
> On 22/03/2023 14:14:50+0100, Frieder Schrempf wrote:
>> On 06.03.23 14:27, Frieder Schrempf wrote:
>>> On 13.02.23 10:18, Frieder Schrempf wrote:
>>>> Hi Alexandre,
>>>>
>>>> On 01.02.23 17:26, Frieder Schrempf wrote:
>>>>> On 01.02.23 17:15, Alexandre Belloni wrote:
>>>>>> Hello,
>>>>>>
>>>>>> You can't do that, this breaks an important use case and it is the
>>>>>> reason why I didn't use device tree in the beginning. What is wrong with
>>>>>> setting BSM from userspace? You will anyway have to set the time and
>>>>>> date from userspace for it to be saved.
>>>>>
>>>>> Ok, I was already afraid there is something I missed. Can you give a
>>>>> short explanation of what use case this would break?
>>>>>
>>>>> There is nothing wrong with setting BSM from userspace. It's just the
>>>>> fact that users expect BSM to be enabled in any case as there is a
>>>>> battery on the board. It is much more effort to ensure that production,
>>>>> user, etc. are aware of an extra step required than to let the kernel
>>>>> deal with it behind the scenes.
>>>>
>>>> Would you mind elaborating on your argument that this would break stuff?
>>>> I currently don't see how an additional optional devicetree property
>>>> would break anything.
>>>
>>> Ping!?
>>
>> It seems like you decided to ignore me for whatever reasons there are.
>> I'm sure we can sort it out in some way if you would respond, please.
> 
> I do what I can with the time I have.

Thanks for taking the time! I know that maintainers are usually
chronically overloaded. Still I got a bit worried after ~7 weeks that I
wont get a reply at all.

> 
> There are 2 issues:
>  - the first one is that this is encoding device configuration in the
>    device tree which is forbidden. BSM is not really hardware related.
> The worse that could happen is that the backup voltage is not present
> and so the RTC will never switch to the backup source.

This is an argument that I was expecting to hear in the first place. I
think this is kind of a grey area as the BSM feature is definitely
related to the hardware implementation of the V_DD and V_BACKUP supply
voltages, but at the same time it also might reflect device configuration.

> 
>  - the second one is why I got to a userspace solution. There are RTC
>    where it is crucial to be able to change BSM dynamically. Those RTCs
> have a standby mode: they will only draw current from the backup source
> once they have seen VDD once. This is useful when you install a battery
> in a product and this products stays on the shelf for a while before
> being used. However, if your production line needs to powerup the device
> to flash it or perform tests, the RTC will get out of standby mode and
> you need a way to get it back to standby. This is possible with the
> current interface, I'm not going to have a second interface.

Thanks for pointing that out. The userspace solution is definitely
useful and necessary and I would never argue against it. What I'm
proposing is not really a second interface but a way to set the default
mode at boot time. If you really think this is too much, then I will
need to scratch this approach.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-03-28  7:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01 14:34 [PATCH 0/7] Enable backup switch mode on RTCs via devicetree Frieder Schrempf
2023-02-01 14:34 ` [PATCH 6/7] arm64: dts: imx8mm-kontron: Remove useless trickle-diode-disable from RTC node Frieder Schrempf
2023-02-01 14:34 ` [PATCH 7/7] arm64: dts: imx8mm-kontron: Enable backup switch mode for RTC on OSM-S module Frieder Schrempf
2023-02-01 16:15 ` [PATCH 0/7] Enable backup switch mode on RTCs via devicetree Alexandre Belloni
2023-02-01 16:26   ` Frieder Schrempf
2023-02-13  9:18     ` Frieder Schrempf
2023-03-06 13:27       ` Frieder Schrempf
2023-03-22 13:14         ` Frieder Schrempf
2023-03-22 22:19           ` Alexandre Belloni
2023-03-28  7:10             ` Frieder Schrempf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).