Merge branch 'bugfix/clic_edge_type_interrupt_config' into 'master'

fix(esp_rom): patch esprv_intc_int_set_type for esp32p4

See merge request espressif/esp-idf!28161
This commit is contained in:
Gao Xiao Jie 2024-04-07 11:09:19 +08:00
commit f1babb9074
5 changed files with 30 additions and 2 deletions

View File

@ -69,7 +69,9 @@ if(CONFIG_HAL_WDT_USE_ROM_IMPL)
list(APPEND sources "patches/esp_rom_wdt.c") list(APPEND sources "patches/esp_rom_wdt.c")
endif() endif()
if(CONFIG_ESP_ROM_CLIC_INT_TYPE_PATCH)
list(APPEND sources "patches/esp_rom_clic.c")
endif()
if(CONFIG_ESP_ROM_HAS_FLASH_COUNT_PAGES_BUG OR CONFIG_ESP_ROM_HAS_CACHE_WRITEBACK_BUG) if(CONFIG_ESP_ROM_HAS_FLASH_COUNT_PAGES_BUG OR CONFIG_ESP_ROM_HAS_CACHE_WRITEBACK_BUG)
list(APPEND sources "patches/esp_rom_cache_esp32s2_esp32s3.c") list(APPEND sources "patches/esp_rom_cache_esp32s2_esp32s3.c")

View File

@ -70,3 +70,7 @@ config ESP_ROM_HAS_NEWLIB_NANO_FORMAT
config ESP_ROM_HAS_VERSION config ESP_ROM_HAS_VERSION
bool bool
default y default y
config ESP_ROM_CLIC_INT_TYPE_PATCH
bool
default y

View File

@ -23,3 +23,4 @@
#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included
#define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano version of formatting functions #define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano version of formatting functions
#define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information #define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information
#define ESP_ROM_CLIC_INT_TYPE_PATCH (1) // ROM api esprv_intc_int_set_type configuring edge type interrupt is invalid

View File

@ -328,7 +328,6 @@ esprv_intc_int_set_priority = 0x4fc005b8;
esprv_intc_int_set_threshold = 0x4fc005bc; esprv_intc_int_set_threshold = 0x4fc005bc;
esprv_intc_int_enable = 0x4fc005c0; esprv_intc_int_enable = 0x4fc005c0;
esprv_intc_int_disable = 0x4fc005c4; esprv_intc_int_disable = 0x4fc005c4;
esprv_intc_int_set_type = 0x4fc005c8;
PROVIDE( intr_handler_set = 0x4fc005cc ); PROVIDE( intr_handler_set = 0x4fc005cc );
intr_matrix_set = 0x4fc005d0; intr_matrix_set = 0x4fc005d0;
ets_intr_lock = 0x4fc005d4; ets_intr_lock = 0x4fc005d4;

View File

@ -0,0 +1,22 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_rom_caps.h"
#include "soc/clic_reg.h"
#include "riscv/interrupt.h"
#if ESP_ROM_CLIC_INT_TYPE_PATCH
/* Rom api esprv_intc_int_set_type, if the configured interrupt type is INTR_TYPE_EDGE,
* the actual configured type is still INTR_TYPE_LEVEL. So the patch is to solve this issue.
* Since esprv_intc_int_set_type has an alias defined as esprv_int_set_type in riscv/ld/rom.api.ld,
* therefore, use esprv_int_set_type to override the rom function.
*/
void esprv_int_set_type(int rv_int_num, enum intr_type type)
{
REG_SET_FIELD(CLIC_INT_CTRL_REG(rv_int_num + CLIC_EXT_INTR_NUM_OFFSET), CLIC_INT_ATTR_TRIG, type);
}
#endif