Skip to content

Commit eb606a8

Browse files
Raffael Rostagnokartben
authored andcommitted
soc: esp32: Update IRQ config for shared allocator
Update IRQ handling related files to unify interrupt controller between Xtensa and RISCV devices. Signed-off-by: Raffael Rostagno <[email protected]> Signed-off-by: Sylvio Alves <[email protected]>
1 parent 3e8b246 commit eb606a8

24 files changed

+35
-315
lines changed

soc/espressif/common/loader.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
2+
* Copyright (c) 2024-2025 Espressif Systems (Shanghai) Co., Ltd.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -252,7 +252,7 @@ void __start(void)
252252
{
253253
#ifdef CONFIG_RISCV_GP
254254

255-
__asm__ __volatile__("la t0, _esp_vector_table\n"
255+
__asm__ __volatile__("la t0, _vector_table\n"
256256
"csrw mtvec, t0\n");
257257

258258
/* Disable normal interrupts. */

soc/espressif/esp32/soc.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ void IRAM_ATTR __esp_platform_app_start(void)
2626

2727
esp_flash_config();
2828

29-
esp_intr_initialize();
30-
3129
#if CONFIG_ESP_SPIRAM
3230
esp_init_psram();
3331

@@ -47,8 +45,6 @@ void IRAM_ATTR __esp_platform_app_start(void)
4745

4846
void IRAM_ATTR __esp_platform_mcuboot_start(void)
4947
{
50-
esp_intr_initialize();
51-
5248
/* Start Zephyr */
5349
z_prep_c();
5450

soc/espressif/esp32/soc_appcpu.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ void IRAM_ATTR __appcpu_start(void)
8787

8888
core_intr_matrix_clear();
8989

90-
esp_intr_initialize();
91-
9290
/* Start Zephyr */
9391
z_prep_c();
9492

soc/espressif/esp32c2/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
zephyr_sources(
44
vectors.S
55
soc_irq.S
6-
soc_irq.c
76
soc.c
87
../common/loader.c
98
)

soc/espressif/esp32c2/Kconfig.defconfig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# ESP32C2 SoC configuration
2-
3-
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
1+
# Copyright (c) 2024-2025 Espressif Systems (Shanghai) Co., Ltd.
42
# SPDX-License-Identifier: Apache-2.0
53

64
if SOC_SERIES_ESP32C2
75

86
config NUM_IRQS
9-
default 43
7+
default 32
108

119
config FLASH_SIZE
1210
default $(dt_node_reg_size_int,/soc/flash-controller@60002000/flash@0,0)

soc/espressif/esp32c2/soc.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <esp_private/cache_utils.h>
1111
#include <esp_private/system_internal.h>
1212
#include <esp_timer.h>
13-
#include <zephyr/drivers/interrupt_controller/intc_esp32c3.h>
13+
#include <zephyr/drivers/interrupt_controller/intc_esp32.h>
1414
#include <zephyr/kernel_structs.h>
1515
#include <kernel_internal.h>
1616

@@ -24,8 +24,6 @@ void IRAM_ATTR __esp_platform_app_start(void)
2424

2525
esp_flash_config();
2626

27-
esp_intr_initialize();
28-
2927
/* Start Zephyr */
3028
z_cstart();
3129

@@ -34,8 +32,6 @@ void IRAM_ATTR __esp_platform_app_start(void)
3432

3533
void IRAM_ATTR __esp_platform_mcuboot_start(void)
3634
{
37-
esp_intr_initialize();
38-
3935
/* Start Zephyr */
4036
z_cstart();
4137

soc/espressif/esp32c2/soc_irq.S

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2024 Espressif Systems (Shanghai) PTE LTD
1+
/* Copyright 2021-2025 Espressif Systems (Shanghai) PTE LTD
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*/
@@ -8,13 +8,8 @@
88

99
/* Exports */
1010
GTEXT(__soc_handle_irq)
11-
GTEXT(soc_intr_get_next_source)
1211

1312
SECTION_FUNC(exception.other, __soc_handle_irq)
14-
addi sp, sp,-4
15-
sw ra, 0x00(sp)
16-
la t1, soc_intr_get_next_source
17-
jalr ra, t1, 0
18-
lw ra, 0x00(sp)
19-
addi sp, sp, 4
13+
14+
/* int status clearing is done at ISR */
2015
ret

soc/espressif/esp32c2/soc_irq.c

Lines changed: 0 additions & 69 deletions
This file was deleted.

soc/espressif/esp32c2/vectors.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2024 Espressif Systems (Shanghai) PTE LTD
1+
/* Copyright 2020-2025 Espressif Systems (Shanghai) PTE LTD
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*/
@@ -22,12 +22,12 @@ GTEXT(_isr_wrapper)
2222
* only uses the 24 MSBs of the MTVEC, i.e. (MTVEC & 0xffffff00).
2323
*/
2424

25-
.global _esp_vector_table
25+
.global _vector_table
2626
.section .exception_vectors.text
2727
.balign 0x100
28-
.type _esp_vector_table, @function
28+
.type _vector_table, @function
2929

30-
_esp_vector_table:
30+
_vector_table:
3131
.option push
3232
.option norvc
3333
.rept (32)

soc/espressif/esp32c3/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
zephyr_sources(
44
vectors.S
55
soc_irq.S
6-
soc_irq.c
76
soc.c
87
../common/loader.c
98
)

0 commit comments

Comments
 (0)