From ea2aafbb7a8f0be57fcca24d6a895fe002829809 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Wed, 3 Mar 2021 17:59:11 +0800 Subject: [PATCH] esp32s2: move memprot api --- components/esp32c3/CMakeLists.txt | 3 +-- components/esp32s2/CMakeLists.txt | 3 +-- components/esp32s3/CMakeLists.txt | 1 - .../include => esp_hw_support/include/soc}/esp32c3/memprot.h | 2 ++ .../include => esp_hw_support/include/soc}/esp32s2/memprot.h | 0 .../include => esp_hw_support/include/soc}/esp32s3/memprot.h | 0 components/esp_hw_support/port/esp32c3/CMakeLists.txt | 2 +- components/{ => esp_hw_support/port}/esp32c3/memprot.c | 0 components/esp_hw_support/port/esp32s2/CMakeLists.txt | 2 +- components/{ => esp_hw_support/port}/esp32s2/memprot.c | 0 components/esp_hw_support/port/esp32s3/CMakeLists.txt | 2 +- components/{ => esp_hw_support/port}/esp32s3/memprot.c | 0 12 files changed, 7 insertions(+), 8 deletions(-) rename components/{esp32c3/include => esp_hw_support/include/soc}/esp32c3/memprot.h (99%) rename components/{esp32s2/include => esp_hw_support/include/soc}/esp32s2/memprot.h (100%) rename components/{esp32s3/include => esp_hw_support/include/soc}/esp32s3/memprot.h (100%) rename components/{ => esp_hw_support/port}/esp32c3/memprot.c (100%) rename components/{ => esp_hw_support/port}/esp32s2/memprot.c (100%) rename components/{ => esp_hw_support/port}/esp32s3/memprot.c (100%) diff --git a/components/esp32c3/CMakeLists.txt b/components/esp32c3/CMakeLists.txt index a785c520dc..1d00a870ee 100644 --- a/components/esp32c3/CMakeLists.txt +++ b/components/esp32c3/CMakeLists.txt @@ -14,8 +14,7 @@ else() set(srcs "dport_access.c" "esp_hmac.c" "esp_ds.c" - "esp_crypto_lock.c" - "memprot.c") + "esp_crypto_lock.c") set(include_dirs "include") set(requires driver efuse soc riscv) #unfortunately rom/uart uses SOC registers directly diff --git a/components/esp32s2/CMakeLists.txt b/components/esp32s2/CMakeLists.txt index 737d0ed696..209579c67b 100644 --- a/components/esp32s2/CMakeLists.txt +++ b/components/esp32s2/CMakeLists.txt @@ -11,8 +11,7 @@ if(BOOTLOADER_BUILD) else() # Regular app build - set(srcs "memprot.c" - "dport_access.c" + set(srcs "dport_access.c" "spiram.c" "spiram_psram.c" "esp_crypto_lock.c" diff --git a/components/esp32s3/CMakeLists.txt b/components/esp32s3/CMakeLists.txt index bf3205df54..f4a19a15da 100644 --- a/components/esp32s3/CMakeLists.txt +++ b/components/esp32s3/CMakeLists.txt @@ -14,7 +14,6 @@ else() set(srcs "dport_access.c" "esp_crypto_lock.c" - "memprot.c" "spiram.c" "spi_timing_config.c") set(include_dirs "include") diff --git a/components/esp32c3/include/esp32c3/memprot.h b/components/esp_hw_support/include/soc/esp32c3/memprot.h similarity index 99% rename from components/esp32c3/include/esp32c3/memprot.h rename to components/esp_hw_support/include/soc/esp32c3/memprot.h index 094f28f42e..0d7e6ca40d 100644 --- a/components/esp32c3/include/esp32c3/memprot.h +++ b/components/esp_hw_support/include/soc/esp32c3/memprot.h @@ -20,6 +20,8 @@ #pragma once #include +#include + #include "esp_attr.h" #ifdef __cplusplus diff --git a/components/esp32s2/include/esp32s2/memprot.h b/components/esp_hw_support/include/soc/esp32s2/memprot.h similarity index 100% rename from components/esp32s2/include/esp32s2/memprot.h rename to components/esp_hw_support/include/soc/esp32s2/memprot.h diff --git a/components/esp32s3/include/esp32s3/memprot.h b/components/esp_hw_support/include/soc/esp32s3/memprot.h similarity index 100% rename from components/esp32s3/include/esp32s3/memprot.h rename to components/esp_hw_support/include/soc/esp32s3/memprot.h diff --git a/components/esp_hw_support/port/esp32c3/CMakeLists.txt b/components/esp_hw_support/port/esp32c3/CMakeLists.txt index 3738e9b305..0bde69c4b8 100644 --- a/components/esp_hw_support/port/esp32c3/CMakeLists.txt +++ b/components/esp_hw_support/port/esp32c3/CMakeLists.txt @@ -9,7 +9,7 @@ set(srcs "cpu_util_esp32c3.c" ) if(NOT BOOTLOADER_BUILD) - list(APPEND srcs "../async_memcpy_impl_gdma.c") + list(APPEND srcs "../async_memcpy_impl_gdma.c" "memprot.c") endif() add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" "${srcs}") diff --git a/components/esp32c3/memprot.c b/components/esp_hw_support/port/esp32c3/memprot.c similarity index 100% rename from components/esp32c3/memprot.c rename to components/esp_hw_support/port/esp32c3/memprot.c diff --git a/components/esp_hw_support/port/esp32s2/CMakeLists.txt b/components/esp_hw_support/port/esp32s2/CMakeLists.txt index bd63e46898..2f46610a4b 100644 --- a/components/esp_hw_support/port/esp32s2/CMakeLists.txt +++ b/components/esp_hw_support/port/esp32s2/CMakeLists.txt @@ -14,7 +14,7 @@ set(srcs ) if(NOT BOOTLOADER_BUILD) - list(APPEND srcs "async_memcpy_impl_cp_dma.c") + list(APPEND srcs "async_memcpy_impl_cp_dma.c" "memprot.c") endif() add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" "${srcs}") diff --git a/components/esp32s2/memprot.c b/components/esp_hw_support/port/esp32s2/memprot.c similarity index 100% rename from components/esp32s2/memprot.c rename to components/esp_hw_support/port/esp32s2/memprot.c diff --git a/components/esp_hw_support/port/esp32s3/CMakeLists.txt b/components/esp_hw_support/port/esp32s3/CMakeLists.txt index 740c693562..b698f0b02e 100644 --- a/components/esp_hw_support/port/esp32s3/CMakeLists.txt +++ b/components/esp_hw_support/port/esp32s3/CMakeLists.txt @@ -13,7 +13,7 @@ set(srcs ) if(NOT BOOTLOADER_BUILD) - list(APPEND srcs "../async_memcpy_impl_gdma.c") + list(APPEND srcs "../async_memcpy_impl_gdma.c" "memprot.c") endif() add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" "${srcs}") diff --git a/components/esp32s3/memprot.c b/components/esp_hw_support/port/esp32s3/memprot.c similarity index 100% rename from components/esp32s3/memprot.c rename to components/esp_hw_support/port/esp32s3/memprot.c