All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] add ripple counter dt binding and driver
@ 2021-02-26 14:14 Rasmus Villemoes
  2021-02-26 14:14 ` [PATCH 1/2] dt-bindings: misc: add binding for generic ripple counter Rasmus Villemoes
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Rasmus Villemoes @ 2021-02-26 14:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring
  Cc: devicetree, linux-kernel, Arnd Bergmann, linux-clk, Rasmus Villemoes

What I'm trying to do:

We have a board with an external watchdog circuit (the kind that is
petted by flipping a gpio). The reset output of that is split in two:
One gives an immediate interrupt, so software knows that a hard reset
is imminent. The other half removes the "reset input" from a ripple
counter, causing that to start counting at 32kHz, and after 64ms, the
SOC's reset pin then gets pulled.

Unfortunately, the board designer overlooked that the 32kHz output
from the RTC can be disabled, which (since no other component uses
it), is just what happens when clk_disable_unused() gets called. When
the watchdog fires, we do get the interrupt, but the board does not
get reset as it should, since the counter doesn't count.

So I'm thinking that the proper way to handle this is to be able to
represent that ripple counter as a clock consumer in DT and have a
driver do the clk_prepare_enable(), even if that driver doesn't and
can't do anything else. But I'm certainly open to other suggestions.

The "clk_ignore_unused" kernel parameter is fine for debugging, but
too big a hammer (since it applies to all "unused" clocks).


Rasmus Villemoes (2):
  dt-bindings: misc: add binding for generic ripple counter
  drivers: misc: add ripple counter driver

 .../devicetree/bindings/misc/ripple-ctr.txt   |  8 +++++
 drivers/misc/Kconfig                          |  7 +++++
 drivers/misc/Makefile                         |  1 +
 drivers/misc/ripple-ctr.c                     | 31 +++++++++++++++++++
 4 files changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/ripple-ctr.txt
 create mode 100644 drivers/misc/ripple-ctr.c

-- 
2.29.2


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

end of thread, other threads:[~2022-03-05  2:41 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 14:14 [PATCH 0/2] add ripple counter dt binding and driver Rasmus Villemoes
2021-02-26 14:14 ` [PATCH 1/2] dt-bindings: misc: add binding for generic ripple counter Rasmus Villemoes
2021-03-08 17:21   ` Rob Herring
2021-03-08 20:02     ` Rasmus Villemoes
2021-03-08 21:38       ` Rob Herring
2021-03-09  7:39         ` Rasmus Villemoes
2021-03-09 15:44           ` Rob Herring
2021-02-26 14:14 ` [PATCH 2/2] drivers: misc: add ripple counter driver Rasmus Villemoes
2021-02-28  5:47   ` Chen, Mike Ximing
     [not found]   ` <CAHp75Vc8S2E0vWFcqK-jO9Nhd-Us_7t-aWNj-7k+fWDcqR1XkQ@mail.gmail.com>
2021-02-28  9:29     ` Andy Shevchenko
2021-02-28  9:33       ` Andy Shevchenko
2021-03-01  8:29         ` Rasmus Villemoes
2021-02-26 14:35 ` [PATCH 0/2] add ripple counter dt binding and driver Arnd Bergmann
2021-02-26 16:35   ` Rasmus Villemoes
2021-02-26 19:53     ` Guenter Roeck
2021-03-01  8:34       ` Rasmus Villemoes
2021-03-01  9:44         ` Arnd Bergmann
2021-03-01 14:21           ` Guenter Roeck
2021-03-04 22:12 ` [PATCH v2 0/3] add "delay" clock support to gpio_wdt Rasmus Villemoes
2021-03-04 22:12   ` [PATCH v2 1/3] clk: add devm_clk_prepare_enable() helper Rasmus Villemoes
2021-03-09  5:28     ` Guenter Roeck
2022-03-05  2:41       ` Dmitry Torokhov
2021-03-04 22:12   ` [PATCH v2 2/3] dt-bindings: watchdog: add optional "delay" clock to gpio-wdt binding Rasmus Villemoes
2021-03-04 22:12   ` [PATCH v2 3/3] watchdog: gpio_wdt: implement support for optional "delay" clock Rasmus Villemoes
2021-03-09  5:51   ` [PATCH v2 0/3] add "delay" clock support to gpio_wdt Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.