Skip to content

Commit 6cb8956

Browse files
Kevin Wangnashif
authored andcommitted
drivers: watchdog: Refine the atcwdt200 driver's code.
Remove the reset vector setting from driver layer, the reset vector is more suitable to be set at the board layer. Signed-off-by: Kevin Wang <[email protected]>
1 parent 00a3be9 commit 6cb8956

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

drivers/watchdog/wdt_andes_atcwdt200.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,10 @@ LOG_MODULE_REGISTER(wdt_andes);
7373
#define WDT_ST_INTEXPIRED 0x1
7474
#define WDT_ST_INTEXPIRED_CLR 0x1
7575

76-
/*
77-
* SMU(System Management Unit) Registers for hwinfo driver
78-
*/
79-
80-
/* Register offset*/
81-
#define SMU_RESET_WRSR 0x10
82-
#define SMU_RESET_REGHI 0x60
83-
#define SMU_RESET_REGLO 0x50
84-
#define SMU_CMD 0x14
85-
86-
#define SMU_RESET_CMD 0x3c
87-
8876
#define WDOGCFG_PERIOD_MIN BIT(7)
8977
#define WDOGCFG_PERIOD_MAX BIT(14)
9078
#define EXT_CLOCK_FREQ BIT(15)
9179

92-
static const struct device *const syscon_dev =
93-
DEVICE_DT_GET(DT_NODELABEL(syscon));
9480
static const struct device *const pit_counter_dev =
9581
DEVICE_DT_GET(DT_NODELABEL(pit0));
9682

@@ -326,24 +312,9 @@ static int wdt_atcwdt200_init(const struct device *dev)
326312

327313
data->timeout_valid = false;
328314
data->counter_callback = wdt_counter_cb;
329-
uint32_t ret;
330315

331316
counter_start(pit_counter_dev);
332317

333-
ret = syscon_write_reg(syscon_dev, SMU_RESET_REGLO,
334-
((uint32_t)((unsigned long)
335-
K_MEM_PHYS_ADDR(CONFIG_KERNEL_ENTRY))));
336-
if (ret < 0) {
337-
return -EINVAL;
338-
}
339-
340-
ret = syscon_write_reg(syscon_dev, SMU_RESET_REGHI,
341-
((uint32_t)((uint64_t)((unsigned long)
342-
K_MEM_PHYS_ADDR(CONFIG_KERNEL_ENTRY)) >> 32)));
343-
if (ret < 0) {
344-
return -EINVAL;
345-
}
346-
347318
#ifdef CONFIG_WDT_DISABLE_AT_BOOT
348319
wdt_atcwdt200_disable(dev);
349320
#else

0 commit comments

Comments
 (0)