From: Samuel Holland <samuel@sholland.org> Date: 2021-08-05 04:57:23
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>
---
Changes v1 to v2:
- Switch from enum to const
- Add descriptions to "clocks" items
.../watchdog/allwinner,sun4i-a10-wdt.yaml | 32 ++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
@@ -33,7 +34,18 @@ properties:maxItems:1clocks:-maxItems:1+minItems:1+maxItems:2+items:+-description:High-frequency oscillator input, divided internally+-description:Low-frequency oscillator input, only found on some variants++clock-names:+minItems:1+maxItems:2+items:+-const:hosc+-const:loscinterrupts:maxItems:1
From: Samuel Holland <samuel@sholland.org> Date: 2021-08-05 04:57:26
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.
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
Changes v1 to v2:
- None.
.../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 2 ++
1 file changed, 2 insertions(+)
From: Samuel Holland <samuel@sholland.org> Date: 2021-08-05 04:57:36
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.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
Changes v1 to v2:
- None.
drivers/watchdog/sunxi_wdt.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
From: Rob Herring <robh@kernel.org> Date: 2021-08-13 17:47:00
On Wed, Aug 04, 2021 at 11:57:14PM -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>
---
Changes v1 to v2:
- Switch from enum to const
- Add descriptions to "clocks" items
.../watchdog/allwinner,sun4i-a10-wdt.yaml | 32 ++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
@@ -33,7 +34,18 @@ properties:maxItems:1clocks:-maxItems:1+minItems:1+maxItems:2+items:+-description:High-frequency oscillator input, divided internally+-description:Low-frequency oscillator input, only found on some variants++clock-names:+minItems:1+maxItems:2+items:+-const:hosc+-const:loscinterrupts:maxItems:1
From: Maxime Ripard <hidden> Date: 2021-08-18 09:07:46
Hi,
On Wed, Aug 04, 2021 at 11:57:14PM -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>
---
Changes v1 to v2:
- Switch from enum to const
- Add descriptions to "clocks" items
.../watchdog/allwinner,sun4i-a10-wdt.yaml | 32 ++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
@@ -33,7 +34,18 @@ properties:maxItems:1clocks:-maxItems:1+minItems:1+maxItems:2+items:+-description:High-frequency oscillator input, divided internally+-description:Low-frequency oscillator input, only found on some variants++clock-names:+minItems:1+maxItems:2+items:+-const:hosc+-const:loscinterrupts:maxItems:1
We should also make sure through an else clause that all the other SoCs
have a length of one for both clocks and clock-names
Also, it looks like you forgot the patch to enable the compatible in the
driver?
Maxime
From: Maxime Ripard <hidden> Date: 2021-08-18 09:08:06
On Wed, Aug 04, 2021 at 11:57:15PM -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.
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
From: Maxime Ripard <hidden> Date: 2021-08-18 09:08:25
On Wed, Aug 04, 2021 at 11:57:16PM -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.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Samuel Holland <samuel@sholland.org>
From: Samuel Holland <samuel@sholland.org> Date: 2021-08-20 04:05:01
On 8/18/21 4:07 AM, Maxime Ripard wrote:
Hi,
On Wed, Aug 04, 2021 at 11:57:14PM -0500, Samuel Holland wrote:
quoted
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>
---
Changes v1 to v2:
- Switch from enum to const
- Add descriptions to "clocks" items
.../watchdog/allwinner,sun4i-a10-wdt.yaml | 32 ++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
@@ -33,7 +34,18 @@ properties:maxItems:1clocks:-maxItems:1+minItems:1+maxItems:2+items:+-description:High-frequency oscillator input, divided internally+-description:Low-frequency oscillator input, only found on some variants++clock-names:+minItems:1+maxItems:2+items:+-const:hosc+-const:loscinterrupts:maxItems:1
On Wed, Aug 04, 2021 at 11:57:15PM -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.
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Maxime Ripard <redacted>