From: Samuel Holland <samuel@sholland.org> Date: 2021-07-26 03:52:04
On existing SoCs, the watchdog has a single clock input: HOSC (OSC24M)
divided by 750. However, starting with R329, LOSC (OSC32k) is added as
an alternative clock source, with a bit to switch between them.
Since 24 MHz / 750 == 32 kHz, not 32.768 kHz, the hardware adjusts the
cycle counts to keep the timeouts independent of the clock source. This
keeps the programming interface backward-compatible.
R329 also adds two new registers, to allow software to immediately drive
the SoC reset signal.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../watchdog/allwinner,sun4i-a10-wdt.yaml | 30 ++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
From: Samuel Holland <samuel@sholland.org> Date: 2021-07-26 03:52:08
D1 keeps the same register layout and clock sources as the R329, but it
adds a key field which must be set to update the watchdog's "CFG" and
"MODE" registers. Therefore it is not backward-compatible.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 2 ++
1 file changed, 2 insertions(+)
On Sun, Jul 25, 2021 at 10:51:42PM -0500, Samuel Holland wrote:
quoted hunk
D1 keeps the same register layout and clock sources as the R329, but it
adds a key field which must be set to update the watchdog's "CFG" and
"MODE" registers. Therefore it is not backward-compatible.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 2 ++
1 file changed, 2 insertions(+)
From: Rob Herring <robh@kernel.org> Date: 2021-07-29 22:39:52
On Wed, Jul 28, 2021 at 09:24:49PM -0700, Guenter Roeck wrote:
On Sun, Jul 25, 2021 at 10:51:42PM -0500, Samuel Holland wrote:
quoted
D1 keeps the same register layout and clock sources as the R329, but it
adds a key field which must be set to update the watchdog's "CFG" and
"MODE" registers. Therefore it is not backward-compatible.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 2 ++
1 file changed, 2 insertions(+)
On Wed, Jul 28, 2021 at 09:24:49PM -0700, Guenter Roeck wrote:
quoted
On Sun, Jul 25, 2021 at 10:51:42PM -0500, Samuel Holland wrote:
quoted
D1 keeps the same register layout and clock sources as the R329, but it
adds a key field which must be set to update the watchdog's "CFG" and
"MODE" registers. Therefore it is not backward-compatible.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 2 ++
1 file changed, 2 insertions(+)
From: Rob Herring <robh@kernel.org> Date: 2021-07-29 22:40:36
On Sun, 25 Jul 2021 22:51:42 -0500, Samuel Holland wrote:
D1 keeps the same register layout and clock sources as the R329, but it
adds a key field which must be set to update the watchdog's "CFG" and
"MODE" registers. Therefore it is not backward-compatible.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 2 ++
1 file changed, 2 insertions(+)
From: Samuel Holland <samuel@sholland.org> Date: 2021-07-26 03:52:12
D1 adds a key field to the "CFG" and "MODE" registers, that must be set
to change the other bits. Add logic to set the key when updating those
registers.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/watchdog/sunxi_wdt.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
On Sun, Jul 25, 2021 at 10:51:43PM -0500, Samuel Holland wrote:
D1 adds a key field to the "CFG" and "MODE" registers, that must be set
to change the other bits. Add logic to set the key when updating those
registers.
Signed-off-by: Samuel Holland <samuel@sholland.org>
From: Maxime Ripard <hidden> Date: 2021-07-29 12:18:26
Hi,
On Sun, Jul 25, 2021 at 10:51:41PM -0500, Samuel Holland wrote:
quoted hunk
On existing SoCs, the watchdog has a single clock input: HOSC (OSC24M)
divided by 750. However, starting with R329, LOSC (OSC32k) is added as
an alternative clock source, with a bit to switch between them.
Since 24 MHz / 750 == 32 kHz, not 32.768 kHz, the hardware adjusts the
cycle counts to keep the timeouts independent of the clock source. This
keeps the programming interface backward-compatible.
R329 also adds two new registers, to allow software to immediately drive
the SoC reset signal.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../watchdog/allwinner,sun4i-a10-wdt.yaml | 30 ++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
So I assume that the expectations are that hosc is first (or the only
valid choice with older SoCs), and losc second?
If so, we should make it clear using two const instead of an enum. Here
you state that on older SoCs we could use either the hosc or losc clocks
as source, which is incorrect.
I guess adding descriptions for clocks would be great too.
Maxime