forked from espressif/esp-idf
change(wdt): create wdt_periph.c in soc component
This commit is contained in:
@@ -17,7 +17,7 @@ extern "C" {
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "hal/misc.h"
|
#include "hal/misc.h"
|
||||||
#include "hal/assert.h"
|
#include "hal/assert.h"
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
#include "esp_attr.h"
|
#include "esp_attr.h"
|
||||||
|
@@ -15,7 +15,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
#include "esp_attr.h"
|
#include "esp_attr.h"
|
||||||
|
@@ -15,7 +15,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
#include "hal/assert.h"
|
#include "hal/assert.h"
|
||||||
|
@@ -15,7 +15,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "soc/pcr_struct.h"
|
#include "soc/pcr_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
|
@@ -15,7 +15,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "soc/pcr_struct.h"
|
#include "soc/pcr_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
|
@@ -15,7 +15,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "soc/pcr_struct.h"
|
#include "soc/pcr_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -15,7 +15,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "soc/pcr_struct.h"
|
#include "soc/pcr_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
|
@@ -15,7 +15,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "soc/hp_sys_clkrst_struct.h"
|
#include "soc/hp_sys_clkrst_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
|
@@ -16,7 +16,7 @@ extern "C" {
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "esp_assert.h"
|
#include "esp_assert.h"
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
#include "hal/assert.h"
|
#include "hal/assert.h"
|
||||||
|
@@ -16,7 +16,7 @@ extern "C" {
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "hal/misc.h"
|
#include "hal/misc.h"
|
||||||
#include "soc/timer_periph.h"
|
#include "soc/wdt_periph.h"
|
||||||
#include "soc/timer_group_struct.h"
|
#include "soc/timer_group_struct.h"
|
||||||
#include "hal/wdt_types.h"
|
#include "hal/wdt_types.h"
|
||||||
#include "hal/assert.h"
|
#include "hal/assert.h"
|
||||||
|
@@ -121,6 +121,10 @@ if(CONFIG_SOC_TWAI_SUPPORTED)
|
|||||||
list(APPEND srcs "${target_folder}/twai_periph.c")
|
list(APPEND srcs "${target_folder}/twai_periph.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_SOC_WDT_SUPPORTED)
|
||||||
|
list(APPEND srcs "${target_folder}/wdt_periph.c")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CONFIG_SOC_IEEE802154_SUPPORTED)
|
if(CONFIG_SOC_IEEE802154_SUPPORTED)
|
||||||
if(NOT target STREQUAL "esp32h4")
|
if(NOT target STREQUAL "esp32h4")
|
||||||
list(APPEND srcs "${target_folder}/ieee802154_periph.c")
|
list(APPEND srcs "${target_folder}/ieee802154_periph.c")
|
||||||
|
7
components/soc/esp32/wdt_periph.c
Normal file
7
components/soc/esp32/wdt_periph.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
7
components/soc/esp32c2/wdt_periph.c
Normal file
7
components/soc/esp32c2/wdt_periph.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
7
components/soc/esp32c3/wdt_periph.c
Normal file
7
components/soc/esp32c3/wdt_periph.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
7
components/soc/esp32c5/wdt_periph.c
Normal file
7
components/soc/esp32c5/wdt_periph.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
@@ -1131,6 +1131,10 @@ config SOC_MWDT_SUPPORT_XTAL
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_MWDT_SUPPORT_SLEEP_RETENTION
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_TWAI_CONTROLLER_NUM
|
config SOC_TWAI_CONTROLLER_NUM
|
||||||
int
|
int
|
||||||
default 2
|
default 2
|
||||||
|
@@ -447,6 +447,7 @@
|
|||||||
|
|
||||||
/*--------------------------- WATCHDOG CAPS ---------------------------------------*/
|
/*--------------------------- WATCHDOG CAPS ---------------------------------------*/
|
||||||
#define SOC_MWDT_SUPPORT_XTAL (1)
|
#define SOC_MWDT_SUPPORT_XTAL (1)
|
||||||
|
#define SOC_MWDT_SUPPORT_SLEEP_RETENTION (1)
|
||||||
|
|
||||||
/*-------------------------- TWAI CAPS ---------------------------------------*/
|
/*-------------------------- TWAI CAPS ---------------------------------------*/
|
||||||
#define SOC_TWAI_CONTROLLER_NUM 2
|
#define SOC_TWAI_CONTROLLER_NUM 2
|
||||||
|
32
components/soc/esp32c6/wdt_periph.c
Normal file
32
components/soc/esp32c6/wdt_periph.c
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
||||||
|
|
||||||
|
#define N_REGS_TGWDT 6 // TIMG_WDTCONFIG0_REG ... TIMG_WDTCONFIG5_REG & TIMG_INT_ENA_TIMERS_REG
|
||||||
|
|
||||||
|
static const regdma_entries_config_t tg0_wdt_regs_retention[] = {
|
||||||
|
[0] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x00), TIMG_WDTWPROTECT_REG(0), TIMG_WDT_WKEY_VALUE, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG0_WDT_LINK(0x01), TIMG_WDTCONFIG0_REG(0), TIMG_WDTCONFIG0_REG(0), N_REGS_TGWDT, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[2] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x02), TIMG_WDTCONFIG0_REG(0), TIMG_WDT_CONF_UPDATE_EN, TIMG_WDT_CONF_UPDATE_EN_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[3] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x03), TIMG_WDTFEED_REG(0), TIMG_WDT_FEED, TIMG_WDT_FEED_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[4] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG0_WDT_LINK(0x04), TIMG_INT_ENA_TIMERS_REG(0),TIMG_INT_ENA_TIMERS_REG(0), 1, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[5] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x05), TIMG_WDTWPROTECT_REG(0), 0, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const regdma_entries_config_t tg1_wdt_regs_retention[] = {
|
||||||
|
[0] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG1_WDT_LINK(0x00), TIMG_WDTWPROTECT_REG(1), TIMG_WDT_WKEY_VALUE, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG1_WDT_LINK(0x01), TIMG_INT_ENA_TIMERS_REG(1),TIMG_INT_ENA_TIMERS_REG(1), 1, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[2] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG1_WDT_LINK(0x02), TIMG_WDTCONFIG0_REG(1), TIMG_WDTCONFIG0_REG(1), N_REGS_TGWDT, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[3] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG1_WDT_LINK(0x03), TIMG_WDTCONFIG0_REG(1), TIMG_WDT_CONF_UPDATE_EN, TIMG_WDT_CONF_UPDATE_EN_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[4] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x04), TIMG_WDTFEED_REG(1), TIMG_WDT_FEED, TIMG_WDT_FEED_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[5] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG1_WDT_LINK(0x05), TIMG_WDTWPROTECT_REG(1), 0, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
};
|
||||||
|
|
||||||
|
const tg_reg_ctx_link_t tg_wdt_regs_retention[SOC_TIMER_GROUPS] = {
|
||||||
|
[0] = {tg0_wdt_regs_retention, ARRAY_SIZE(tg0_wdt_regs_retention)},
|
||||||
|
[1] = {tg1_wdt_regs_retention, ARRAY_SIZE(tg1_wdt_regs_retention)},
|
||||||
|
};
|
7
components/soc/esp32c61/wdt_periph.c
Normal file
7
components/soc/esp32c61/wdt_periph.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
@@ -1135,6 +1135,10 @@ config SOC_MWDT_SUPPORT_XTAL
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_MWDT_SUPPORT_SLEEP_RETENTION
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_TWAI_CONTROLLER_NUM
|
config SOC_TWAI_CONTROLLER_NUM
|
||||||
int
|
int
|
||||||
default 1
|
default 1
|
||||||
|
@@ -445,6 +445,7 @@
|
|||||||
|
|
||||||
/*--------------------------- WATCHDOG CAPS ---------------------------------------*/
|
/*--------------------------- WATCHDOG CAPS ---------------------------------------*/
|
||||||
#define SOC_MWDT_SUPPORT_XTAL (1)
|
#define SOC_MWDT_SUPPORT_XTAL (1)
|
||||||
|
#define SOC_MWDT_SUPPORT_SLEEP_RETENTION (1)
|
||||||
|
|
||||||
/*-------------------------- TWAI CAPS ---------------------------------------*/
|
/*-------------------------- TWAI CAPS ---------------------------------------*/
|
||||||
#define SOC_TWAI_CONTROLLER_NUM 1UL
|
#define SOC_TWAI_CONTROLLER_NUM 1UL
|
||||||
|
32
components/soc/esp32h2/wdt_periph.c
Normal file
32
components/soc/esp32h2/wdt_periph.c
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
||||||
|
|
||||||
|
#define N_REGS_TGWDT 6 // TIMG_WDTCONFIG0_REG ... TIMG_WDTCONFIG5_REG & TIMG_INT_ENA_TIMERS_REG
|
||||||
|
|
||||||
|
static const regdma_entries_config_t tg0_wdt_regs_retention[] = {
|
||||||
|
[0] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x00), TIMG_WDTWPROTECT_REG(0), TIMG_WDT_WKEY_VALUE, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG0_WDT_LINK(0x01), TIMG_WDTCONFIG0_REG(0), TIMG_WDTCONFIG0_REG(0), N_REGS_TGWDT, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[2] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x02), TIMG_WDTCONFIG0_REG(0), TIMG_WDT_CONF_UPDATE_EN, TIMG_WDT_CONF_UPDATE_EN_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[3] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x03), TIMG_WDTFEED_REG(0), TIMG_WDT_FEED, TIMG_WDT_FEED_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[4] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG0_WDT_LINK(0x04), TIMG_INT_ENA_TIMERS_REG(0),TIMG_INT_ENA_TIMERS_REG(0), 1, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[5] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x05), TIMG_WDTWPROTECT_REG(0), 0, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const regdma_entries_config_t tg1_wdt_regs_retention[] = {
|
||||||
|
[0] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG1_WDT_LINK(0x00), TIMG_WDTWPROTECT_REG(1), TIMG_WDT_WKEY_VALUE, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG1_WDT_LINK(0x01), TIMG_INT_ENA_TIMERS_REG(1),TIMG_INT_ENA_TIMERS_REG(1), 1, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[2] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG1_WDT_LINK(0x02), TIMG_WDTCONFIG0_REG(1), TIMG_WDTCONFIG0_REG(1), N_REGS_TGWDT, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[3] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG1_WDT_LINK(0x03), TIMG_WDTCONFIG0_REG(1), TIMG_WDT_CONF_UPDATE_EN, TIMG_WDT_CONF_UPDATE_EN_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[4] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x04), TIMG_WDTFEED_REG(1), TIMG_WDT_FEED, TIMG_WDT_FEED_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[5] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG1_WDT_LINK(0x05), TIMG_WDTWPROTECT_REG(1), 0, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
};
|
||||||
|
|
||||||
|
const tg_reg_ctx_link_t tg_wdt_regs_retention[SOC_TIMER_GROUPS] = {
|
||||||
|
[0] = {tg0_wdt_regs_retention, ARRAY_SIZE(tg0_wdt_regs_retention)},
|
||||||
|
[1] = {tg1_wdt_regs_retention, ARRAY_SIZE(tg1_wdt_regs_retention)},
|
||||||
|
};
|
@@ -1399,6 +1399,10 @@ config SOC_MWDT_SUPPORT_XTAL
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_MWDT_SUPPORT_SLEEP_RETENTION
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_TOUCH_SENSOR_VERSION
|
config SOC_TOUCH_SENSOR_VERSION
|
||||||
int
|
int
|
||||||
default 3
|
default 3
|
||||||
|
@@ -546,6 +546,7 @@
|
|||||||
|
|
||||||
/*--------------------------- WATCHDOG CAPS ---------------------------------------*/
|
/*--------------------------- WATCHDOG CAPS ---------------------------------------*/
|
||||||
#define SOC_MWDT_SUPPORT_XTAL (1)
|
#define SOC_MWDT_SUPPORT_XTAL (1)
|
||||||
|
#define SOC_MWDT_SUPPORT_SLEEP_RETENTION (1)
|
||||||
|
|
||||||
/*-------------------------- TOUCH SENSOR CAPS -------------------------------*/
|
/*-------------------------- TOUCH SENSOR CAPS -------------------------------*/
|
||||||
#define SOC_TOUCH_SENSOR_VERSION (3) /*!< Hardware version of touch sensor */
|
#define SOC_TOUCH_SENSOR_VERSION (3) /*!< Hardware version of touch sensor */
|
||||||
|
33
components/soc/esp32p4/wdt_periph.c
Normal file
33
components/soc/esp32p4/wdt_periph.c
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define N_REGS_TGWDT 6 // TIMG_WDTCONFIG0_REG ... TIMG_WDTCONFIG5_REG & TIMG_INT_ENA_TIMERS_REG
|
||||||
|
|
||||||
|
static const regdma_entries_config_t tg0_wdt_regs_retention[] = {
|
||||||
|
[0] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x00), TIMG_WDTWPROTECT_REG(0), TIMG_WDT_WKEY_VALUE, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG0_WDT_LINK(0x01), TIMG_WDTCONFIG0_REG(0), TIMG_WDTCONFIG0_REG(0), N_REGS_TGWDT, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[2] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x02), TIMG_WDTCONFIG0_REG(0), TIMG_WDT_CONF_UPDATE_EN, TIMG_WDT_CONF_UPDATE_EN_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[3] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x03), TIMG_WDTFEED_REG(0), TIMG_WDT_FEED, TIMG_WDT_FEED_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[4] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG0_WDT_LINK(0x04), TIMG_INT_ENA_TIMERS_REG(0),TIMG_INT_ENA_TIMERS_REG(0), 1, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[5] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x05), TIMG_WDTWPROTECT_REG(0), 0, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const regdma_entries_config_t tg1_wdt_regs_retention[] = {
|
||||||
|
[0] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG1_WDT_LINK(0x00), TIMG_WDTWPROTECT_REG(1), TIMG_WDT_WKEY_VALUE, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG1_WDT_LINK(0x01), TIMG_INT_ENA_TIMERS_REG(1),TIMG_INT_ENA_TIMERS_REG(1), 1, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[2] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_TG1_WDT_LINK(0x02), TIMG_WDTCONFIG0_REG(1), TIMG_WDTCONFIG0_REG(1), N_REGS_TGWDT, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[3] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG1_WDT_LINK(0x03), TIMG_WDTCONFIG0_REG(1), TIMG_WDT_CONF_UPDATE_EN, TIMG_WDT_CONF_UPDATE_EN_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[4] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG0_WDT_LINK(0x04), TIMG_WDTFEED_REG(1), TIMG_WDT_FEED, TIMG_WDT_FEED_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
[5] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_TG1_WDT_LINK(0x05), TIMG_WDTWPROTECT_REG(1), 0, TIMG_WDT_WKEY_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
};
|
||||||
|
|
||||||
|
const tg_reg_ctx_link_t tg_wdt_regs_retention[SOC_TIMER_GROUPS] = {
|
||||||
|
[0] = {tg0_wdt_regs_retention, ARRAY_SIZE(tg0_wdt_regs_retention)},
|
||||||
|
[1] = {tg1_wdt_regs_retention, ARRAY_SIZE(tg1_wdt_regs_retention)},
|
||||||
|
};
|
7
components/soc/esp32s2/wdt_periph.c
Normal file
7
components/soc/esp32s2/wdt_periph.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
7
components/soc/esp32s3/wdt_periph.c
Normal file
7
components/soc/esp32s3/wdt_periph.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "soc/wdt_periph.h"
|
@@ -17,9 +17,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The value that needs to be written to TIMG_WDT_WKEY to write-enable the wdt registers */
|
|
||||||
#define TIMG_WDT_WKEY_VALUE 0x50D83AA1
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
struct {
|
struct {
|
||||||
const periph_module_t module; // Peripheral module
|
const periph_module_t module; // Peripheral module
|
||||||
|
34
components/soc/include/soc/wdt_periph.h
Normal file
34
components/soc/include/soc/wdt_periph.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "soc/timer_group_reg.h"
|
||||||
|
#include "soc/timer_group_struct.h"
|
||||||
|
#include "soc/soc_caps.h"
|
||||||
|
#include "soc/periph_defs.h"
|
||||||
|
#include "soc/regdma.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The value that needs to be written to TIMG_WDT_WKEY to write-enable the wdt registers */
|
||||||
|
#define TIMG_WDT_WKEY_VALUE 0x50D83AA1
|
||||||
|
|
||||||
|
#if SOC_MWDT_SUPPORT_SLEEP_RETENTION
|
||||||
|
typedef struct {
|
||||||
|
const regdma_entries_config_t *link_list;
|
||||||
|
uint32_t link_num;
|
||||||
|
} tg_reg_ctx_link_t;
|
||||||
|
|
||||||
|
extern const tg_reg_ctx_link_t tg_wdt_regs_retention[SOC_TIMER_GROUPS];
|
||||||
|
#endif // SOC_MWDT_SUPPORT_SLEEP_RETENTION
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
Reference in New Issue
Block a user