create xtensa component

1. move xtensa specific files out of esp32 component
2. merge xtensa-debug-module component into xtensa
This commit is contained in:
morris 2019-03-25 21:11:53 +08:00 committed by suda-morris
parent da90966828
commit dbdb299bb1
49 changed files with 38 additions and 29 deletions

View File

@ -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()

View File

@ -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)

View File

@ -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.
#

View File

@ -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)

View File

@ -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(

View File

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

View File

@ -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

View File

@ -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()

View File

@ -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 \

View File

@ -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 \

View File

@ -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 \

View File

@ -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 \

View File

@ -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()

View File

@ -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

View File

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

View File

@ -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()

View File

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

View File

@ -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: */

View File

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

View File

@ -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\

View File

@ -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}")