kconfig: configure NUM_IRQS from Devicetree information#104819
Merged
MaureenHelm merged 4 commits intozephyrproject-rtos:mainfrom Mar 20, 2026
Merged
kconfig: configure NUM_IRQS from Devicetree information#104819MaureenHelm merged 4 commits intozephyrproject-rtos:mainfrom
MaureenHelm merged 4 commits intozephyrproject-rtos:mainfrom
Conversation
78019af to
25c7077
Compare
erwango
requested changes
Mar 4, 2026
362ebbe to
3c263ae
Compare
af1dc9d to
08254a9
Compare
Use new Kconfig preprocessor helper to compute CONFIG_NUM_IRQS during build instead of hardcoding it based on product Reference Manual Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Add release note section about the new Kconfig preprocessor function `dt_highest_controller_irq_number`. Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
As CONFIG_NUM_IRQS is now determined dynamically, it is possible that apps which registered ISRs outside drivers will trigger a build failure if the registered IRQn is higher than the biggest active device's IRQn. Add a note in the migration guide which describes this problem and gives the solution to tackle these build failures. Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
56bc081
08254a9 to
56bc081
Compare
Contributor
Author
|
Rebased + added support for new STM32C5 / STM32H5{E,F} / STM32WBA2 SoCs (no change necessary in STM32U3 as it already used a common |
|
gautierg-st
approved these changes
Mar 20, 2026
erwango
approved these changes
Mar 20, 2026
juickar
approved these changes
Mar 20, 2026
tejlmand
approved these changes
Mar 20, 2026
mbolivar
approved these changes
Mar 20, 2026
etienne-lms
approved these changes
Mar 20, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Spiritual successor of #33774
Introduce a new Kconfig preprocessor helper
dt_highest_controller_irq_number(path, cell)which, given the path to an interrupt controller and the name of the "IRQ number" cell among the controller'sinterrupt-cells, returns the maximal "IRQ number" found among all nodes linked to this controller. (the helper could be made more generic, e.g.dt_pha_cells_minmax_by_controller(path, prop, cell, min_or_max), wheredt_highest_controller_irq_number(path, cell) = dt_pha_cells_minmax_by_controller(path, "interrupts", cell, max)if it sounds more useful)Using this new helper, replace all hardcoded
CONFIG_IRQ_NUMdefaults in STM32 SoC files which heavily simplifies them and should provide a footprint reduction in many use cases. (this is limited to Cortex-M SoCs for now, but it could easily be expanded to (1) all STM32s SoCs and (2) Cortex-M-based SoCs)