Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interrupt_controller: intc_esp32c3: added intc driver #38372

Merged
merged 3 commits into from
Oct 2, 2021

Conversation

uLipe
Copy link
Collaborator

@uLipe uLipe commented Sep 7, 2021

For esp32c3 and replaces the hardcoded interrupt
attaching procedures with this new driver.

The allocation strategy reuses the common riscv software isr table infrastructure provided
by zephyr:

  • It multiplexes each IRQ with 2 interrupt sources, special cases may have more or less IRQ lines
    attached to different sources;

  • After an IRQ is selected, it is routed to the interrupt matrix as usual and the IRQ is enabled if it was not previously;

  • The ISR + argument is installed directly into zephyr´s software ISR table entry, the peripheral source number is used directly as table index;

  • When an ISR occurs, the zephyr platform specific __soc_handle_irq was modified and it is called, and instead of returning the mcause in a0, it returns the source of the peripheral in a0, and this value is used to fetch the proper ISR entry from sw ISR table;

  • If further interrupts are pending the irq wrapper calls __soc_handle_irq, and from lowest to highest source number, one by one gets checked and placed in a0 for next ISR handle until all pending interrupts get addressed;

  • When a peripheral source is not needed to interrupt anymore, it is just routed to an inactive IRQ line which is kept permanently disabled preventing it to fire, IRQ line 31 is used by this purpose.

@github-actions
Copy link

github-actions bot commented Sep 7, 2021

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
hal_espressif zephyrproject-rtos/hal_espressif@6cb3748 zephyrproject-rtos/hal_espressif@03c8337 zephyrproject-rtos/hal_espressif@6cb37487..03c8337a

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@uLipe
Copy link
Collaborator Author

uLipe commented Sep 9, 2021

Hi folks, any considerations there?

@uLipe uLipe force-pushed the feature/intc_esp32c3 branch 2 times, most recently from 15333f2 to 562bb6a Compare September 17, 2021 23:51
Copy link
Member

@fkokosinski fkokosinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Collaborator

@pgielda pgielda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cfriedt
Copy link
Member

cfriedt commented Sep 21, 2021

We are in the stabilization period for v2.7.0 atm, so if the PR does not fix a bug it will not be merged for 2.7.0 unless it has TSC approval.

@uLipe - are there many other additions required for supporting the esp32c3 devkit?

@uLipe
Copy link
Collaborator Author

uLipe commented Sep 21, 2021

@cfriedt , for the initial devkitm support is there the WIFI support which is internal tests which may not arrive in the next days.

@cfriedt
Copy link
Member

cfriedt commented Sep 21, 2021

I have a couple of those boards on the way, so I'm looking forward to trying them out :-)

@cfriedt
Copy link
Member

cfriedt commented Sep 29, 2021

@uLipe - please rebase and resolve conflicts

west.yml Outdated Show resolved Hide resolved
Felipe Neves added 3 commits September 30, 2021 02:25
For esp32c3 and replaces the hardcoded interrupt
attaching procedures with this new driver.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
interrupt controller, also places its relevant
peripheral sources allowing drivers to use the
DT macros instead of espressif headers.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
Allowing cleaner debug experience and preventing unwanted
outputs during debug.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
@uLipe
Copy link
Collaborator Author

uLipe commented Oct 1, 2021

Hi folks, can we move on with this PR?

@nashif nashif merged commit 949a6a8 into zephyrproject-rtos:main Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants