fix(esp_security): keep esp_security as private dependency for esp_hw_support

- Only esp_hw_support -> esp_security as new private dependency
- In next major IDF release, the public interface can be moved
  esp_security component
This commit is contained in:
Mahavir Jain 2024-08-07 15:19:29 +05:30
parent 79f9c7d157
commit 1e8391f5fe
8 changed files with 13 additions and 20 deletions

View File

@ -65,7 +65,7 @@ else()
idf_component_register(SRCS "${srcs}" idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS include INCLUDE_DIRS include
PRIV_REQUIRES spi_flash esp_timer esp_mm esp_security PRIV_REQUIRES spi_flash esp_timer esp_mm
# [refactor-todo] requirements due to init code, # [refactor-todo] requirements due to init code,
# should be removable once using component init functions # should be removable once using component init functions
# link-time registration is used. # link-time registration is used.

View File

@ -78,10 +78,6 @@ void esp_perip_clk_init(void)
{ {
} }
void esp_crypto_clk_init(void)
{
}
/** /**
* @brief No-op function, used to force linking this file * @brief No-op function, used to force linking this file
* *

View File

@ -44,14 +44,6 @@ void esp_clk_init(void);
*/ */
void esp_perip_clk_init(void); void esp_perip_clk_init(void);
/**
* @brief Initialize the crypto clock
*
* Called from cpu_start.c, not intended to be called from other places.
* This function configures the crypto clock.
*/
void esp_crypto_clk_init(void);
#if !CONFIG_IDF_TARGET_ESP32C2 #if !CONFIG_IDF_TARGET_ESP32C2
/* Selects an external clock source (32 kHz) for RTC. /* Selects an external clock source (32 kHz) for RTC.
* Only internal use in unit test. * Only internal use in unit test.

View File

@ -76,6 +76,9 @@ SECONDARY: 101: esp_hw_stack_guard_init in components/esp_system/hw_stack_guard.
# RNG module clock was disabled in `esp_perip_clk_init`, if hw_random is used, need to re-ebnabled it in startup # RNG module clock was disabled in `esp_perip_clk_init`, if hw_random is used, need to re-ebnabled it in startup
SECONDARY: 102: init_rng_clock in components/esp_hw_support/hw_random.c on BIT(0) SECONDARY: 102: init_rng_clock in components/esp_hw_support/hw_random.c on BIT(0)
# Security specific initializations
SECONDARY: 103: esp_security_init in components/esp_security/src/init.c on BIT(0)
# esp_sleep doesn't have init dependencies # esp_sleep doesn't have init dependencies
SECONDARY: 105: esp_sleep_startup_init in components/esp_hw_support/sleep_gpio.c on BIT(0) SECONDARY: 105: esp_sleep_startup_init in components/esp_hw_support/sleep_gpio.c on BIT(0)
SECONDARY: 106: sleep_clock_startup_init in components/esp_hw_support/sleep_clock.c on BIT(0) SECONDARY: 106: sleep_clock_startup_init in components/esp_hw_support/sleep_clock.c on BIT(0)

View File

@ -23,8 +23,8 @@ endif()
if(CONFIG_SOC_KEY_MANAGER_SUPPORTED) if(CONFIG_SOC_KEY_MANAGER_SUPPORTED)
list(APPEND srcs "key_manager/test_key_manager.c" list(APPEND srcs "key_manager/test_key_manager.c"
"$ENV{IDF_PATH}/components/esp_hw_support/esp_key_mgr.c") "$ENV{IDF_PATH}/components/esp_security/src/esp_key_mgr.c")
list(APPEND priv_include_dirs "$ENV{IDF_PATH}/components/esp_hw_support/include") list(APPEND priv_include_dirs "$ENV{IDF_PATH}/components/esp_security/include")
endif() endif()
if(CONFIG_SOC_AES_SUPPORTED) if(CONFIG_SOC_AES_SUPPORTED)
@ -74,7 +74,7 @@ if(CONFIG_SOC_SHA_SUPPORTED)
endif() endif()
idf_component_register(SRCS ${srcs} idf_component_register(SRCS ${srcs}
PRIV_REQUIRES efuse mbedtls esp_mm bootloader_support spi_flash PRIV_REQUIRES efuse mbedtls esp_security esp_mm bootloader_support spi_flash
REQUIRES test_utils unity REQUIRES test_utils unity
WHOLE_ARCHIVE WHOLE_ARCHIVE
PRIV_INCLUDE_DIRS "${priv_include_dirs}" PRIV_INCLUDE_DIRS "${priv_include_dirs}"

View File

@ -52,9 +52,6 @@ else()
set(priv_requires bootloader_support app_update soc esp_mm set(priv_requires bootloader_support app_update soc esp_mm
esp_driver_gpio esp_driver_gpio
) )
if(${target} STREQUAL "esp32s2")
list(APPEND priv_requires esp_security)
endif()
endif() endif()
idf_component_register(SRCS "${srcs}" idf_component_register(SRCS "${srcs}"

View File

@ -91,6 +91,11 @@ set(extra_components_which_shouldnt_be_included
# pthread is required by cxx. See [refactor-todo] about cxx, can it work without pthread? # pthread is required by cxx. See [refactor-todo] about cxx, can it work without pthread?
pthread pthread
# esp_security is a private dependency of the following G1 components:
# esp_hw_support
# TODO: will be removed in IDF 6.x (see IDF-10733)
esp_security
) )
set(expected_components set(expected_components

View File

@ -11,7 +11,7 @@ g1_g0_components = ['hal', 'cxx', 'newlib', 'freertos', 'esp_hw_support', 'heap'
expected_dep_violations = {'esp_system': ['esp_timer', 'bootloader_support', 'esp_pm'], expected_dep_violations = {'esp_system': ['esp_timer', 'bootloader_support', 'esp_pm'],
'spi_flash': ['bootloader_support', 'app_update', 'esp_driver_gpio'], 'spi_flash': ['bootloader_support', 'app_update', 'esp_driver_gpio'],
'esp_hw_support': ['efuse', 'bootloader_support', 'esp_driver_gpio', 'esp_timer', 'esp_pm'], 'esp_hw_support': ['efuse', 'bootloader_support', 'esp_driver_gpio', 'esp_timer', 'esp_pm', 'esp_security'],
'cxx': ['pthread']} 'cxx': ['pthread']}