mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
interrupt: removed descriptor table from esp32c3 interrupt hal.
This commit is contained in:
parent
5d316ac142
commit
72e4655d4e
@ -126,11 +126,11 @@ void esp_int_wdt_cpu_init(void)
|
|||||||
|
|
||||||
/* Set the type and priority to cache error interrupts, if supported. */
|
/* Set the type and priority to cache error interrupts, if supported. */
|
||||||
#if SOC_INTERRUPT_TYPE_CAN_SET
|
#if SOC_INTERRUPT_TYPE_CAN_SET
|
||||||
interrupt_controller_hal_set_type(WDT_INT_NUM, INTR_TYPE_LEVEL);
|
interrupt_controller_hal_set_int_type(WDT_INT_NUM, INTR_TYPE_LEVEL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SOC_INTERRUPT_LEVEL_CAN_SET
|
#if SOC_INTERRUPT_LEVEL_CAN_SET
|
||||||
interrupt_controller_hal_set_level(WDT_INT_NUM, SOC_INTERRUPT_LEVEL_MEDIUM);
|
interrupt_controller_hal_set_int_level(WDT_INT_NUM, SOC_INTERRUPT_LEVEL_MEDIUM);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
|
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
|
||||||
|
@ -28,8 +28,7 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"soc_hal.c"
|
"soc_hal.c"
|
||||||
"interrupt_controller_hal.c"
|
"interrupt_controller_hal.c"
|
||||||
"sha_hal.c"
|
"sha_hal.c"
|
||||||
"aes_hal.c"
|
"aes_hal.c")
|
||||||
"${target}/interrupt_descriptor_table.c")
|
|
||||||
|
|
||||||
if(${target} STREQUAL "esp32")
|
if(${target} STREQUAL "esp32")
|
||||||
list(APPEND srcs
|
list(APPEND srcs
|
||||||
@ -43,6 +42,7 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"twai_hal_iram.c"
|
"twai_hal_iram.c"
|
||||||
"esp32/adc_hal.c"
|
"esp32/adc_hal.c"
|
||||||
"esp32/brownout_hal.c"
|
"esp32/brownout_hal.c"
|
||||||
|
"esp32/interrupt_descriptor_table.c"
|
||||||
"esp32/touch_sensor_hal.c")
|
"esp32/touch_sensor_hal.c")
|
||||||
if(NOT BOOTLOADER_BUILD AND CONFIG_ETH_USE_ESP32_EMAC)
|
if(NOT BOOTLOADER_BUILD AND CONFIG_ETH_USE_ESP32_EMAC)
|
||||||
list(APPEND srcs "esp32/emac_hal.c")
|
list(APPEND srcs "esp32/emac_hal.c")
|
||||||
@ -65,6 +65,7 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"esp32s2/systimer_hal.c"
|
"esp32s2/systimer_hal.c"
|
||||||
"esp32s2/touch_sensor_hal.c"
|
"esp32s2/touch_sensor_hal.c"
|
||||||
"esp32s2/dac_hal.c"
|
"esp32s2/dac_hal.c"
|
||||||
|
"esp32s2/interrupt_descriptor_table.c"
|
||||||
"esp32s2/usb_hal.c")
|
"esp32s2/usb_hal.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -79,6 +80,7 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"twai_hal.c"
|
"twai_hal.c"
|
||||||
"twai_hal_iram.c"
|
"twai_hal_iram.c"
|
||||||
"esp32s3/brownout_hal.c"
|
"esp32s3/brownout_hal.c"
|
||||||
|
"esp32s3/interrupt_descriptor_table.c"
|
||||||
"esp32s3/systimer_hal.c"
|
"esp32s3/systimer_hal.c"
|
||||||
"esp32s3/touch_sensor_hal.c")
|
"esp32s3/touch_sensor_hal.c")
|
||||||
endif()
|
endif()
|
||||||
|
@ -122,7 +122,7 @@ static inline void intr_cntrl_ll_enable_int_mask(uint32_t newmask)
|
|||||||
*/
|
*/
|
||||||
static inline void intr_cntrl_ll_edge_int_acknowledge (int intr)
|
static inline void intr_cntrl_ll_edge_int_acknowledge (int intr)
|
||||||
{
|
{
|
||||||
esprv_intc_set_interrupt_clear(intr);
|
REG_SET_BIT(INTERRUPT_CORE0_CPU_INT_CLEAR_REG, intr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
#include "sdkconfig.h"
|
|
||||||
#include "hal/interrupt_controller_hal.h"
|
|
||||||
#include "soc/soc_caps.h"
|
|
||||||
#include "soc/soc.h"
|
|
||||||
|
|
||||||
//This is basically a software-readable version of the interrupt usage table in include/soc/soc.h
|
|
||||||
const int_desc_t interrupt_descriptor_table[32] = {
|
|
||||||
{ 1, INTTP_NA, {INTDESC_RESVD } }, //0
|
|
||||||
{ 1, INTTP_NA, {INTDESC_SPECIAL } }, //1
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //2
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //3
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //4
|
|
||||||
{ 1, INTTP_NA, {INTDESC_SPECIAL } }, //5
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //6
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //7
|
|
||||||
{ 1, INTTP_NA, {INTDESC_SPECIAL } }, //8
|
|
||||||
{ 1, INTTP_NA, {INTDESC_SPECIAL } }, //9
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //10
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //11
|
|
||||||
{ 1, INTTP_NA, {INTDESC_SPECIAL } }, //12
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //13
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //14
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //15
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //16
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //17
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //18
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //19
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //20
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //21
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //22
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //23
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //24
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //25
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //26
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //27
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //28
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //29
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //30
|
|
||||||
{ 1, INTTP_NA, {INTDESC_NORMAL } }, //31
|
|
||||||
};
|
|
||||||
|
|
||||||
const int_desc_t *interrupt_controller_hal_desc_table(void)
|
|
||||||
{
|
|
||||||
return interrupt_descriptor_table;
|
|
||||||
}
|
|
@ -23,12 +23,14 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SOC_CPU_HAS_FLEXIBLE_INTC
|
||||||
/**
|
/**
|
||||||
* @brief Gets target platform interrupt descriptor table
|
* @brief Gets target platform interrupt descriptor table
|
||||||
*
|
*
|
||||||
* @return Address of interrupt descriptor table
|
* @return Address of interrupt descriptor table
|
||||||
*/
|
*/
|
||||||
__attribute__((pure)) const int_desc_t *interrupt_controller_hal_desc_table(void);
|
__attribute__((pure)) const int_desc_t *interrupt_controller_hal_desc_table(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the interrupt type given an interrupt number.
|
* @brief Gets the interrupt type given an interrupt number.
|
||||||
@ -55,24 +57,6 @@ __attribute__((pure)) int interrupt_controller_hal_desc_level(int interrupt_num
|
|||||||
*/
|
*/
|
||||||
__attribute__((pure)) int_desc_flag_t interrupt_controller_hal_desc_flags(int interrupt_number, int cpu_number);
|
__attribute__((pure)) int_desc_flag_t interrupt_controller_hal_desc_flags(int interrupt_number, int cpu_number);
|
||||||
|
|
||||||
#if SOC_INTERRUPT_LEVEL_CAN_SET
|
|
||||||
/**
|
|
||||||
* @brief Set the interrupt level given an interrupt number.
|
|
||||||
*
|
|
||||||
* @param interrupt_number number of the interrupt
|
|
||||||
* @param level new level for this interrupt
|
|
||||||
*/
|
|
||||||
void interrupt_controller_hal_set_level(int interrupt_number, int level);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Set the interrupt type given an interrupt number.
|
|
||||||
*
|
|
||||||
* @param interrupt_number number of the interrupt
|
|
||||||
* @param type new type for this interrupt
|
|
||||||
*/
|
|
||||||
void interrupt_controller_hal_set_type(int interrupt_number, int_type_t type);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the interrupt type given an interrupt number.
|
* @brief Gets the interrupt type given an interrupt number.
|
||||||
*
|
*
|
||||||
|
@ -16,34 +16,30 @@
|
|||||||
|
|
||||||
int_type_t interrupt_controller_hal_desc_type(int interrupt_number)
|
int_type_t interrupt_controller_hal_desc_type(int interrupt_number)
|
||||||
{
|
{
|
||||||
|
#ifndef SOC_CPU_HAS_FLEXIBLE_INTC
|
||||||
const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
|
const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
|
||||||
return(int_desc[interrupt_number].type);
|
return(int_desc[interrupt_number].type);
|
||||||
|
#else
|
||||||
|
return (INTTP_NA);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int interrupt_controller_hal_desc_level(int interrupt_number)
|
int interrupt_controller_hal_desc_level(int interrupt_number)
|
||||||
{
|
{
|
||||||
|
#ifndef SOC_CPU_HAS_FLEXIBLE_INTC
|
||||||
const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
|
const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
|
||||||
return(int_desc[interrupt_number].level);
|
return(int_desc[interrupt_number].level);
|
||||||
|
#else
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int_desc_flag_t interrupt_controller_hal_desc_flags(int interrupt_number, int cpu_number)
|
int_desc_flag_t interrupt_controller_hal_desc_flags(int interrupt_number, int cpu_number)
|
||||||
{
|
{
|
||||||
|
#ifndef SOC_CPU_HAS_FLEXIBLE_INTC
|
||||||
const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
|
const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
|
||||||
return(int_desc[interrupt_number].cpuflags[cpu_number]);
|
return(int_desc[interrupt_number].cpuflags[cpu_number]);
|
||||||
}
|
#else
|
||||||
|
return INTDESC_NORMAL;
|
||||||
#if SOC_INTERRUPT_LEVEL_CAN_SET
|
|
||||||
|
|
||||||
void interrupt_controller_hal_set_level(int interrupt_number, int level) {
|
|
||||||
intr_cntrl_ll_set_level(interrupt_number, level);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SOC_INTERRUPT_TYPE_CAN_SET
|
|
||||||
|
|
||||||
void interrupt_controller_hal_set_type(int interrupt_number, int_type_t type) {
|
|
||||||
intr_cntrl_ll_set_type(interrupt_number, type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -110,13 +110,6 @@ void esprv_intc_set_threshold(int priority_threshold);
|
|||||||
*/
|
*/
|
||||||
uint32_t esprv_intc_get_interrupt_unmask(void);
|
uint32_t esprv_intc_get_interrupt_unmask(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Set a bit in int clear register
|
|
||||||
* @param intr bit to set from 0 to 31
|
|
||||||
* @return none
|
|
||||||
*/
|
|
||||||
void esprv_intc_set_interrupt_clear(int intr);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -89,12 +89,6 @@ uint32_t esprv_intc_get_interrupt_unmask(void)
|
|||||||
return REG_READ(INTERRUPT_CORE0_CPU_INT_ENABLE_REG);
|
return REG_READ(INTERRUPT_CORE0_CPU_INT_ENABLE_REG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void esprv_intc_set_interrupt_clear(int intr)
|
|
||||||
{
|
|
||||||
REG_SET_BIT(INTERRUPT_CORE0_CPU_INT_CLEAR_REG, intr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************** Exception names. Used in .gdbinit file. ***************************/
|
/*************************** Exception names. Used in .gdbinit file. ***************************/
|
||||||
|
|
||||||
const char *riscv_excp_names[16] __attribute__((used)) = {
|
const char *riscv_excp_names[16] __attribute__((used)) = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user