diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index 752e9eef304..f4fd9e92cfe 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -63,6 +63,7 @@ #elif CONFIG_IDF_TARGET_ESP32H21 #include "esp_memprot.h" #elif CONFIG_IDF_TARGET_ESP32H4 +#include "soc/lp_aon_reg.h" #include "esp_memprot.h" #elif CONFIG_IDF_TARGET_ESP32S31 #endif @@ -374,6 +375,12 @@ void IRAM_ATTR do_multicore_settings(void) restore_app_mmu_from_pro_mmu(); #endif +#if CONFIG_IDF_TARGET_ESP32H4 + // Reassign Layer6 memory to ICache1 for multicore apps before enabling + // cache settings for the other cores. + REG_SET_BIT(LP_AON_SRAM_USAGE_CONF_REG, LP_AON_ICACHE1_USAGE); +#endif + cache_bus_mask_t cache_bus_mask_core0 = cache_ll_l1_get_enabled_bus(0); #ifndef CONFIG_IDF_TARGET_ESP32 // 1. disable the cache before changing its settings. @@ -489,6 +496,12 @@ FORCE_INLINE_ATTR IRAM_ATTR void ram_app_init(void) //Keep this static, the compiler will check output parameters are initialized. FORCE_INLINE_ATTR IRAM_ATTR void ext_mem_init(void) { +#if CONFIG_IDF_TARGET_ESP32H4 + // Initially assign Layer6 memory to CPU RAM. Multicore startup will + // reassign it to ICache1 if the app is not configured for single-core mode. + REG_CLR_BIT(LP_AON_SRAM_USAGE_CONF_REG, LP_AON_ICACHE1_USAGE); +#endif + #if !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE && !SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE // It helps to fix missed cache settings for other cores. It happens when bootloader is unicore. do_multicore_settings(); diff --git a/tools/test_apps/system/.build-test-rules.yml b/tools/test_apps/system/.build-test-rules.yml index 94ab300d305..2927d909d58 100644 --- a/tools/test_apps/system/.build-test-rules.yml +++ b/tools/test_apps/system/.build-test-rules.yml @@ -189,7 +189,3 @@ tools/test_apps/system/unicore_bootloader: reason: the test is only relevant for multicore chips - if: CONFIG_NAME == "unicore_psram" and SOC_PSRAM_SUPPORTED != 1 - if: CONFIG_NAME == "multicore_psram" and SOC_PSRAM_SUPPORTED != 1 - disable_test: - - if: IDF_TARGET == "esp32h4" - temporary: true - reason: cannot pass # TODO: IDF-15620 diff --git a/tools/test_apps/system/unicore_bootloader/pytest_unicore_bootloader.py b/tools/test_apps/system/unicore_bootloader/pytest_unicore_bootloader.py index 6bc4c0cbedf..de5222c79cc 100644 --- a/tools/test_apps/system/unicore_bootloader/pytest_unicore_bootloader.py +++ b/tools/test_apps/system/unicore_bootloader/pytest_unicore_bootloader.py @@ -12,7 +12,6 @@ from pytest_embedded_idf.utils import soc_filtered_targets @pytest.mark.generic @pytest.mark.parametrize('config', ['multicore', 'multicore_psram'], indirect=True) @idf_parametrize('target', soc_filtered_targets('SOC_CPU_CORES_NUM > 1'), indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32h4'], reason='cannot pass') # TODO: IDF-15620 def test_multicore_app_and_unicore_bootloader(dut: Dut, app_downloader, config) -> None: # type: ignore dut.expect('Multicore bootloader') dut.expect('Multicore app') @@ -37,7 +36,6 @@ def test_multicore_app_and_unicore_bootloader(dut: Dut, app_downloader, config) @pytest.mark.generic @pytest.mark.parametrize('config', ['unicore', 'unicore_psram'], indirect=True) @idf_parametrize('target', soc_filtered_targets('SOC_CPU_CORES_NUM > 1'), indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32h4'], reason='cannot pass') # TODO: IDF-15620 def test_unicore_app_and_multicore_bootloader(dut: Dut, app_downloader, config) -> None: # type: ignore dut.expect('Unicore bootloader') dut.expect('Unicore app')