Lines Matching +full:zephyr +full:- +full:base
1 /* SPDX-License-Identifier: Apache-2.0 */
8 #include <zephyr/drivers/watchdog.h>
9 #include <zephyr/logging/log.h>
10 #include <zephyr/sys_clock.h>
11 #include <zephyr/math/ilog2.h>
33 int dw_wdt_configure(const uint32_t base, const uint32_t config) in dw_wdt_configure() argument
39 return -ENOTSUP; in dw_wdt_configure()
45 if (dw_wdt_dual_timeout_period_get(base)) { in dw_wdt_configure()
46 dw_wdt_timeout_period_init_set(base, period); in dw_wdt_configure()
49 dw_wdt_timeout_period_set(base, period); in dw_wdt_configure()
52 dw_wdt_enable(base); in dw_wdt_configure()
53 dw_wdt_counter_restart(base); in dw_wdt_configure()
58 int dw_wdt_calc_period(const uint32_t base, const uint32_t clk_freq, in dw_wdt_calc_period() argument
65 if (config->window.min) { in dw_wdt_calc_period()
67 return -ENOTSUP; in dw_wdt_calc_period()
70 period64 = (uint64_t)clk_freq * config->window.max; in dw_wdt_calc_period()
74 return -EINVAL; in dw_wdt_calc_period()
77 period = period64 - 1; in dw_wdt_calc_period()
80 if (period >= dw_wdt_cnt_width_get(base)) { in dw_wdt_calc_period()
82 return -EINVAL; in dw_wdt_calc_period()
86 *period_out = WDT_DW_FLAG_CONFIGURED | (period >= 15 ? period - 15 : 0); in dw_wdt_calc_period()
90 int dw_wdt_probe(const uint32_t base, const uint32_t reset_pulse_length) in dw_wdt_probe() argument
93 const uint32_t type = dw_wdt_comp_type_get(base); in dw_wdt_probe()
97 return -ENODEV; in dw_wdt_probe()
100 dw_wdt_reset_pulse_length_set(base, reset_pulse_length); in dw_wdt_probe()