diff --git a/components/cxx/test_apps/.build-test-rules.yml b/components/cxx/test_apps/.build-test-rules.yml index d21ee93145..fb9b59cba2 100644 --- a/components/cxx/test_apps/.build-test-rules.yml +++ b/components/cxx/test_apps/.build-test-rules.yml @@ -2,10 +2,6 @@ components/cxx/test_apps: enable: - - if: IDF_TARGET in ["esp32", "esp32c3"] + - if: IDF_TARGET in ["esp32", "esp32c3", "esp32p4"] temporary: true reason: the other targets are not tested yet - disable: - - if: IDF_TARGET == "esp32p4" - temporary: true - reason: p4 rev3 migration # TODO: IDF-14402 diff --git a/components/cxx/test_apps/exception/README.md b/components/cxx/test_apps/exception/README.md index 1fb88efd15..4a91243368 100644 --- a/components/cxx/test_apps/exception/README.md +++ b/components/cxx/test_apps/exception/README.md @@ -1,2 +1,2 @@ -| Supported Targets | ESP32 | ESP32-C3 | -| ----------------- | ----- | -------- | +| Supported Targets | ESP32 | ESP32-C3 | ESP32-P4 | +| ----------------- | ----- | -------- | -------- | diff --git a/components/cxx/test_apps/exception/main/test_exception.cpp b/components/cxx/test_apps/exception/main/test_exception.cpp index d0ef7166c7..6e353ce673 100644 --- a/components/cxx/test_apps/exception/main/test_exception.cpp +++ b/components/cxx/test_apps/exception/main/test_exception.cpp @@ -13,7 +13,7 @@ - 88 bytes are allocated by pthread_setspecific() to init internal lock - some more memory... */ -#if CONFIG_IDF_TARGET_ESP32 +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32P4 #define LEAKS (300) #elif CONFIG_IDF_TARGET_ESP32S2 #define LEAKS (800) diff --git a/components/cxx/test_apps/exception/pytest_cxx_exception.py b/components/cxx/test_apps/exception/pytest_cxx_exception.py index e89f3c561a..2e49b11981 100644 --- a/components/cxx/test_apps/exception/pytest_cxx_exception.py +++ b/components/cxx/test_apps/exception/pytest_cxx_exception.py @@ -6,6 +6,6 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic -@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) +@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32p4'], indirect=['target']) def test_cxx_exception(dut: Dut) -> None: dut.run_all_single_board_cases() diff --git a/components/cxx/test_apps/exception_no_except/README.md b/components/cxx/test_apps/exception_no_except/README.md index 1fb88efd15..4a91243368 100644 --- a/components/cxx/test_apps/exception_no_except/README.md +++ b/components/cxx/test_apps/exception_no_except/README.md @@ -1,2 +1,2 @@ -| Supported Targets | ESP32 | ESP32-C3 | -| ----------------- | ----- | -------- | +| Supported Targets | ESP32 | ESP32-C3 | ESP32-P4 | +| ----------------- | ----- | -------- | -------- | diff --git a/components/cxx/test_apps/exception_no_except/pytest_cxx_exception_no_except.py b/components/cxx/test_apps/exception_no_except/pytest_cxx_exception_no_except.py index ba8849827b..9fde60c34e 100644 --- a/components/cxx/test_apps/exception_no_except/pytest_cxx_exception_no_except.py +++ b/components/cxx/test_apps/exception_no_except/pytest_cxx_exception_no_except.py @@ -6,7 +6,7 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic -@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) +@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32p4'], indirect=['target']) def test_cxx_noexcept_out_of_range(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.write('1') @@ -15,7 +15,7 @@ def test_cxx_noexcept_out_of_range(dut: Dut) -> None: @pytest.mark.generic -@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) +@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32p4'], indirect=['target']) def test_cxx_noexcept_bad_alloc(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.write('2') diff --git a/components/cxx/test_apps/general/README.md b/components/cxx/test_apps/general/README.md index 1fb88efd15..4a91243368 100644 --- a/components/cxx/test_apps/general/README.md +++ b/components/cxx/test_apps/general/README.md @@ -1,2 +1,2 @@ -| Supported Targets | ESP32 | ESP32-C3 | -| ----------------- | ----- | -------- | +| Supported Targets | ESP32 | ESP32-C3 | ESP32-P4 | +| ----------------- | ----- | -------- | -------- | diff --git a/components/cxx/test_apps/general/main/test_cxx_general.cpp b/components/cxx/test_apps/general/main/test_cxx_general.cpp index 9d099e6f25..8828157436 100644 --- a/components/cxx/test_apps/general/main/test_cxx_general.cpp +++ b/components/cxx/test_apps/general/main/test_cxx_general.cpp @@ -108,18 +108,16 @@ TEST_CASE("static initialization guards work as expected", "[misc]") TEST_ASSERT_NOT_NULL(s_slow_init_sem); int task_count = 0; // four tasks competing for static initialization of one object - task_count += start_slow_init_task<1>(0, PRO_CPU_NUM); -#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2 - task_count += start_slow_init_task<1>(1, APP_CPU_NUM); -#endif + for (int i = 0; i < CONFIG_FREERTOS_NUMBER_OF_CORES; i++) { + task_count += start_slow_init_task<1>(i, i); + } task_count += start_slow_init_task<1>(2, PRO_CPU_NUM); task_count += start_slow_init_task<1>(3, tskNO_AFFINITY); // four tasks competing for static initialization of another object - task_count += start_slow_init_task<2>(0, PRO_CPU_NUM); -#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2 - task_count += start_slow_init_task<2>(1, APP_CPU_NUM); -#endif + for (int i = 0; i < CONFIG_FREERTOS_NUMBER_OF_CORES; i++) { + task_count += start_slow_init_task<2>(i, i); + } task_count += start_slow_init_task<2>(2, PRO_CPU_NUM); task_count += start_slow_init_task<2>(3, tskNO_AFFINITY); diff --git a/components/cxx/test_apps/general/pytest_cxx_general.py b/components/cxx/test_apps/general/pytest_cxx_general.py index f480ed673c..25028e58da 100644 --- a/components/cxx/test_apps/general/pytest_cxx_general.py +++ b/components/cxx/test_apps/general/pytest_cxx_general.py @@ -9,21 +9,21 @@ configurations = ['noexcept', 'exceptions_rtti'] @pytest.mark.generic @pytest.mark.parametrize('config', configurations, indirect=True) -@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) +@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32p4'], indirect=['target']) def test_cxx_static_init_non_pod(dut: Dut) -> None: dut.run_all_single_board_cases(name=['can use static initializers for non-POD types']) @pytest.mark.generic @pytest.mark.parametrize('config', configurations, indirect=True) -@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) +@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32p4'], indirect=['target']) def test_cxx_misc(dut: Dut) -> None: dut.run_all_single_board_cases(group='misc') @pytest.mark.generic @pytest.mark.parametrize('config', configurations, indirect=True) -@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) +@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32p4'], indirect=['target']) def test_cxx_stack_smash(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.write('"stack smashing protection CXX"') diff --git a/components/cxx/test_apps/rtti/README.md b/components/cxx/test_apps/rtti/README.md index 1fb88efd15..4a91243368 100644 --- a/components/cxx/test_apps/rtti/README.md +++ b/components/cxx/test_apps/rtti/README.md @@ -1,2 +1,2 @@ -| Supported Targets | ESP32 | ESP32-C3 | -| ----------------- | ----- | -------- | +| Supported Targets | ESP32 | ESP32-C3 | ESP32-P4 | +| ----------------- | ----- | -------- | -------- | diff --git a/components/cxx/test_apps/rtti/main/test_rtti.cpp b/components/cxx/test_apps/rtti/main/test_rtti.cpp index 71d0c3b949..322d9d9628 100644 --- a/components/cxx/test_apps/rtti/main/test_rtti.cpp +++ b/components/cxx/test_apps/rtti/main/test_rtti.cpp @@ -14,7 +14,7 @@ - 88 bytes are allocated by pthread_setspecific() to init internal lock - some more memory... */ -#if CONFIG_IDF_TARGET_ESP32 +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32P4 #define LEAKS (300) #elif CONFIG_IDF_TARGET_ESP32S2 #define LEAKS (800) diff --git a/components/cxx/test_apps/rtti/pytest_cxx_rtti.py b/components/cxx/test_apps/rtti/pytest_cxx_rtti.py index 40ec38cbd0..2672322c9a 100644 --- a/components/cxx/test_apps/rtti/pytest_cxx_rtti.py +++ b/components/cxx/test_apps/rtti/pytest_cxx_rtti.py @@ -6,6 +6,6 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic -@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) +@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32p4'], indirect=['target']) def test_cxx_rtti(dut: Dut) -> None: dut.run_all_single_board_cases() diff --git a/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c b/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c index 292ac04364..cc62ad90e1 100644 --- a/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c +++ b/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c @@ -308,17 +308,17 @@ esp_err_t esp_efuse_write_key(esp_efuse_block_t block, esp_efuse_purpose_t purpo #if SOC_EFUSE_ECDSA_KEY purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY || #endif -#if SOC_EFUSE_ECDSA_KEY_P192 +#if SOC_EFUSE_ECDSA_KEY_P192 || EFUSE_LL_HAS_ECDSA_KEY_P192 purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY_P192 || #endif -#if SOC_EFUSE_ECDSA_KEY_P384 +#if SOC_EFUSE_ECDSA_KEY_P384 || EFUSE_LL_HAS_ECDSA_KEY_P384 purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY_P384_L || purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY_P384_H || #endif -#if SOC_PSRAM_ENCRYPTION_XTS_AES_128 +#if SOC_PSRAM_ENCRYPTION_XTS_AES_128 || EFUSE_LL_HAS_PSRAM_ENCRYPTION_XTS_AES_128 purpose == ESP_EFUSE_KEY_PURPOSE_XTS_AES_128_PSRAM_KEY || #endif -#if SOC_PSRAM_ENCRYPTION_XTS_AES_256 +#if SOC_PSRAM_ENCRYPTION_XTS_AES_256 || EFUSE_LL_HAS_PSRAM_ENCRYPTION_XTS_AES_256 purpose == ESP_EFUSE_KEY_PURPOSE_XTS_AES_256_PSRAM_KEY_1 || purpose == ESP_EFUSE_KEY_PURPOSE_XTS_AES_256_PSRAM_KEY_2 || #endif diff --git a/components/efuse/test_apps/.build-test-rules.yml b/components/efuse/test_apps/.build-test-rules.yml index b3c80820a0..22eeea2060 100644 --- a/components/efuse/test_apps/.build-test-rules.yml +++ b/components/efuse/test_apps/.build-test-rules.yml @@ -3,10 +3,6 @@ components/efuse/test_apps: enable: - if: (INCLUDE_DEFAULT == 1 and SOC_EFUSE_SUPPORTED == 1) or IDF_TARGET == "linux") - disable: - - if: IDF_TARGET == "esp32p4" - temporary: true - reason: p4 rev3 migration # TODO: IDF-14403 disable_test: - if: IDF_TARGET in ["esp32s2", "esp32s3"] reason: eFuse for S2 and S3 is similar to the C3 chip, so we only test for C3. diff --git a/components/efuse/test_apps/README.md b/components/efuse/test_apps/README.md index c694e797c7..8b53053b43 100644 --- a/components/efuse/test_apps/README.md +++ b/components/efuse/test_apps/README.md @@ -1,3 +1,3 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-H21 | ESP32-H4 | ESP32-S2 | ESP32-S3 | Linux | -| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | --------- | -------- | -------- | -------- | ----- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-H21 | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | Linux | +| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | --------- | -------- | -------- | -------- | -------- | ----- | diff --git a/components/efuse/test_apps/main/with_key_purposes/test_efuse_keys.c b/components/efuse/test_apps/main/with_key_purposes/test_efuse_keys.c index c27d3d59b7..074be58411 100644 --- a/components/efuse/test_apps/main/with_key_purposes/test_efuse_keys.c +++ b/components/efuse/test_apps/main/with_key_purposes/test_efuse_keys.c @@ -14,6 +14,7 @@ #include "esp_efuse.h" #include "esp_efuse_table.h" #include "esp_efuse_utility.h" +#include "hal/efuse_ll.h" #include "sdkconfig.h" __attribute__((unused)) static const char* TAG = "efuse_key_test"; @@ -93,17 +94,17 @@ static esp_err_t s_check_key(esp_efuse_block_t num_key, void* wr_key) #if SOC_EFUSE_ECDSA_KEY purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY || #endif -#if SOC_EFUSE_ECDSA_KEY_P192 +#if SOC_EFUSE_ECDSA_KEY_P192 || EFUSE_LL_HAS_ECDSA_KEY_P192 purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY_P192 || #endif -#if SOC_EFUSE_ECDSA_KEY_P384 +#if SOC_EFUSE_ECDSA_KEY_P384 || EFUSE_LL_HAS_ECDSA_KEY_P384 purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY_P384_L || purpose == ESP_EFUSE_KEY_PURPOSE_ECDSA_KEY_P384_H || #endif -#if SOC_PSRAM_ENCRYPTION_XTS_AES_128 +#if SOC_PSRAM_ENCRYPTION_XTS_AES_128 || EFUSE_LL_HAS_PSRAM_ENCRYPTION_XTS_AES_128 purpose == ESP_EFUSE_KEY_PURPOSE_XTS_AES_128_PSRAM_KEY || #endif -#if SOC_PSRAM_ENCRYPTION_XTS_AES_256 +#if SOC_PSRAM_ENCRYPTION_XTS_AES_256 || EFUSE_LL_HAS_PSRAM_ENCRYPTION_XTS_AES_256 purpose == ESP_EFUSE_KEY_PURPOSE_XTS_AES_256_PSRAM_KEY_1 || purpose == ESP_EFUSE_KEY_PURPOSE_XTS_AES_256_PSRAM_KEY_2 || #endif @@ -126,7 +127,7 @@ static esp_err_t s_check_key(esp_efuse_block_t num_key, void* wr_key) TEST_ASSERT_EQUAL(purpose, esp_efuse_get_key_purpose(num_key)); esp_efuse_purpose_t purpose2 = 0; const esp_efuse_desc_t** key_purpose = esp_efuse_get_purpose_field(num_key); - TEST_ESP_OK(esp_efuse_read_field_blob(key_purpose, &purpose2, key_purpose[0]->bit_count)); + TEST_ESP_OK(esp_efuse_read_field_blob(key_purpose, &purpose2, esp_efuse_get_field_size(key_purpose))); TEST_ASSERT_EQUAL(purpose, purpose2); TEST_ASSERT_TRUE(esp_efuse_get_keypurpose_dis_write(num_key)); return ESP_OK; diff --git a/components/efuse/test_apps/pytest_efuse.py b/components/efuse/test_apps/pytest_efuse.py index 0826ecb9c5..7d9c536735 100644 --- a/components/efuse/test_apps/pytest_efuse.py +++ b/components/efuse/test_apps/pytest_efuse.py @@ -6,7 +6,7 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.temp_skip_ci( - targets=['esp32s2', 'esp32s3', 'esp32p4'], + targets=['esp32s2', 'esp32s3'], reason='eFuse for S2 and S3 is similar to the C3 chip, so testing on C3 is enough', ) @pytest.mark.generic diff --git a/components/esp_rom/esp32h4/ld/esp32h4.rom.beta5.systimer.ld b/components/esp_rom/esp32h4/ld/esp32h4.rom.beta5.systimer.ld new file mode 100644 index 0000000000..9b884abe8a --- /dev/null +++ b/components/esp_rom/esp32h4/ld/esp32h4.rom.beta5.systimer.ld @@ -0,0 +1,28 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/*************************************** + Group hal_systimer + ***************************************/ + +/* Functions */ +/* The following ROM functions are commented out because they're patched in the esp_rom_systimer.c */ +/* systimer_hal_init = 0x4000039c; */ +/* systimer_hal_deinit = 0x400003a0; */ + +systimer_hal_set_tick_rate_ops = 0x400003a4; +systimer_hal_get_counter_value = 0x400003a8; +systimer_hal_get_time = 0x400003ac; +systimer_hal_set_alarm_target = 0x400003b0; +systimer_hal_set_alarm_period = 0x400003b4; +systimer_hal_get_alarm_value = 0x400003b8; +systimer_hal_enable_alarm_int = 0x400003bc; +systimer_hal_on_apb_freq_update = 0x400003c0; +systimer_hal_counter_value_advance = 0x400003c4; +systimer_hal_enable_counter = 0x400003c8; +systimer_hal_select_alarm_mode = 0x400003cc; +systimer_hal_connect_alarm_counter = 0x400003d0; +systimer_hal_counter_can_stall_by_cpu = 0x400003d4; diff --git a/components/esp_rom/esp32h4/ld/esp32h4.rom.systimer.ld b/components/esp_rom/esp32h4/ld/esp32h4.rom.systimer.ld index 56bb8115ca..225f53de78 100644 --- a/components/esp_rom/esp32h4/ld/esp32h4.rom.systimer.ld +++ b/components/esp_rom/esp32h4/ld/esp32h4.rom.systimer.ld @@ -9,18 +9,20 @@ ***************************************/ /* Functions */ -systimer_hal_init = 0x4000039c; -systimer_hal_deinit = 0x400003a0; -systimer_hal_set_tick_rate_ops = 0x400003a4; -systimer_hal_get_counter_value = 0x400003a8; -systimer_hal_get_time = 0x400003ac; -systimer_hal_set_alarm_target = 0x400003b0; -systimer_hal_set_alarm_period = 0x400003b4; -systimer_hal_get_alarm_value = 0x400003b8; -systimer_hal_enable_alarm_int = 0x400003bc; -systimer_hal_on_apb_freq_update = 0x400003c0; -systimer_hal_counter_value_advance = 0x400003c4; -systimer_hal_enable_counter = 0x400003c8; -systimer_hal_select_alarm_mode = 0x400003cc; -systimer_hal_connect_alarm_counter = 0x400003d0; -systimer_hal_counter_can_stall_by_cpu = 0x400003d4; +/* The following ROM functions are commented out because they're patched in the esp_rom_systimer.c */ +/* systimer_hal_init = 0x4000036c; */ +/* systimer_hal_deinit = 0x40000370; */ + +systimer_hal_set_tick_rate_ops = 0x40000374; +systimer_hal_get_counter_value = 0x40000378; +systimer_hal_get_time = 0x4000037c; +systimer_hal_set_alarm_target = 0x40000380; +systimer_hal_set_alarm_period = 0x40000384; +systimer_hal_get_alarm_value = 0x40000388; +systimer_hal_enable_alarm_int = 0x4000038c; +systimer_hal_on_apb_freq_update = 0x40000390; +systimer_hal_counter_value_advance = 0x40000394; +systimer_hal_enable_counter = 0x40000398; +systimer_hal_select_alarm_mode = 0x4000039c; +systimer_hal_connect_alarm_counter = 0x400003a0; +systimer_hal_counter_can_stall_by_cpu = 0x400003a4; diff --git a/components/esp_rom/esp32p4/ld/esp32p4.rom.eco5.ld b/components/esp_rom/esp32p4/ld/esp32p4.rom.eco5.ld index a60e9d0b07..0df2f533eb 100644 --- a/components/esp_rom/esp32p4/ld/esp32p4.rom.eco5.ld +++ b/components/esp_rom/esp32p4/ld/esp32p4.rom.eco5.ld @@ -170,28 +170,6 @@ rom_spiflash_legacy_data = 0x4ffbffe8; g_flash_guard_ops = 0x4ffbfff0; -/*************************************** - Group hal_systimer - ***************************************/ - -/* Functions */ -systimer_hal_init = 0x4fc00228; -systimer_hal_deinit = 0x4fc0022c; -systimer_hal_set_tick_rate_ops = 0x4fc00230; -systimer_hal_get_counter_value = 0x4fc00234; -systimer_hal_get_time = 0x4fc00238; -systimer_hal_set_alarm_target = 0x4fc0023c; -systimer_hal_set_alarm_period = 0x4fc00240; -systimer_hal_get_alarm_value = 0x4fc00244; -systimer_hal_enable_alarm_int = 0x4fc00248; -systimer_hal_on_apb_freq_update = 0x4fc0024c; -systimer_hal_counter_value_advance = 0x4fc00250; -systimer_hal_enable_counter = 0x4fc00254; -systimer_hal_select_alarm_mode = 0x4fc00258; -systimer_hal_connect_alarm_counter = 0x4fc0025c; -systimer_hal_counter_can_stall_by_cpu = 0x4fc00260; - - /*************************************** Group cache ***************************************/ diff --git a/components/esp_rom/esp32p4/ld/esp32p4.rom.eco5.newlib.ld b/components/esp_rom/esp32p4/ld/esp32p4.rom.eco5.newlib.ld index 0498c23bf1..827507e6e4 100644 --- a/components/esp_rom/esp32p4/ld/esp32p4.rom.eco5.newlib.ld +++ b/components/esp_rom/esp32p4/ld/esp32p4.rom.eco5.newlib.ld @@ -10,7 +10,9 @@ * * Compatible with ROM where ECO version equal or greater to 5. * - * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + * THIS FILE WAS AUTOMATICALLY GENERATED. !!! BUT EDITED !!! + * The file was originally generated for use with newlib, but it was split into + * multiple files to make it compatible with picolibc. */ /*************************************** @@ -18,69 +20,12 @@ ***************************************/ /* Functions */ -esp_rom_newlib_init_common_mutexes = 0x4fc00264; -memset = 0x4fc00268; -memcpy = 0x4fc0026c; -memmove = 0x4fc00270; -memcmp = 0x4fc00274; -strcpy = 0x4fc00278; -strncpy = 0x4fc0027c; -strcmp = 0x4fc00280; -strncmp = 0x4fc00284; -strlen = 0x4fc00288; -strstr = 0x4fc0028c; -bzero = 0x4fc00290; _isatty_r = 0x4fc00294; -sbrk = 0x4fc00298; -isalnum = 0x4fc0029c; -isalpha = 0x4fc002a0; -isascii = 0x4fc002a4; -isblank = 0x4fc002a8; -iscntrl = 0x4fc002ac; -isdigit = 0x4fc002b0; -islower = 0x4fc002b4; -isgraph = 0x4fc002b8; -isprint = 0x4fc002bc; -ispunct = 0x4fc002c0; -isspace = 0x4fc002c4; -isupper = 0x4fc002c8; -toupper = 0x4fc002cc; -tolower = 0x4fc002d0; -toascii = 0x4fc002d4; -memccpy = 0x4fc002d8; -memchr = 0x4fc002dc; -memrchr = 0x4fc002e0; -strcasecmp = 0x4fc002e4; -strcasestr = 0x4fc002e8; -strcat = 0x4fc002ec; strdup = 0x4fc002f0; -strchr = 0x4fc002f4; -strcspn = 0x4fc002f8; -strcoll = 0x4fc002fc; -strlcat = 0x4fc00300; -strlcpy = 0x4fc00304; -strlwr = 0x4fc00308; -strncasecmp = 0x4fc0030c; -strncat = 0x4fc00310; strndup = 0x4fc00314; -strnlen = 0x4fc00318; -strrchr = 0x4fc0031c; -strsep = 0x4fc00320; -strspn = 0x4fc00324; -strtok_r = 0x4fc00328; -strupr = 0x4fc0032c; -longjmp = 0x4fc00330; -setjmp = 0x4fc00334; -abs = 0x4fc00338; -div = 0x4fc0033c; -labs = 0x4fc00340; -ldiv = 0x4fc00344; -qsort = 0x4fc00348; rand_r = 0x4fc0034c; rand = 0x4fc00350; srand = 0x4fc00354; -utoa = 0x4fc00358; -itoa = 0x4fc0035c; atoi = 0x4fc00360; atol = 0x4fc00364; strtol = 0x4fc00368; @@ -94,6 +39,3 @@ __swhatbuf_r = 0x4fc00384; __swbuf_r = 0x4fc00388; __swbuf = 0x4fc0038c; __swsetup_r = 0x4fc00390; -/* Data (.data, .bss, .rodata) */ -syscall_table_ptr = 0x4ffbffe4; -_global_impure_ptr = 0x4ffbffe0; diff --git a/components/esp_system/ld/esp32p4/memory.ld.in b/components/esp_system/ld/esp32p4/memory.ld.in index 4154b9369a..37b5f0f8f1 100644 --- a/components/esp_system/ld/esp32p4/memory.ld.in +++ b/components/esp_system/ld/esp32p4/memory.ld.in @@ -32,12 +32,6 @@ #define SRAM_HIGH_END SRAM_HIGH_START + SRAM_HIGH_SIZE #endif -#if CONFIG_P4_REV3_MSPI_CRASH_AFTER_POWER_UP_WORKAROUND -#define MSPI_WORKAROUND_SIZE CONFIG_P4_REV3_MSPI_WORKAROUND_SIZE -#else -#define MSPI_WORKAROUND_SIZE 0x0 -#endif - #define IDROM_SEG_SIZE (CONFIG_MMU_PAGE_SIZE << 10) #define LP_ROM_DRAM_START 0x5010fa80 // Value taken from ROM elf, includes LP ROM stack diff --git a/components/esp_system/ld/esp32p4/sections.rev3.ld.in b/components/esp_system/ld/esp32p4/sections.rev3.ld.in index e370942abf..d8cbd25729 100644 --- a/components/esp_system/ld/esp32p4/sections.rev3.ld.in +++ b/components/esp_system/ld/esp32p4/sections.rev3.ld.in @@ -403,18 +403,16 @@ SECTIONS * C++ constructor tables. * * Excluding crtbegin.o/crtend.o since IDF doesn't use the toolchain crt. - * - * RISC-V gcc is configured with --enable-initfini-array so it emits - * .init_array section instead. But the init_priority sections will be - * sorted for iteration in ascending order during startup. - * The rest of the init_array sections is sorted for iteration in descending - * order during startup, however. Hence a different section is generated for - * the init_priority functions which is iterated in ascending order during - * startup. The corresponding code can be found in startup.c. */ - ALIGNED_SYMBOL(4, __init_priority_array_start) - KEEP (*(EXCLUDE_FILE (*crtend.* *crtbegin.*) .init_array.*)) - __init_priority_array_end = ABSOLUTE(.); + ALIGNED_SYMBOL(4, __preinit_array_start) + KEEP (*(.preinit_array)) + __preinit_array_end = ABSOLUTE(.); + + . = ALIGN(4); + PROVIDE(__init_priority_array_start = ABSOLUTE(.)); + KEEP (*(SORT_BY_INIT_PRIORITY(EXCLUDE_FILE (*crtend.* *crtbegin.*) .init_array.*))) + . = ALIGN(4); + PROVIDE(__init_priority_array_end = ABSOLUTE(.)); ALIGNED_SYMBOL(4, __init_array_start) KEEP (*(EXCLUDE_FILE (*crtend.* *crtbegin.*) .init_array)) diff --git a/components/esp_system/ld/ld.common b/components/esp_system/ld/ld.common index 04401fd24b..dfe698e4df 100644 --- a/components/esp_system/ld/ld.common +++ b/components/esp_system/ld/ld.common @@ -74,6 +74,12 @@ #define RESERVE_RTC_MEM (ESP_BOOTLOADER_RESERVE_RTC + RTC_TIMER_RESERVE_RTC) #endif + #if CONFIG_P4_REV3_MSPI_CRASH_AFTER_POWER_UP_WORKAROUND + #define MSPI_WORKAROUND_SIZE CONFIG_P4_REV3_MSPI_WORKAROUND_SIZE + #else + #define MSPI_WORKAROUND_SIZE 0x0 + #endif + #endif // SOC_RTC_MEM_SUPPORTED #define QUOTED_STRING(STRING) #STRING diff --git a/components/esp_system/test_apps/.build-test-rules.yml b/components/esp_system/test_apps/.build-test-rules.yml index 5afed0496a..d68503725d 100644 --- a/components/esp_system/test_apps/.build-test-rules.yml +++ b/components/esp_system/test_apps/.build-test-rules.yml @@ -16,10 +16,6 @@ components/esp_system/test_apps/esp_system_unity_tests: disable: - if: (CONFIG_NAME == "psram" and SOC_SPIRAM_SUPPORTED != 1) - if: (CONFIG_NAME == "psram_with_pd_top" and (SOC_SPIRAM_SUPPORTED != 1 or SOC_PM_SUPPORT_TOP_PD != 1)) - disable_test: - - if: IDF_TARGET == "esp32p4" - temporary: true - reason: p4 rev3 migration # TODO: IDF-14419 components/esp_system/test_apps/linux_apis: enable: diff --git a/components/esp_system/test_apps/esp_system_unity_tests/pytest_esp_system_unity_tests.py b/components/esp_system/test_apps/esp_system_unity_tests/pytest_esp_system_unity_tests.py index f9520f834a..3d0d92f227 100644 --- a/components/esp_system/test_apps/esp_system_unity_tests/pytest_esp_system_unity_tests.py +++ b/components/esp_system/test_apps/esp_system_unity_tests/pytest_esp_system_unity_tests.py @@ -20,7 +20,6 @@ from pytest_embedded_idf.utils import idf_parametrize ], indirect=['config', 'target'], ) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14419') def test_esp_system(dut: Dut) -> None: # esp32p4 32MB PSRAM initialize in startup takes more than 30 sec dut.run_all_single_board_cases(timeout=60) @@ -29,7 +28,6 @@ def test_esp_system(dut: Dut) -> None: @pytest.mark.generic @idf_parametrize('config', ['default'], indirect=['config']) @idf_parametrize('target', ['supported_targets'], indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14419') def test_stack_smash_protection(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.write('"stack smashing protection"') diff --git a/components/esp_timer/test_apps/.build-test-rules.yml b/components/esp_timer/test_apps/.build-test-rules.yml index 027881f6be..b62f794ee4 100644 --- a/components/esp_timer/test_apps/.build-test-rules.yml +++ b/components/esp_timer/test_apps/.build-test-rules.yml @@ -4,7 +4,3 @@ components/esp_timer/test_apps: disable: - if: CONFIG_NAME == "dfs" and SOC_CLK_XTAL32K_SUPPORTED != 1 reason: The test requires the XTAL32K clock to measure the esp_timer timing accuracy - disable_test: - - if: IDF_TARGET == "esp32p4" - temporary: true - reason: p4 rev3 migration # TODO: IDF-14420 diff --git a/components/esp_timer/test_apps/pytest_esp_timer_ut.py b/components/esp_timer/test_apps/pytest_esp_timer_ut.py index 2ab8928b19..1c3c991fbe 100644 --- a/components/esp_timer/test_apps/pytest_esp_timer_ut.py +++ b/components/esp_timer/test_apps/pytest_esp_timer_ut.py @@ -22,7 +22,6 @@ from pytest_embedded_idf.utils import idf_parametrize ], indirect=['config', 'target'], ) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14420') def test_esp_timer(dut: Dut) -> None: dut.run_all_single_board_cases(timeout=120) @@ -37,7 +36,6 @@ def test_esp_timer(dut: Dut) -> None: indirect=True, ) @idf_parametrize('target', ['esp32'], indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14420') def test_esp_timer_psram(dut: Dut) -> None: dut.run_all_single_board_cases(timeout=120) diff --git a/components/freertos/test_apps/freertos/pytest_freertos.py b/components/freertos/test_apps/freertos/pytest_freertos.py index ce86a54cf8..c1e8ea7bdc 100644 --- a/components/freertos/test_apps/freertos/pytest_freertos.py +++ b/components/freertos/test_apps/freertos/pytest_freertos.py @@ -33,21 +33,9 @@ CONFIGS = [ @idf_parametrize( 'config,target,markers', [ - ( - 'default', - 'supported_targets', - (pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14421'),), - ), - ( - 'freertos_options', - 'supported_targets', - (pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14421'),), - ), - ( - 'tickless_idle', - 'supported_targets', - (pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14421'),), - ), + ('default', 'supported_targets'), + ('freertos_options', 'supported_targets'), + ('tickless_idle', 'supported_targets'), ('psram', 'esp32'), ('psram', 'esp32c5'), ('psram', 'esp32p4'), @@ -86,7 +74,6 @@ def test_freertos_flash_auto_suspend(dut: Dut) -> None: @pytest.mark.generic @pytest.mark.parametrize('config', ['freertos_options'], indirect=True) @idf_parametrize('target', ['supported_targets'], indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14421') def test_task_notify_too_high_index_fails(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests.') dut.write('"Notify too high index fails"') @@ -98,7 +85,6 @@ def test_task_notify_too_high_index_fails(dut: Dut) -> None: @pytest.mark.generic @pytest.mark.parametrize('config', ['freertos_options'], indirect=True) @idf_parametrize('target', ['supported_targets'], indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14421') def test_task_notify_wait_too_high_index_fails(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests.') dut.write('"Notify Wait too high index fails"') @@ -110,7 +96,6 @@ def test_task_notify_wait_too_high_index_fails(dut: Dut) -> None: @pytest.mark.generic @pytest.mark.parametrize('config', ['default'], indirect=True) @idf_parametrize('target', ['supported_targets'], indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14421') def test_port_must_assert_in_isr(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests.') dut.write('"port must assert if in ISR context"') diff --git a/components/hal/esp32p4/include/hal/cpu_utility_ll.h b/components/hal/esp32p4/include/hal/cpu_utility_ll.h index 3c8b235d81..e4110a7e64 100644 --- a/components/hal/esp32p4/include/hal/cpu_utility_ll.h +++ b/components/hal/esp32p4/include/hal/cpu_utility_ll.h @@ -33,11 +33,13 @@ FORCE_INLINE_ATTR void cpu_utility_ll_stall_cpu(uint32_t cpu_no) { if (cpu_no == 0) { HAL_FORCE_MODIFY_U32_REG_FIELD(PMU.cpu_sw_stall, hpcore0_stall_code, 0x86); - while(!REG_GET_BIT(HP_SYSTEM_CPU_CORESTALLED_ST_REG, HP_SYSTEM_REG_CORE0_CORESTALLED_ST)); } else { HAL_FORCE_MODIFY_U32_REG_FIELD(PMU.cpu_sw_stall, hpcore1_stall_code, 0x86); - while(!REG_GET_BIT(HP_SYSTEM_CPU_CORESTALLED_ST_REG, HP_SYSTEM_REG_CORE1_CORESTALLED_ST)); } + // We do not check stalled status here because + // it will not be set if the stalled core was in WFI when the stall happens, thus any check + // is unreliable. + // TODO: when ECO6 fixes this we can add back a check here } FORCE_INLINE_ATTR void cpu_utility_ll_unstall_cpu(uint32_t cpu_no) diff --git a/components/hal/esp32p4/include/hal/efuse_ll.h b/components/hal/esp32p4/include/hal/efuse_ll.h index b2d6223ff4..fe250fa555 100644 --- a/components/hal/esp32p4/include/hal/efuse_ll.h +++ b/components/hal/esp32p4/include/hal/efuse_ll.h @@ -13,6 +13,7 @@ #include "rom/efuse.h" #include "hal/ecdsa_types.h" #include "hal/ecdsa_ll.h" +#include "hal/config.h" #ifdef __cplusplus extern "C" { @@ -27,6 +28,25 @@ typedef enum { EFUSE_CONTROLLER_STATE_READ_RS_BLK = 5, ///< efuse_controllerid is on reading RS block state. } efuse_controller_state_t; +/* Revision-aware eFuse feature macros + * + * These macros indicate whether an eFuse feature is available given the + * configured minimum supported chip revision (HAL_CONFIG(CHIP_SUPPORT_MIN_REV)). + * Use them when a feature's presence depends on the chosen minimum revision. + * + * Note: SOC_* capability macros describe silicon capabilities; these + * EFUSE_LL_HAS_* macros reflect availability relative to the configured min revision. + * If a feature is present in silicon and does not depend on the chip revision, + * then add SOC_* macro in soc_caps.h instead. + */ +#if HAL_CONFIG(CHIP_SUPPORT_MIN_REV) >= 300 +// Rev 3.00+: key_purpose fields expanded from 4 to 5 bits, enabling additional key types. +#define EFUSE_LL_HAS_ECDSA_KEY_P192 (1) +#define EFUSE_LL_HAS_ECDSA_KEY_P384 (1) +#define EFUSE_LL_HAS_PSRAM_ENCRYPTION_XTS_AES_128 (1) +#define EFUSE_LL_HAS_PSRAM_ENCRYPTION_XTS_AES_256 (1) +#endif + // Always inline these functions even no gcc optimization is applied. /******************* eFuse fields *************************/ diff --git a/components/ulp/ld/lp_core_riscv.ld b/components/ulp/ld/lp_core_riscv.ld index 0f2da81c3e..05d84951b6 100644 --- a/components/ulp/ld/lp_core_riscv.ld +++ b/components/ulp/ld/lp_core_riscv.ld @@ -9,11 +9,13 @@ #if CONFIG_ESP_ROM_HAS_LP_ROM /* With LP-ROM memory layout is different due to LP ROM stack/data */ -#define ULP_MEM_START_ADDRESS SOC_RTC_DRAM_LOW + RESERVE_RTC_MEM +/* For P4 ECO5 we also reserve some RTC MEM at the first for MSPI workaround */ +#define ULP_MEM_START_ADDRESS SOC_RTC_DRAM_LOW + RESERVE_RTC_MEM + MSPI_WORKAROUND_SIZE #else #define ULP_MEM_START_ADDRESS (SOC_RTC_DRAM_LOW) #endif + #define ALIGN_DOWN(SIZE, AL) (SIZE & ~(AL - 1)) /* Ensure the end where the shared memory starts is aligned to 8 bytes if updating this also update the same in ulp_lp_core_memory_shared.c diff --git a/examples/cxx/.build-test-rules.yml b/examples/cxx/.build-test-rules.yml deleted file mode 100644 index 9d21130a1c..0000000000 --- a/examples/cxx/.build-test-rules.yml +++ /dev/null @@ -1,13 +0,0 @@ -# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps - -examples/cxx/exceptions: - disable_test: - - if: IDF_TARGET == "esp32p4" - temporary: true - reason: p4 rev3 migration # TODO: IDF-14402 - -examples/cxx/rtti: - disable_test: - - if: IDF_TARGET == "esp32p4" - temporary: true - reason: p4 rev3 migration # TODO: IDF-14402 diff --git a/examples/cxx/exceptions/pytest_examples_cxx_exceptions.py b/examples/cxx/exceptions/pytest_examples_cxx_exceptions.py index b2df9354f1..f62a8ae866 100644 --- a/examples/cxx/exceptions/pytest_examples_cxx_exceptions.py +++ b/examples/cxx/exceptions/pytest_examples_cxx_exceptions.py @@ -7,7 +7,6 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic @idf_parametrize('target', ['supported_targets'], indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14402') def test_examples_cpp_exceptions(dut: IdfDut) -> None: lines = [ 'app_main starting', diff --git a/examples/cxx/rtti/pytest_examples_cxx_rtti.py b/examples/cxx/rtti/pytest_examples_cxx_rtti.py index 705acc6249..e6d81bd99b 100644 --- a/examples/cxx/rtti/pytest_examples_cxx_rtti.py +++ b/examples/cxx/rtti/pytest_examples_cxx_rtti.py @@ -7,7 +7,6 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic @idf_parametrize('target', ['supported_targets'], indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14402') def test_cpp_rtti_example(dut: IdfDut) -> None: dut.expect_exact('Type name of std::cout is: std::ostream') dut.expect_exact('Type name of std::cin is: std::istream') diff --git a/examples/system/ipc/ipc_isr/riscv/pytest_ipc_isr_riscv.py b/examples/system/ipc/ipc_isr/riscv/pytest_ipc_isr_riscv.py index 81d9f50a79..29c7211cfc 100644 --- a/examples/system/ipc/ipc_isr/riscv/pytest_ipc_isr_riscv.py +++ b/examples/system/ipc/ipc_isr/riscv/pytest_ipc_isr_riscv.py @@ -10,12 +10,9 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14423') def test_ipc_isr_riscv(dut: Dut) -> None: dut.expect_exact('example: Start') - dut.expect_exact('example: MSTATUS = 0x11880') dut.expect_exact('example: in[0] = 0x1') dut.expect_exact('example: in[1] = 0x2') dut.expect_exact('example: in[2] = 0x3') dut.expect_exact('example: out[0] = (in[0] | in[1] | in[2]) = 0x3') dut.expect_exact('example: out[1] = (in[0] + in[1] + in[2]) = 0x6') - dut.expect_exact('example: out[2] = MCAUSE of other cpu = 0xb800002c') - dut.expect_exact('example: out[3] = MSTATUS of other cpu = 0x11880') dut.expect_exact('example: End') diff --git a/tools/test_apps/system/.build-test-rules.yml b/tools/test_apps/system/.build-test-rules.yml index 2770141fb7..76d0f5f380 100644 --- a/tools/test_apps/system/.build-test-rules.yml +++ b/tools/test_apps/system/.build-test-rules.yml @@ -27,10 +27,6 @@ tools/test_apps/system/eh_frame: disable: - if: IDF_TARGET in ["esp32", "esp32s2", "esp32s3", "linux"] reason: Only relevant for riscv targets - disable_test: - - if: IDF_TARGET == "esp32p4" - temporary: true - reason: p4 rev3 migration # TODO: IDF-14424 tools/test_apps/system/esp_intr_dump: diff --git a/tools/test_apps/system/eh_frame/pytest_eh_frame.py b/tools/test_apps/system/eh_frame/pytest_eh_frame.py index 92de8630dc..ca6de919f4 100644 --- a/tools/test_apps/system/eh_frame/pytest_eh_frame.py +++ b/tools/test_apps/system/eh_frame/pytest_eh_frame.py @@ -9,7 +9,6 @@ from pytest_embedded_idf.utils import idf_parametrize @idf_parametrize( 'target', ['esp32c2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32c61', 'esp32h2', 'esp32p4'], indirect=['target'] ) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14424') def test_eh_frame_wdt(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.confirm_write('"Test task wdt can print backtrace with eh-frame"', expect_str='Running') @@ -22,7 +21,6 @@ def test_eh_frame_wdt(dut: Dut) -> None: @idf_parametrize( 'target', ['esp32c2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32c61', 'esp32h2', 'esp32p4'], indirect=['target'] ) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration # TODO: IDF-14424') def test_eh_frame_panic(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.confirm_write('"Test panic can print backtrace with eh-frame"', expect_str='Running')