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>
This commit is contained in:
Andre Przywara 2025-03-07 00:57:01 +00:00 committed by Wim Van Sebroeck
parent a6d86c1b64
commit 9bc64d338b
1 changed files with 11 additions and 0 deletions

View File

@ -236,10 +236,21 @@ static const struct sunxi_wdt_reg sun20i_wdt_reg = {
.wdt_key_val = 0x16aa0000, .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[] = { static const struct of_device_id sunxi_wdt_dt_ids[] = {
{ .compatible = "allwinner,sun4i-a10-wdt", .data = &sun4i_wdt_reg }, { .compatible = "allwinner,sun4i-a10-wdt", .data = &sun4i_wdt_reg },
{ .compatible = "allwinner,sun6i-a31-wdt", .data = &sun6i_wdt_reg }, { .compatible = "allwinner,sun6i-a31-wdt", .data = &sun6i_wdt_reg },
{ .compatible = "allwinner,sun20i-d1-wdt", .data = &sun20i_wdt_reg }, { .compatible = "allwinner,sun20i-d1-wdt", .data = &sun20i_wdt_reg },
{ .compatible = "allwinner,sun55i-a523-wdt", .data = &sun55i_wdt_reg },
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(of, sunxi_wdt_dt_ids); MODULE_DEVICE_TABLE(of, sunxi_wdt_dt_ids);