diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index 29a65a9303..bd852ac774 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -7,11 +7,12 @@ endif() set(srcs "compare_set.c" "cpu_util.c") if(NOT BOOTLOADER_BUILD) - list(APPEND srcs "esp_clk.c" "clk_ctrl_os.c" "mac_addr.c" "hw_random.c") + list(APPEND srcs "esp_async_memcpy.c" "esp_clk.c" "clk_ctrl_os.c" "mac_addr.c" "hw_random.c") endif() idf_component_register(SRCS ${srcs} INCLUDE_DIRS include include/soc + PRIV_INCLUDE_DIRS port/include REQUIRES ${requires} PRIV_REQUIRES efuse LDFRAGMENTS linker.lf) diff --git a/components/esp_hw_support/component.mk b/components/esp_hw_support/component.mk index b86f339418..cf003aa577 100644 --- a/components/esp_hw_support/component.mk +++ b/components/esp_hw_support/component.mk @@ -5,5 +5,7 @@ COMPONENT_ADD_LDFRAGMENTS := linker.lf port/$(IDF_TARGET)/rtc_clk.o: CFLAGS += -fno-jump-tables -fno-tree-switch-conversion ifdef IS_BOOTLOADER_BUILD -COMPONENT_OBJEXCLUDE += clk_ctrl_os.o mac_addr.o +COMPONENT_OBJEXCLUDE += clk_ctrl_os.o mac_addr.o esp_async_memcpy.o endif + +COMPONENT_OBJEXCLUDE += esp_async_memcpy.o diff --git a/components/esp_system/esp_async_memcpy.c b/components/esp_hw_support/esp_async_memcpy.c similarity index 100% rename from components/esp_system/esp_async_memcpy.c rename to components/esp_hw_support/esp_async_memcpy.c diff --git a/components/esp_system/include/esp_async_memcpy.h b/components/esp_hw_support/include/esp_async_memcpy.h similarity index 100% rename from components/esp_system/include/esp_async_memcpy.h rename to components/esp_hw_support/include/esp_async_memcpy.h diff --git a/components/esp_system/port/async_memcpy_impl_gdma.c b/components/esp_hw_support/port/async_memcpy_impl_gdma.c similarity index 100% rename from components/esp_system/port/async_memcpy_impl_gdma.c rename to components/esp_hw_support/port/async_memcpy_impl_gdma.c diff --git a/components/esp_hw_support/port/esp32c3/CMakeLists.txt b/components/esp_hw_support/port/esp32c3/CMakeLists.txt index c1fd4834e6..99b1f7929b 100644 --- a/components/esp_hw_support/port/esp32c3/CMakeLists.txt +++ b/components/esp_hw_support/port/esp32c3/CMakeLists.txt @@ -8,6 +8,10 @@ set(srcs "cpu_util_esp32c3.c" "chip_info.c" ) +if(NOT BOOTLOADER_BUILD) + list(APPEND srcs "../async_memcpy_impl_gdma.c") +endif() + add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" "${srcs}") target_sources(${COMPONENT_LIB} PRIVATE "${srcs}") diff --git a/components/esp_hw_support/port/esp32s2/CMakeLists.txt b/components/esp_hw_support/port/esp32s2/CMakeLists.txt index b7511af622..3dbb8190e0 100644 --- a/components/esp_hw_support/port/esp32s2/CMakeLists.txt +++ b/components/esp_hw_support/port/esp32s2/CMakeLists.txt @@ -13,6 +13,10 @@ set(srcs "chip_info.c" ) +if(NOT BOOTLOADER_BUILD) + list(APPEND srcs "async_memcpy_impl_cp_dma.c") +endif() + add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" "${srcs}") target_sources(${COMPONENT_LIB} PRIVATE "${srcs}") diff --git a/components/esp_system/port/soc/esp32s2/async_memcpy_impl_cp_dma.c b/components/esp_hw_support/port/esp32s2/async_memcpy_impl_cp_dma.c similarity index 100% rename from components/esp_system/port/soc/esp32s2/async_memcpy_impl_cp_dma.c rename to components/esp_hw_support/port/esp32s2/async_memcpy_impl_cp_dma.c diff --git a/components/esp_hw_support/port/esp32s3/CMakeLists.txt b/components/esp_hw_support/port/esp32s3/CMakeLists.txt index 93f125d65c..5f1a9d2f9b 100644 --- a/components/esp_hw_support/port/esp32s3/CMakeLists.txt +++ b/components/esp_hw_support/port/esp32s3/CMakeLists.txt @@ -12,6 +12,10 @@ set(srcs "chip_info.c" ) +if(NOT BOOTLOADER_BUILD) + list(APPEND srcs "../async_memcpy_impl_gdma.c") +endif() + add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" "${srcs}") target_sources(${COMPONENT_LIB} PRIVATE "${srcs}") diff --git a/components/esp_system/port/include/esp_async_memcpy_impl.h b/components/esp_hw_support/port/include/esp_async_memcpy_impl.h similarity index 97% rename from components/esp_system/port/include/esp_async_memcpy_impl.h rename to components/esp_hw_support/port/include/esp_async_memcpy_impl.h index 0b3c8b2b8c..80aac5c0fe 100644 --- a/components/esp_system/port/include/esp_async_memcpy_impl.h +++ b/components/esp_hw_support/port/include/esp_async_memcpy_impl.h @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include "esp_err.h" @@ -27,6 +31,7 @@ #include "esp_private/gdma.h" #endif + /** * @brief Type of async mcp implementation layer context * @@ -103,3 +108,7 @@ esp_err_t async_memcpy_impl_restart(async_memcpy_impl_t *impl); * @return True if both address are valid */ bool async_memcpy_impl_is_buffer_address_valid(async_memcpy_impl_t *impl, void *src, void *dst); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_system/test/test_async_memcpy.c b/components/esp_hw_support/test/test_async_memcpy.c similarity index 100% rename from components/esp_system/test/test_async_memcpy.c rename to components/esp_hw_support/test/test_async_memcpy.c diff --git a/components/esp_system/CMakeLists.txt b/components/esp_system/CMakeLists.txt index 2cde7bff29..fcb155d09f 100644 --- a/components/esp_system/CMakeLists.txt +++ b/components/esp_system/CMakeLists.txt @@ -15,7 +15,6 @@ else() "freertos_hooks.c" "intr_alloc.c" "int_wdt.c" - "esp_async_memcpy.c" "panic.c" "esp_system.c" "startup.c" diff --git a/components/esp_system/port/soc/esp32c3/CMakeLists.txt b/components/esp_system/port/soc/esp32c3/CMakeLists.txt index 72fa69ad6a..0725e3f02a 100644 --- a/components/esp_system/port/soc/esp32c3/CMakeLists.txt +++ b/components/esp_system/port/soc/esp32c3/CMakeLists.txt @@ -2,7 +2,6 @@ set(srcs "clk.c" "reset_reason.c" "system_internal.c" "cache_err_int.c" - "../../async_memcpy_impl_gdma.c" "apb_backup_dma.c" "../../arch/riscv/expression_with_stack.c" "../../arch/riscv/expression_with_stack_asm.S" diff --git a/components/esp_system/port/soc/esp32s2/CMakeLists.txt b/components/esp_system/port/soc/esp32s2/CMakeLists.txt index a9cc77a071..e8af06695e 100644 --- a/components/esp_system/port/soc/esp32s2/CMakeLists.txt +++ b/components/esp_system/port/soc/esp32s2/CMakeLists.txt @@ -1,5 +1,4 @@ -set(srcs "async_memcpy_impl_cp_dma.c" - "dport_panic_highint_hdl.S" +set(srcs "dport_panic_highint_hdl.S" "clk.c" "reset_reason.c" "system_internal.c" diff --git a/components/esp_system/port/soc/esp32s3/CMakeLists.txt b/components/esp_system/port/soc/esp32s3/CMakeLists.txt index 122b3fdf95..e8af06695e 100644 --- a/components/esp_system/port/soc/esp32s3/CMakeLists.txt +++ b/components/esp_system/port/soc/esp32s3/CMakeLists.txt @@ -3,7 +3,6 @@ set(srcs "dport_panic_highint_hdl.S" "reset_reason.c" "system_internal.c" "cache_err_int.c" - "../../async_memcpy_impl_gdma.c" "../../arch/xtensa/panic_arch.c" "../../arch/xtensa/panic_handler_asm.S" "../../arch/xtensa/expression_with_stack.c" diff --git a/docs/doxygen/Doxyfile_common b/docs/doxygen/Doxyfile_common index 774071eeb1..78b359af87 100644 --- a/docs/doxygen/Doxyfile_common +++ b/docs/doxygen/Doxyfile_common @@ -247,7 +247,7 @@ INPUT = \ ## Sleep $(IDF_PATH)/components/esp_system/include/esp_sleep.h \ ## Async memory copy - $(IDF_PATH)/components/esp_system/include/esp_async_memcpy.h \ + $(IDF_PATH)/components/esp_hw_support/include/esp_async_memcpy.h \ ## Logging $(IDF_PATH)/components/log/include/esp_log.h \ $(IDF_PATH)/components/esp_rom/include/esp_rom_sys.h \