Skip to content

Commit 53663d2

Browse files
BotchedRPRWim Van Sebroeck
authored andcommitted
watchdog: s3c2410_wdt: Add exynos990-wdt compatible data
The Exynos990 has two watchdog clusters - cl0 and cl2. Add new driver data for these two clusters, making it possible to use the watchdog timer on this SoC. Signed-off-by: Igor Belwon <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/20250420-wdt-resends-april-v1-2-f58639673959@mentallysanemainliners.org Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent a2170f8 commit 53663d2

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

drivers/watchdog/s3c2410_wdt.c

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@
8282
#define GS_CLUSTER2_NONCPU_INT_EN 0x1644
8383
#define GS_RST_STAT_REG_OFFSET 0x3B44
8484

85+
#define EXYNOS990_CLUSTER2_NONCPU_OUT 0x1620
86+
#define EXYNOS990_CLUSTER2_NONCPU_INT_EN 0x1644
87+
#define EXYNOS990_CLUSTER2_WDTRESET_BIT 23
88+
8589
/**
8690
* DOC: Quirk flags for different Samsung watchdog IP-cores
8791
*
@@ -259,6 +263,32 @@ static const struct s3c2410_wdt_variant drv_data_exynos850_cl1 = {
259263
QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_CNT_EN,
260264
};
261265

266+
static const struct s3c2410_wdt_variant drv_data_exynos990_cl0 = {
267+
.mask_reset_reg = GS_CLUSTER0_NONCPU_INT_EN,
268+
.mask_bit = 2,
269+
.mask_reset_inv = true,
270+
.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
271+
.rst_stat_bit = EXYNOS850_CLUSTER0_WDTRESET_BIT,
272+
.cnt_en_reg = EXYNOSAUTOV920_CLUSTER0_NONCPU_OUT,
273+
.cnt_en_bit = 7,
274+
.quirks = QUIRK_HAS_WTCLRINT_REG | QUIRK_HAS_PMU_MASK_RESET |
275+
QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_CNT_EN |
276+
QUIRK_HAS_DBGACK_BIT,
277+
};
278+
279+
static const struct s3c2410_wdt_variant drv_data_exynos990_cl2 = {
280+
.mask_reset_reg = EXYNOS990_CLUSTER2_NONCPU_INT_EN,
281+
.mask_bit = 2,
282+
.mask_reset_inv = true,
283+
.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
284+
.rst_stat_bit = EXYNOS990_CLUSTER2_WDTRESET_BIT,
285+
.cnt_en_reg = EXYNOS990_CLUSTER2_NONCPU_OUT,
286+
.cnt_en_bit = 7,
287+
.quirks = QUIRK_HAS_WTCLRINT_REG | QUIRK_HAS_PMU_MASK_RESET |
288+
QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_CNT_EN |
289+
QUIRK_HAS_DBGACK_BIT,
290+
};
291+
262292
static const struct s3c2410_wdt_variant drv_data_exynosautov9_cl0 = {
263293
.mask_reset_reg = EXYNOS850_CLUSTER0_NONCPU_INT_EN,
264294
.mask_bit = 2,
@@ -350,6 +380,8 @@ static const struct of_device_id s3c2410_wdt_match[] = {
350380
.data = &drv_data_exynos7 },
351381
{ .compatible = "samsung,exynos850-wdt",
352382
.data = &drv_data_exynos850_cl0 },
383+
{ .compatible = "samsung,exynos990-wdt",
384+
.data = &drv_data_exynos990_cl0 },
353385
{ .compatible = "samsung,exynosautov9-wdt",
354386
.data = &drv_data_exynosautov9_cl0 },
355387
{ .compatible = "samsung,exynosautov920-wdt",
@@ -678,7 +710,8 @@ s3c2410_get_wdt_drv_data(struct platform_device *pdev, struct s3c2410_wdt *wdt)
678710
if (variant == &drv_data_exynos850_cl0 ||
679711
variant == &drv_data_exynosautov9_cl0 ||
680712
variant == &drv_data_gs101_cl0 ||
681-
variant == &drv_data_exynosautov920_cl0) {
713+
variant == &drv_data_exynosautov920_cl0 ||
714+
variant == &drv_data_exynos990_cl0) {
682715
u32 index;
683716
int err;
684717

@@ -700,6 +733,10 @@ s3c2410_get_wdt_drv_data(struct platform_device *pdev, struct s3c2410_wdt *wdt)
700733
else if (variant == &drv_data_exynosautov920_cl0)
701734
variant = &drv_data_exynosautov920_cl1;
702735
break;
736+
case 2:
737+
if (variant == &drv_data_exynos990_cl0)
738+
variant = &drv_data_exynos990_cl2;
739+
break;
703740
default:
704741
return dev_err_probe(dev, -EINVAL, "wrong cluster index: %u\n", index);
705742
}

0 commit comments

Comments
 (0)