diff --git a/components/esp_gdbstub/test_gdbstub_host/rv_decode/main/CMakeLists.txt b/components/esp_gdbstub/test_gdbstub_host/rv_decode/main/CMakeLists.txt index 3ddae3eb532..a1d645542cd 100644 --- a/components/esp_gdbstub/test_gdbstub_host/rv_decode/main/CMakeLists.txt +++ b/components/esp_gdbstub/test_gdbstub_host/rv_decode/main/CMakeLists.txt @@ -5,10 +5,10 @@ idf_component_register(SRCS "../../../private_include" "../../../include" "../../../src/port/riscv/include" - "../../../../esp_hw_support/include" "../../../../soc/esp32c3/include" "../../../../esp_common/include" "../../../../riscv/include" + PRIV_REQUIRES esp_hw_support WHOLE_ARCHIVE) # Currently 'main' for IDF_TARGET=linux is defined in freertos component. diff --git a/components/freertos/FreeRTOS-Kernel/portable/linux/include/spinlock.h b/components/esp_hw_support/include/linux/spinlock.h similarity index 100% rename from components/freertos/FreeRTOS-Kernel/portable/linux/include/spinlock.h rename to components/esp_hw_support/include/linux/spinlock.h diff --git a/components/esp_tee/project_include.cmake b/components/esp_tee/project_include.cmake index 46fd4fbfe8c..d08b07ee346 100644 --- a/components/esp_tee/project_include.cmake +++ b/components/esp_tee/project_include.cmake @@ -8,7 +8,15 @@ idf_build_get_property(project_dir PROJECT_DIR) idf_build_get_property(non_os_build NON_OS_BUILD) idf_build_get_property(custom_secure_service_dir CUSTOM_SECURE_SERVICE_COMPONENT_DIR) idf_build_get_property(custom_secure_service_component CUSTOM_SECURE_SERVICE_COMPONENT) -idf_build_get_property(partition_table_bin PARTITION_TABLE_BIN_PATH) + +if(IDF_BUILD_V2) + # Under build system v2, partition_table/project_include.cmake may run + # after this file, so PARTITION_TABLE_BIN_PATH is not yet set. Defer the + # read to CMake's generate phase via a generator expression. + idf_build_get_property(partition_table_bin PARTITION_TABLE_BIN_PATH GENERATOR_EXPRESSION) +else() + idf_build_get_property(partition_table_bin PARTITION_TABLE_BIN_PATH) +endif() if(NOT CONFIG_SECURE_ENABLE_TEE OR non_os_build) return() diff --git a/components/esp_tee/subproject/CMakeLists.txt b/components/esp_tee/subproject/CMakeLists.txt index 8121e814578..0635a5a37b8 100644 --- a/components/esp_tee/subproject/CMakeLists.txt +++ b/components/esp_tee/subproject/CMakeLists.txt @@ -33,6 +33,12 @@ list(APPEND COMPONENTS attestation tee_flash_mgr tee_ota_ops tee_sec_storage) include_directories("${SECURE_SERVICE_HEADERS_DIR}") +# The TEE subproject is not yet ported to build system v2. +# Explicitly clear the IDF_BUILD_V2 environment variable so that +# tools/cmake/project.cmake does not activate the cmakev2 shim when +# the parent build was invoked with IDF_BUILD_V2=1. +unset(ENV{IDF_BUILD_V2}) + include("${IDF_PATH}/tools/cmake/project.cmake") set(common_req esp_common esp_hw_support esp_rom freertos hal log esp_libc soc spi_flash) diff --git a/components/esptool_py/Kconfig.projbuild b/components/esptool_py/Kconfig.projbuild index 2df271b95f0..5d763177743 100644 --- a/components/esptool_py/Kconfig.projbuild +++ b/components/esptool_py/Kconfig.projbuild @@ -1,5 +1,5 @@ menu "Serial flasher config" - depends on !APP_BUILD_TYPE_PURE_RAM_APP + depends on !APP_BUILD_TYPE_PURE_RAM_APP && !IDF_TARGET_LINUX config ESPTOOLPY_NO_STUB bool "Disable download stub" diff --git a/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/include/spinlock.h b/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/include/spinlock.h deleted file mode 100644 index 99514d5cac0..00000000000 --- a/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/include/spinlock.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * This file provides only very simple stubs to build IDF-based FreeRTOSes which use spinlocks on Linux. - */ -#pragma once - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define SPINLOCK_FREE 0xB33FFFFF -#define SPINLOCK_WAIT_FOREVER (-1) -#define SPINLOCK_NO_WAIT 0 -#define SPINLOCK_INITIALIZER {.owner = SPINLOCK_FREE,.count = 0} -#define CORE_ID_REGVAL_XOR_SWAP (0xCDCD ^ 0xABAB) - -/** - * @brief Spinlock object - * Owner: - * - Set to 0 if uninitialized - * - Set to portMUX_FREE_VAL when free - * - Set to CORE_ID_REGVAL_PRO or CORE_ID_REGVAL_AP when locked - * - Any other value indicates corruption - * Count: - * - 0 if unlocked - * - Recursive count if locked - * - * @note The simulator is single-core, hence, it doesn't have a proper spinlock implementation. - * @note Keep portMUX_INITIALIZER_UNLOCKED in sync with this struct - */ -typedef struct { - uint32_t owner; - uint32_t count; -}spinlock_t; - -static inline void __attribute__((always_inline)) spinlock_initialize(spinlock_t *lock) -{ -} - -static inline bool __attribute__((always_inline)) spinlock_acquire(spinlock_t *lock, int32_t timeout) -{ - return true; -} - -static inline void __attribute__((always_inline)) spinlock_release(spinlock_t *lock) -{ -} - -#ifdef __cplusplus -} -#endif diff --git a/components/xtensa/CMakeLists.txt b/components/xtensa/CMakeLists.txt index 65542191571..08e230aa31e 100644 --- a/components/xtensa/CMakeLists.txt +++ b/components/xtensa/CMakeLists.txt @@ -50,7 +50,13 @@ if(NOT BOOTLOADER_BUILD) list(APPEND srcs "xtensa_loadstore_handler.S") endif() - if(NOT CONFIG_FREERTOS_PORT) + # xtensa_rtos.h is provided by freertos when it is in the build closure. + # Under build system v2 every component's Kconfig is processed, so + # CONFIG_FREERTOS_PORT is set even when an app (e.g. g0_components) + # removes freertos from __COMPONENT_REQUIRES_COMMON. Inspect the + # common-requires list directly to detect the actual closure. + idf_build_get_property(__common_reqs __COMPONENT_REQUIRES_COMMON) + if(NOT "freertos" IN_LIST __common_reqs) # No RTOS provided. Use default bare metal stubs (to pass G0 build test) list(APPEND srcs "baremetal/xtensa_rtos_bm.S")