Просмотр исходного кода

esp_system: move asysnc memcpy to esp_hw_support

Renz Bagaporo 5 лет назад
Родитель
Сommit
8762bfebde

+ 2 - 1
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)

+ 3 - 1
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

+ 0 - 0
components/esp_system/esp_async_memcpy.c → components/esp_hw_support/esp_async_memcpy.c


+ 0 - 0
components/esp_system/include/esp_async_memcpy.h → components/esp_hw_support/include/esp_async_memcpy.h


+ 0 - 0
components/esp_system/port/async_memcpy_impl_gdma.c → components/esp_hw_support/port/async_memcpy_impl_gdma.c


+ 4 - 0
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}")

+ 4 - 0
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}")
 

+ 0 - 0
components/esp_system/port/soc/esp32s2/async_memcpy_impl_cp_dma.c → components/esp_hw_support/port/esp32s2/async_memcpy_impl_cp_dma.c


+ 4 - 0
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}")
 

+ 9 - 0
components/esp_system/port/include/esp_async_memcpy_impl.h → 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 <stdint.h>
 #include <stdbool.h>
 #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

+ 0 - 0
components/esp_system/test/test_async_memcpy.c → components/esp_hw_support/test/test_async_memcpy.c


+ 0 - 1
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"

+ 0 - 1
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"

+ 1 - 2
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"

+ 0 - 1
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"

+ 1 - 1
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 \