-
Notifications
You must be signed in to change notification settings - Fork 7.7k
drivers: Add interrupt controller API #66505
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
Draft
bjarki-andreasen
wants to merge
15
commits into
zephyrproject-rtos:main
Choose a base branch
from
bjarki-andreasen:drivers_add_intc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e4db61b
dts: interrupt-contoller: Add interrupt-lines base property
bjarki-andreasen 75d2168
kernel: Add system IRQ iface, impl, script and cmake target
bjarki-andreasen 0301bc0
drivers: intc: Add intc device driver API header
bjarki-andreasen 5a1f256
drivers: intc: Add irq_vector.h
bjarki-andreasen 1ed1032
arch: arm: irq.h: Use UTIL_CAT instead of ##
bjarki-andreasen 328e000
drivers: intc: Add arm v8m nvic device driver
bjarki-andreasen 56a632d
drivers: intc: add arm nvic v7m device driver
bjarki-andreasen df86407
dts: arm: nordic: add interrupt-lines nrf5340
bjarki-andreasen 4544511
drivers: timer: nrf_rtc_timer: Update to system IRQ
bjarki-andreasen 017e824
drivers: clock_control: update clock_control_nrf to sys IRQ
bjarki-andreasen f457ef1
drivers: serial: uart_nrfx_uarte.c: Update to use sys IRQ
bjarki-andreasen 524b084
drivers: gpio: gpio_nrfx: Update to use sys IRQ
bjarki-andreasen b114550
drivers: add power and driver for nrf_power
bjarki-andreasen 185993b
tests: kernel: Add sys_irq test suites
bjarki-andreasen 4dff6e0
doc: kernel: services: add sys_irq
bjarki-andreasen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.. _sys_irq: | ||
|
||
SYS IRQ (SYStem Interrupt ReQuest) WIP | ||
###################################### | ||
|
||
The SYS IRQ kernel service utilizes the devicetree and device driver model to | ||
provide interrupt handling scalably, portably and efficiently. | ||
|
||
Design | ||
****** | ||
|
||
The design provides clear separation between interrupt controllers, interrupt | ||
generating devices, and interrupt request management. | ||
|
||
IRQ (Interrupt ReQuests) | ||
======================== | ||
|
||
An IRQ is a hardware event which, when triggered, invokes a handler in | ||
software. | ||
|
||
INTC (INTerrupt Controller) | ||
=========================== | ||
|
||
INTCs invoke SYS IRQ INTL (INTerrupt Line) handlers when an interrupt is detected | ||
on the corresponding INTL. | ||
|
||
It is the responsibility of the INTC device driver, SoC and Arch, to do any and | ||
all preparation required to invoke the SYS IRQ INTL handlers from a execution | ||
context. | ||
|
||
Any and all configuration of INTLs is performed by SYS IRQ through the INTC device | ||
driver API. | ||
|
||
INTD (INTerrupt generating Device) | ||
================================== | ||
|
||
INTDs route IRQs through INTLs. Its' IRQs are defined in the devicetree, and managed | ||
by SYS IRQ. | ||
|
||
INTD device drivers define their IRQ handlers which SYS IRQ will invoke when the | ||
IRQ is triggered. | ||
|
||
INTD device drivers configure and enable/disable their IRQs using SYS IRQ. | ||
|
||
Porting guide | ||
************* | ||
|
||
The following section describes how to port a series SoCs, Archs and device drivers | ||
from legacy IRQ to SYS IRQ. | ||
|
||
INTC | ||
==== | ||
|
||
Device drivers implementing the INTC API for all INTCs must be written for each | ||
INTC. | ||
|
||
INTD | ||
==== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2024 Bjarki Arge Andreasen | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
add_subdirectory_ifdef(CONFIG_INTC_ARM_V7M_NVIC intc_arm_v7m_nvic) | ||
add_subdirectory_ifdef(CONFIG_INTC_ARM_V8M_NVIC intc_arm_v8m_nvic) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) 2023 Bjarki Arge Andreasen | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menuconfig INTC | ||
bool "INTC (INTerrupt Controller) drivers" | ||
|
||
if INTC | ||
|
||
rsource "intc_arm_v7m_nvic/Kconfig" | ||
rsource "intc_arm_v8m_nvic/Kconfig" | ||
|
||
endif # INTC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library() | ||
|
||
zephyr_library_sources(arm_v7m_nvic.c) | ||
zephyr_linker_sources(ROM_START SORT_KEY 0x0vectors irq-vector-table.ld) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config INTC_ARM_V7M_NVIC | ||
bool "Arm V7M Nested Vector Interrupt Controller" | ||
default y | ||
depends on DT_HAS_ARM_V7M_NVIC_ENABLED |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the abbreviation and the full name should be separated. Simply put, the whole process should be capitalized according to the first letter of the sentence, without deliberately showing the abbreviation.
For example
(Applicable to all changes.)