Skip to content

Commit 9bc64d3

Browse files
Andre-ARMWim Van Sebroeck
authored andcommitted
watchdog: sunxi_wdt: Add support for Allwinner A523
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>
1 parent a6d86c1 commit 9bc64d3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/watchdog/sunxi_wdt.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,21 @@ static const struct sunxi_wdt_reg sun20i_wdt_reg = {
236236
.wdt_key_val = 0x16aa0000,
237237
};
238238

239+
static const struct sunxi_wdt_reg sun55i_wdt_reg = {
240+
.wdt_ctrl = 0x0c,
241+
.wdt_cfg = 0x10,
242+
.wdt_mode = 0x14,
243+
.wdt_timeout_shift = 4,
244+
.wdt_reset_mask = 0x03,
245+
.wdt_reset_val = 0x01,
246+
.wdt_key_val = 0x16aa0000,
247+
};
248+
239249
static const struct of_device_id sunxi_wdt_dt_ids[] = {
240250
{ .compatible = "allwinner,sun4i-a10-wdt", .data = &sun4i_wdt_reg },
241251
{ .compatible = "allwinner,sun6i-a31-wdt", .data = &sun6i_wdt_reg },
242252
{ .compatible = "allwinner,sun20i-d1-wdt", .data = &sun20i_wdt_reg },
253+
{ .compatible = "allwinner,sun55i-a523-wdt", .data = &sun55i_wdt_reg },
243254
{ /* sentinel */ }
244255
};
245256
MODULE_DEVICE_TABLE(of, sunxi_wdt_dt_ids);

0 commit comments

Comments
 (0)