public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-watchdog@vger.kernel.org
Subject: [PATCH 04/14] watchdog: sunxi_wdt: Add support for Allwinner A523
Date: Mon, 11 Nov 2024 01:30:23 +0000	[thread overview]
Message-ID: <20241111013033.22793-5-andre.przywara@arm.com> (raw)
In-Reply-To: <20241111013033.22793-1-andre.przywara@arm.com>

The Allwinner A523 SoC comes with a watchdog very similar to the ones in
the previous Allwinner SoCs, but oddly enough moves the first half of its
registers up by one word. Since we have different offsets for these
registers across the other SoCs as well, this can simply be modelled by
just stating the new offsets in our per-SoC struct.
The rest of the IP is the same as in the D1, although the A523 moves its
watchdog to a separate MMIO frame, so it's not embedded in the timer
anymore. The driver can be ignorant of this, because the DT will take
care of this.

Add a new struct for the A523, specifying the SoC-specific details, and
tie the new DT compatible string to it.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/watchdog/sunxi_wdt.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c
index b85354a995826..b6c761acc3de6 100644
--- a/drivers/watchdog/sunxi_wdt.c
+++ b/drivers/watchdog/sunxi_wdt.c
@@ -236,10 +236,21 @@ static const struct sunxi_wdt_reg sun20i_wdt_reg = {
 	.wdt_key_val = 0x16aa0000,
 };
 
+static const struct sunxi_wdt_reg sun55i_wdt_reg = {
+	.wdt_ctrl = 0x0c,
+	.wdt_cfg = 0x10,
+	.wdt_mode = 0x14,
+	.wdt_timeout_shift = 4,
+	.wdt_reset_mask = 0x03,
+	.wdt_reset_val = 0x01,
+	.wdt_key_val = 0x16aa0000,
+};
+
 static const struct of_device_id sunxi_wdt_dt_ids[] = {
 	{ .compatible = "allwinner,sun4i-a10-wdt", .data = &sun4i_wdt_reg },
 	{ .compatible = "allwinner,sun6i-a31-wdt", .data = &sun6i_wdt_reg },
 	{ .compatible = "allwinner,sun20i-d1-wdt", .data = &sun20i_wdt_reg },
+	{ .compatible = "allwinner,sun55i-a523-wdt", .data = &sun55i_wdt_reg },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, sunxi_wdt_dt_ids);
-- 
2.46.2



  parent reply	other threads:[~2024-11-11  1:40 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11  1:30 [PATCH 00/14] arm64: dts: allwinner: Add basic Allwinner A523 support Andre Przywara
2024-11-11  1:30 ` [PATCH 01/14] dt-bindings: mmc: sunxi: Simplify compatible string listing Andre Przywara
2024-11-11 20:34   ` Conor Dooley
2024-11-11  1:30 ` [PATCH 02/14] dt-bindings: mmc: sunxi: add compatible strings for Allwinner A523 Andre Przywara
2024-11-11 20:35   ` Conor Dooley
2024-11-11  1:30 ` [PATCH 03/14] dt-bindings: watchdog: sunxi: add Allwinner A523 compatible string Andre Przywara
2024-11-11 20:35   ` Conor Dooley
2025-01-18 11:47   ` Jernej Škrabec
2024-11-11  1:30 ` Andre Przywara [this message]
2025-01-18 11:45   ` [PATCH 04/14] watchdog: sunxi_wdt: Add support for Allwinner A523 Jernej Škrabec
2024-11-11  1:30 ` [PATCH 05/14] dt-bindings: i2c: mv64xxx: Add Allwinner A523 compatible string Andre Przywara
2024-11-11 20:36   ` Conor Dooley
2024-11-18 23:07   ` Andi Shyti
2024-11-11  1:30 ` [PATCH 06/14] dt-bindings: irq: sun7i-nmi: document the Allwinner A523 NMI controller Andre Przywara
2025-01-18 13:17   ` Jernej Škrabec
2024-11-11  1:30 ` [PATCH 07/14] dt-bindings: phy: document Allwinner A523 USB-2.0 PHY Andre Przywara
2024-11-11 20:38   ` Conor Dooley
2024-11-11  1:30 ` [PATCH 08/14] dt-bindings: usb: sunxi-musb: add Allwinner A523 compatible string Andre Przywara
2024-11-11 20:38   ` Conor Dooley
2024-11-11  1:30 ` [PATCH 09/14] dt-bindings: usb: add A523 compatible string for EHCI and OCHI Andre Przywara
2024-11-11 20:38   ` Conor Dooley
2024-11-11  1:30 ` [PATCH 10/14] dt-bindings: rtc: sun6i: Add Allwinner A523 support Andre Przywara
2024-11-11 20:39   ` Conor Dooley
2024-11-11 20:49   ` (subset) " Alexandre Belloni
2024-11-11  1:30 ` [PATCH 11/14] arm64: dts: allwinner: Add Allwinner A523 .dtsi file Andre Przywara
2025-01-18 16:28   ` Jernej Škrabec
2024-11-11  1:30 ` [PATCH 12/14] dt-bindings: vendor-prefixes: Add YuzukiHD name Andre Przywara
2024-11-11 20:39   ` Conor Dooley
2024-11-11  1:30 ` [PATCH 13/14] dt-bindings: arm: sunxi: Add Avaota A1 board Andre Przywara
2024-11-11 20:39   ` Conor Dooley
2024-11-11  1:30 ` [PATCH 14/14] arm64: dts: allwinner: a523: add Avaota-A1 router support Andre Przywara
2024-11-11 15:32 ` [PATCH 00/14] arm64: dts: allwinner: Add basic Allwinner A523 support Rob Herring (Arm)
2024-11-11 17:42   ` Andre Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241111013033.22793-5-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@kernel.org \
    --cc=samuel@sholland.org \
    --cc=wens@csie.org \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox