drivers: watchdog: Added support to C6
Added support to watchdog timer to ESP32C6 Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
This commit is contained in:
parent
a62423f391
commit
909f7922d6
@ -23,6 +23,7 @@
|
||||
|
||||
aliases {
|
||||
sw0 = &user_button1;
|
||||
watchdog0 = &wdt0;
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
@ -49,6 +50,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&wdt0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
status = "okay";
|
||||
partitions {
|
||||
|
||||
@ -7,7 +7,11 @@
|
||||
#define DT_DRV_COMPAT espressif_esp32_watchdog
|
||||
|
||||
/* Include esp-idf headers first to avoid redefining BIT() macro */
|
||||
#if defined(CONFIG_SOC_SERIES_ESP32C6)
|
||||
#include <soc/lp_aon_reg.h>
|
||||
#else
|
||||
#include <soc/rtc_cntl_reg.h>
|
||||
#endif
|
||||
#include <soc/timer_group_reg.h>
|
||||
#include <hal/mwdt_ll.h>
|
||||
#include <hal/wdt_hal.h>
|
||||
@ -15,17 +19,17 @@
|
||||
#include <string.h>
|
||||
#include <zephyr/drivers/watchdog.h>
|
||||
#include <zephyr/drivers/clock_control.h>
|
||||
#ifndef CONFIG_SOC_SERIES_ESP32C3
|
||||
#include <zephyr/drivers/interrupt_controller/intc_esp32.h>
|
||||
#else
|
||||
#if defined(CONFIG_SOC_SERIES_ESP32C3) || defined(CONFIG_SOC_SERIES_ESP32C6)
|
||||
#include <zephyr/drivers/interrupt_controller/intc_esp32c3.h>
|
||||
#else
|
||||
#include <zephyr/drivers/interrupt_controller/intc_esp32.h>
|
||||
#endif
|
||||
#include <zephyr/device.h>
|
||||
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_REGISTER(wdt_esp32, CONFIG_WDT_LOG_LEVEL);
|
||||
|
||||
#ifdef CONFIG_SOC_SERIES_ESP32C3
|
||||
#if defined(CONFIG_SOC_SERIES_ESP32C3) || defined(CONFIG_SOC_SERIES_ESP32C6)
|
||||
#define ISR_HANDLER isr_handler_t
|
||||
#else
|
||||
#define ISR_HANDLER intr_handler_t
|
||||
|
||||
@ -78,6 +78,24 @@
|
||||
};
|
||||
};
|
||||
|
||||
wdt0: watchdog@6001f048 {
|
||||
compatible = "espressif,esp32-watchdog";
|
||||
reg = <0x6001f048 0x20>;
|
||||
interrupts = <TG0_WDT_LEVEL_INTR_SOURCE>;
|
||||
interrupt-parent = <&intc>;
|
||||
clocks = <&rtc ESP32_TIMG0_MODULE>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
wdt1: watchdog@60020048 {
|
||||
compatible = "espressif,esp32-watchdog";
|
||||
reg = <0x60020048 0x20>;
|
||||
interrupts = <TG1_WDT_LEVEL_INTR_SOURCE>;
|
||||
interrupt-parent = <&intc>;
|
||||
clocks = <&rtc ESP32_TIMG1_MODULE>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
flash: flash-controller@60002000 {
|
||||
compatible = "espressif,esp32-flash-controller";
|
||||
reg = <0x60002000 0x1000>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user