From b530632f333cbc96be68a43f39a1b5f983e37907 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Fri, 8 Apr 2022 16:22:15 +0800 Subject: [PATCH] esp32c2: fix soc_caps defines --- .../port/soc/esp32c2/CMakeLists.txt | 1 - .../port/soc/esp32c2/apb_backup_dma.c | 37 ------------------- .../esp32c2/include/soc/Kconfig.soc_caps.in | 8 +--- components/soc/esp32c2/include/soc/soc_caps.h | 5 +-- 4 files changed, 3 insertions(+), 48 deletions(-) delete mode 100644 components/esp_system/port/soc/esp32c2/apb_backup_dma.c diff --git a/components/esp_system/port/soc/esp32c2/CMakeLists.txt b/components/esp_system/port/soc/esp32c2/CMakeLists.txt index 0725e3f02a..06734055f0 100644 --- a/components/esp_system/port/soc/esp32c2/CMakeLists.txt +++ b/components/esp_system/port/soc/esp32c2/CMakeLists.txt @@ -2,7 +2,6 @@ set(srcs "clk.c" "reset_reason.c" "system_internal.c" "cache_err_int.c" - "apb_backup_dma.c" "../../arch/riscv/expression_with_stack.c" "../../arch/riscv/expression_with_stack_asm.S" "../../arch/riscv/panic_arch.c") diff --git a/components/esp_system/port/soc/esp32c2/apb_backup_dma.c b/components/esp_system/port/soc/esp32c2/apb_backup_dma.c deleted file mode 100644 index 2cfb2af011..0000000000 --- a/components/esp_system/port/soc/esp32c2/apb_backup_dma.c +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "soc/soc_caps.h" -#include "esp_attr.h" -#include "freertos/FreeRTOS.h" -#include "freertos/portmacro.h" -#include "esp32c2/rom/apb_backup_dma.h" - -static portMUX_TYPE s_apb_backup_dma_mutex = portMUX_INITIALIZER_UNLOCKED; - -static void IRAM_ATTR apb_backup_dma_lock(void) -{ - if (xPortInIsrContext()) { - portENTER_CRITICAL_ISR(&s_apb_backup_dma_mutex); - } else { - portENTER_CRITICAL(&s_apb_backup_dma_mutex); - } -} - -static void IRAM_ATTR apb_backup_dma_unlock(void) -{ - if (xPortInIsrContext()) { - portEXIT_CRITICAL_ISR(&s_apb_backup_dma_mutex); - } else { - portEXIT_CRITICAL(&s_apb_backup_dma_mutex); - } -} - -void esp_apb_backup_dma_lock_init(void) -{ - ets_apb_backup_init_lock_func(apb_backup_dma_lock, apb_backup_dma_unlock); -} diff --git a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in index 87350f552e..d908620039 100644 --- a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in @@ -123,10 +123,6 @@ config SOC_ADC_MAX_BITWIDTH int default 12 -config SOC_APB_BACKUP_DMA - bool - default y - config SOC_BROWNOUT_RESET_SUPPORTED bool default y @@ -452,8 +448,8 @@ config SOC_SECURE_BOOT_V2_ECC default y config SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS - bool - default y + int + default 1 config SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX int diff --git a/components/soc/esp32c2/include/soc/soc_caps.h b/components/soc/esp32c2/include/soc/soc_caps.h index 9d644c92bf..a14b3a466d 100644 --- a/components/soc/esp32c2/include/soc/soc_caps.h +++ b/components/soc/esp32c2/include/soc/soc_caps.h @@ -66,9 +66,6 @@ /*!< RTC */ #define SOC_ADC_MAX_BITWIDTH (12) -/*-------------------------- APB BACKUP DMA CAPS -------------------------------*/ -#define SOC_APB_BACKUP_DMA (1) - /*-------------------------- BROWNOUT CAPS -----------------------------------*/ #define SOC_BROWNOUT_RESET_SUPPORTED 1 @@ -231,7 +228,7 @@ /*-------------------------- Secure Boot CAPS----------------------------*/ #define SOC_SECURE_BOOT_V2_ECC 1 -#define SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS 1 +#define SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS (1U) /*-------------------------- Flash Encryption CAPS----------------------------*/ #define SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX (32)