]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
watchdog: sunxi_wdt: Add support for Allwinner A523
authorAndre Przywara <andre.przywara@arm.com>
Fri, 7 Mar 2025 00:57:01 +0000 (00:57 +0000)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Tue, 25 Mar 2025 13:11:16 +0000 (14:11 +0100)
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>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20250307005712.16828-5-andre.przywara@arm.com
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/sunxi_wdt.c

index b85354a995826e13d89503436bcde6dc6d06d374..b6c761acc3de67d705437d13b3698fbefe42a2c0 100644 (file)
@@ -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);