Sfoglia il codice sorgente

create xtensa component

1. move xtensa specific files out of esp32 component
2. merge xtensa-debug-module component into xtensa
morris 7 anni fa
parent
commit
dbdb299bb1
49 ha cambiato i file con 38 aggiunte e 29 eliminazioni
  1. 1 1
      components/app_trace/CMakeLists.txt
  2. 1 1
      components/bootloader/subproject/CMakeLists.txt
  3. 1 0
      components/bootloader/subproject/Makefile
  4. 1 1
      components/esp32/CMakeLists.txt
  5. 1 2
      components/esp_common/CMakeLists.txt
  6. 2 0
      components/fatfs/test_fatfs_host/Makefile.files
  7. 1 1
      components/lwip/test_afl_host/Makefile
  8. 1 1
      components/soc/CMakeLists.txt
  9. 2 0
      components/spi_flash/sim/Makefile.files
  10. 2 0
      components/spi_flash/sim/stubs/Makefile.files
  11. 2 0
      components/spiffs/test_spiffs_host/Makefile.files
  12. 2 0
      components/wear_levelling/test_wl_host/Makefile.files
  13. 0 9
      components/xtensa-debug-module/CMakeLists.txt
  14. 0 5
      components/xtensa-debug-module/component.mk
  15. 0 4
      components/xtensa-debug-module/linker.lf
  16. 7 0
      components/xtensa/CMakeLists.txt
  17. 4 0
      components/xtensa/component.mk
  18. 0 0
      components/xtensa/eri.c
  19. 0 0
      components/xtensa/esp32/include/xtensa/config/core-isa.h
  20. 0 0
      components/xtensa/esp32/include/xtensa/config/core-matmap.h
  21. 3 3
      components/xtensa/esp32/include/xtensa/config/core.h
  22. 0 0
      components/xtensa/esp32/include/xtensa/config/defs.h
  23. 0 0
      components/xtensa/esp32/include/xtensa/config/specreg.h
  24. 0 0
      components/xtensa/esp32/include/xtensa/config/system.h
  25. 0 0
      components/xtensa/esp32/include/xtensa/config/tie-asm.h
  26. 0 0
      components/xtensa/esp32/include/xtensa/config/tie.h
  27. 0 0
      components/xtensa/include/eri.h
  28. 0 0
      components/xtensa/include/trax.h
  29. 0 0
      components/xtensa/include/xtensa-debug-module.h
  30. 0 0
      components/xtensa/include/xtensa/cacheasm.h
  31. 0 0
      components/xtensa/include/xtensa/cacheattrasm.h
  32. 0 0
      components/xtensa/include/xtensa/core-macros.h
  33. 0 0
      components/xtensa/include/xtensa/coreasm.h
  34. 0 0
      components/xtensa/include/xtensa/corebits.h
  35. 0 0
      components/xtensa/include/xtensa/hal.h
  36. 0 0
      components/xtensa/include/xtensa/specreg.h
  37. 0 0
      components/xtensa/include/xtensa/traxreg.h
  38. 0 0
      components/xtensa/include/xtensa/xdm-regs.h
  39. 0 0
      components/xtensa/include/xtensa/xt_perf_consts.h
  40. 0 0
      components/xtensa/include/xtensa/xtensa-libdb-macros.h
  41. 0 0
      components/xtensa/include/xtensa/xtensa-versions.h
  42. 0 0
      components/xtensa/include/xtensa/xtensa-xer.h
  43. 0 0
      components/xtensa/include/xtensa/xtruntime-core-state.h
  44. 0 0
      components/xtensa/include/xtensa/xtruntime-frames.h
  45. 0 0
      components/xtensa/include/xtensa/xtruntime.h
  46. 4 0
      components/xtensa/linker.lf
  47. 0 0
      components/xtensa/trax.c
  48. 1 0
      tools/ci/test_build_system_cmake.sh
  49. 2 1
      tools/cmake/idf_functions.cmake

+ 1 - 1
components/app_trace/CMakeLists.txt

@@ -17,7 +17,7 @@ if(CONFIG_SYSVIEW_ENABLE)
 endif()
 
 set(COMPONENT_REQUIRES)
-set(COMPONENT_PRIV_REQUIRES xtensa-debug-module)
+set(COMPONENT_PRIV_REQUIRES)
 set(COMPONENT_ADD_LDFRAGMENTS linker.lf)
 
 register_component()

+ 1 - 1
components/bootloader/subproject/CMakeLists.txt

@@ -14,7 +14,7 @@ set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_suppor
 set(BOOTLOADER_BUILD 1)
 add_definitions(-DBOOTLOADER_BUILD=1)
 
-set(COMPONENT_REQUIRES_COMMON log esp32 soc esp_rom esp_common)
+set(COMPONENT_REQUIRES_COMMON log esp32 soc esp_rom esp_common xtensa)
 
 include("${IDF_PATH}/tools/cmake/project.cmake")
 project(bootloader)

+ 1 - 0
components/bootloader/subproject/Makefile

@@ -18,6 +18,7 @@ CXXFLAGS =
 CFLAGS += -I $(IDF_PATH)/components/esp32/include
 CFLAGS += -I $(IDF_PATH)/components/esp_rom/include
 CFLAGS += -I $(IDF_PATH)/components/esp_common/include
+CFLAGS += -I $(IDF_PATH)/components/xtensa/include -I $(IDF_PATH)/components/xtensa/esp32/include
 
 # The bootloader pseudo-component is also included in this build, for its Kconfig.projbuild to be included.
 #

+ 1 - 1
components/esp32/CMakeLists.txt

@@ -48,7 +48,7 @@ else()
     # app_update is added here because cpu_start.c uses esp_ota_get_app_description() function.
     set(COMPONENT_PRIV_REQUIRES
         app_trace app_update bootloader_support log mbedtls nvs_flash
-        pthread smartconfig_ack spi_flash vfs wpa_supplicant xtensa-debug-module espcoredump esp_common)
+        pthread smartconfig_ack spi_flash vfs wpa_supplicant espcoredump esp_common)
 
     set(COMPONENT_ADD_LDFRAGMENTS linker.lf ld/esp32_fragments.lf)
 

+ 1 - 2
components/esp_common/CMakeLists.txt

@@ -16,8 +16,7 @@ else()
     set(COMPONENT_ADD_INCLUDEDIRS "include")
     set(COMPONENT_PRIV_INCLUDEDIRS)
     set(COMPONENT_REQUIRES)
-    # dbg_stubs.c needs eri.h from xtensa-debug-module
-    set(COMPONENT_PRIV_REQUIRES "xtensa-debug-module")
+
     register_component()
 
     set_source_files_properties(

+ 2 - 0
components/fatfs/test_fatfs_host/Makefile.files

@@ -22,6 +22,8 @@ INCLUDE_DIRS := \
 	) \
 	$(addprefix ../../../components/, \
 	esp_rom/include \
+	xtensa/include \
+	xtensa/esp32/include \
 	soc/esp32/include \
 	esp32/include \
 	esp_common/include \

+ 1 - 1
components/lwip/test_afl_host/Makefile

@@ -1,7 +1,7 @@
 COMPONENTS_DIR=../..
 CFLAGS=-std=gnu99 -Og -ggdb -ffunction-sections -fdata-sections -nostdlib -Wall  -Werror=all -Wno-int-to-pointer-cast -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra \
 -Wno-unused-parameter -Wno-sign-compare -Wno-address   -Wno-unused-variable -DESP_PLATFORM -D IDF_VER=\"v3.1\" -MMD -MP -DWITH_POSIX
-INC_DIRS=-I . -I ./build/config -I $(COMPONENTS_DIR)/newlib/platform_include -I $(COMPONENTS_DIR)/newlib/include -I $(COMPONENTS_DIR)/driver/include -I $(COMPONENTS_DIR)/esp32/include -I $(COMPONENTS_DIR)/ethernet/include -I $(COMPONENTS_DIR)/freertos/include -I $(COMPONENTS_DIR)/heap/include -I $(COMPONENTS_DIR)/lwip/lwip/src/include  -I $(COMPONENTS_DIR)/lwip/include/apps -I $(COMPONENTS_DIR)/lwip/lwip/src/include/netif -I $(COMPONENTS_DIR)/lwip/lwip/src/include/posix -I $(COMPONENTS_DIR)/lwip/port/esp32/include -I $(COMPONENTS_DIR)/lwip/lwip/src/include/posix -I $(COMPONENTS_DIR)/lwip/include/apps/ping -I $(COMPONENTS_DIR)/soc/esp32/include -I $(COMPONENTS_DIR)/soc/include -I $(COMPONENTS_DIR)/tcpip_adapter/include -I $(COMPONENTS_DIR)/esp_rom/include  -I $(COMPONENTS_DIR)/xtensa-debug-module/include
+INC_DIRS=-I . -I ./build/config -I $(COMPONENTS_DIR)/newlib/platform_include -I $(COMPONENTS_DIR)/newlib/include -I $(COMPONENTS_DIR)/driver/include -I $(COMPONENTS_DIR)/esp32/include -I $(COMPONENTS_DIR)/ethernet/include -I $(COMPONENTS_DIR)/freertos/include -I $(COMPONENTS_DIR)/heap/include -I $(COMPONENTS_DIR)/lwip/lwip/src/include  -I $(COMPONENTS_DIR)/lwip/include/apps -I $(COMPONENTS_DIR)/lwip/lwip/src/include/netif -I $(COMPONENTS_DIR)/lwip/lwip/src/include/posix -I $(COMPONENTS_DIR)/lwip/port/esp32/include -I $(COMPONENTS_DIR)/lwip/lwip/src/include/posix -I $(COMPONENTS_DIR)/lwip/include/apps/ping -I $(COMPONENTS_DIR)/soc/esp32/include -I $(COMPONENTS_DIR)/soc/include -I $(COMPONENTS_DIR)/tcpip_adapter/include -I $(COMPONENTS_DIR)/esp_rom/include  -I $(COMPONENTS_DIR)/esp_common/include -I $(COMPONENTS_DIR)/xtensa/include
 TEST_NAME=test
 FUZZ=afl-fuzz
 GEN_CFG=generate_config

+ 1 - 1
components/soc/CMakeLists.txt

@@ -13,6 +13,6 @@ list(APPEND COMPONENT_SRCS "src/memory_layout_utils.c")
 
 set(COMPONENT_ADD_LDFRAGMENTS linker.lf)
 
-set(COMPONENT_REQUIRES esp_rom)
+set(COMPONENT_REQUIRES)
 
 register_component()

+ 2 - 0
components/spi_flash/sim/Makefile.files

@@ -24,6 +24,8 @@ INCLUDE_DIRS := \
 	$(addprefix ../../../components/, \
 	esp_rom/include \
 	esp_common/include \
+	xtensa/include \
+	xtensa/esp32/include \
 	soc/esp32/include \
 	esp32/include \
 	bootloader_support/include \

+ 2 - 0
components/spi_flash/sim/stubs/Makefile.files

@@ -20,6 +20,8 @@ INCLUDE_DIRS := \
 	$(addprefix ../../../../components/, \
 	esp_common/include \
 	soc/esp32/include \
+	xtensa/include \
+	xtensa/esp32/include \
 	esp32/include \
 	bootloader_support/include \
 	app_update/include \

+ 2 - 0
components/spiffs/test_spiffs_host/Makefile.files

@@ -26,6 +26,8 @@ INCLUDE_DIRS := \
 	$(addprefix ../../../components/, \
 	esp_rom/include \
 	esp_common/include \
+	xtensa/include \
+	xtensa/esp32/include \
 	soc/esp32/include \
 	esp32/include \
 	bootloader_support/include \

+ 2 - 0
components/wear_levelling/test_wl_host/Makefile.files

@@ -25,6 +25,8 @@ INCLUDE_DIRS := \
 	$(addprefix ../../../components/, \
 	esp_rom/include \
 	esp_common/include \
+	xtensa/include \
+	xtensa/esp32/include \
 	soc/esp32/include \
 	esp32/include \
 	bootloader_support/include \

+ 0 - 9
components/xtensa-debug-module/CMakeLists.txt

@@ -1,9 +0,0 @@
-set(COMPONENT_SRCS "eri.c"
-                   "trax.c")
-set(COMPONENT_ADD_INCLUDEDIRS "include")
-
-set(COMPONENT_REQUIRES "")
-
-set(COMPONENT_ADD_LDFRAGMENTS linker.lf)
-
-register_component()

+ 0 - 5
components/xtensa-debug-module/component.mk

@@ -1,5 +0,0 @@
-#
-# Component Makefile
-#
-# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
-COMPONENT_ADD_LDFRAGMENTS += linker.lf

+ 0 - 4
components/xtensa-debug-module/linker.lf

@@ -1,4 +0,0 @@
-[mapping]
-archive: libxtensa-debug-module.a
-entries: 
-    eri (noflash_text)

+ 7 - 0
components/xtensa/CMakeLists.txt

@@ -0,0 +1,7 @@
+set(COMPONENT_SRCS "eri.c" "trax.c")
+
+set(COMPONENT_ADD_INCLUDEDIRS "include" "${IDF_TARGET}/include")
+
+set(COMPONENT_ADD_LDFRAGMENTS linker.lf)
+
+register_component()

+ 4 - 0
components/xtensa/component.mk

@@ -0,0 +1,4 @@
+COMPONENT_ADD_INCLUDEDIRS := include esp32/include
+
+COMPONENT_ADD_LDFRAGMENTS += linker.lf
+

+ 0 - 0
components/xtensa-debug-module/eri.c → components/xtensa/eri.c


+ 0 - 0
components/esp32/include/xtensa/config/core-isa.h → components/xtensa/esp32/include/xtensa/config/core-isa.h


+ 0 - 0
components/esp32/include/xtensa/config/core-matmap.h → components/xtensa/esp32/include/xtensa/config/core-matmap.h


+ 3 - 3
components/esp32/include/xtensa/config/core.h → components/xtensa/esp32/include/xtensa/config/core.h

@@ -1,4 +1,4 @@
-/* 
+/*
  * xtensa/config/core.h -- HAL definitions dependent on CORE configuration
  *
  *  This header file is sometimes referred to as the "compile-time HAL" or CHAL.
@@ -41,8 +41,8 @@
 #include <xtensa/hal.h>
 #include <xtensa/xtensa-versions.h>
 #else
-#include "../hal.h"
-#include "../xtensa-versions.h"
+#include "xtensa/hal.h"
+#include "xtensa/xtensa-versions.h"
 #endif
 
 /*  CONFIGURATION SPECIFIC DEFINITIONS:  */

+ 0 - 0
components/esp32/include/xtensa/config/defs.h → components/xtensa/esp32/include/xtensa/config/defs.h


+ 0 - 0
components/esp32/include/xtensa/config/specreg.h → components/xtensa/esp32/include/xtensa/config/specreg.h


+ 0 - 0
components/esp32/include/xtensa/config/system.h → components/xtensa/esp32/include/xtensa/config/system.h


+ 0 - 0
components/esp32/include/xtensa/config/tie-asm.h → components/xtensa/esp32/include/xtensa/config/tie-asm.h


+ 0 - 0
components/esp32/include/xtensa/config/tie.h → components/xtensa/esp32/include/xtensa/config/tie.h


+ 0 - 0
components/xtensa-debug-module/include/eri.h → components/xtensa/include/eri.h


+ 0 - 0
components/xtensa-debug-module/include/trax.h → components/xtensa/include/trax.h


+ 0 - 0
components/xtensa-debug-module/include/xtensa-debug-module.h → components/xtensa/include/xtensa-debug-module.h


+ 0 - 0
components/esp32/include/xtensa/cacheasm.h → components/xtensa/include/xtensa/cacheasm.h


+ 0 - 0
components/esp32/include/xtensa/cacheattrasm.h → components/xtensa/include/xtensa/cacheattrasm.h


+ 0 - 0
components/esp32/include/xtensa/core-macros.h → components/xtensa/include/xtensa/core-macros.h


+ 0 - 0
components/esp32/include/xtensa/coreasm.h → components/xtensa/include/xtensa/coreasm.h


+ 0 - 0
components/esp32/include/xtensa/corebits.h → components/xtensa/include/xtensa/corebits.h


+ 0 - 0
components/esp32/include/xtensa/hal.h → components/xtensa/include/xtensa/hal.h


+ 0 - 0
components/esp32/include/xtensa/specreg.h → components/xtensa/include/xtensa/specreg.h


+ 0 - 0
components/esp32/include/xtensa/traxreg.h → components/xtensa/include/xtensa/traxreg.h


+ 0 - 0
components/esp32/include/xtensa/xdm-regs.h → components/xtensa/include/xtensa/xdm-regs.h


+ 0 - 0
components/esp32/include/xtensa/xt_perf_consts.h → components/xtensa/include/xtensa/xt_perf_consts.h


+ 0 - 0
components/esp32/include/xtensa/xtensa-libdb-macros.h → components/xtensa/include/xtensa/xtensa-libdb-macros.h


+ 0 - 0
components/esp32/include/xtensa/xtensa-versions.h → components/xtensa/include/xtensa/xtensa-versions.h


+ 0 - 0
components/esp32/include/xtensa/xtensa-xer.h → components/xtensa/include/xtensa/xtensa-xer.h


+ 0 - 0
components/esp32/include/xtensa/xtruntime-core-state.h → components/xtensa/include/xtensa/xtruntime-core-state.h


+ 0 - 0
components/esp32/include/xtensa/xtruntime-frames.h → components/xtensa/include/xtensa/xtruntime-frames.h


+ 0 - 0
components/esp32/include/xtensa/xtruntime.h → components/xtensa/include/xtensa/xtruntime.h


+ 4 - 0
components/xtensa/linker.lf

@@ -0,0 +1,4 @@
+[mapping]
+archive: libxtensa.a
+entries:
+    eri (noflash_text)

+ 0 - 0
components/xtensa-debug-module/trax.c → components/xtensa/trax.c


+ 1 - 0
tools/ci/test_build_system_cmake.sh

@@ -275,6 +275,7 @@ function run_tests()
     # Next two tests will use this fake 'esp31b' target
     export fake_target=esp31b
     mkdir -p components/$fake_target
+    mkdir -p ${IDF_PATH}/components/xtensa/$fake_target/include
     touch components/$fake_target/CMakeLists.txt
     cp ${IDF_PATH}/tools/cmake/toolchain-esp32.cmake components/$fake_target/toolchain-$fake_target.cmake
     sed -i.bak '/cmake_minimum_required/ a\

+ 2 - 1
tools/cmake/idf_functions.cmake

@@ -58,7 +58,8 @@ macro(idf_set_variables)
 
     set_default(IDF_COMPONENT_DIRS "${IDF_EXTRA_COMPONENT_DIRS} ${IDF_PATH}/components")
     set_default(IDF_COMPONENTS "")
-    set_default(IDF_COMPONENT_REQUIRES_COMMON "cxx ${IDF_TARGET} newlib freertos heap log soc esp_rom esp_common")
+    set_default(IDF_COMPONENT_REQUIRES_COMMON "cxx ${IDF_TARGET} newlib freertos heap log soc \
+                                                esp_rom esp_common xtensa")
 
     set(IDF_PROJECT_PATH "${CMAKE_SOURCE_DIR}")