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

dts: renesas: ra: Handle interrupt numbers generation for Renesas RA series #78952

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

quytranpzz
Copy link
Contributor

@quytranpzz quytranpzz commented Sep 24, 2024

This PR updates interrupt number for Renesas RA boards (for current supported boards, RA2L1 will be supported later) to avoid full of interrupt ID.
(related to PR #78579).
We will add map_renesas_ra_irq function in gen_defines.py script to intervene in the generation of the device tree during build.
Only nodes with status = "okay"; will have their interrupt IDs generated as valid numbers in devicetree_generated.h. The others will be assigned interrupt IDs with the unspecified value (0xff).
This will help conserve the interrupt IDs allocated in isr_table.c.

Add the map_renesas_ra_irq to handle interrupt number for Renesas
RA series to avoid full of interrupt ID

Signed-off-by: Tran Van Quy <quy.tran.pz@renesas.com>
Update interrupt for Renesas RA8 series, to use with dts python script.
The target is to handle the interrupt ID allocation in build time

Signed-off-by: Tran Van Quy <quy.tran.pz@renesas.com>
This update is to adapt the change for handling interrupt id allocation

Signed-off-by: Tran Van Quy <quy.tran.pz@renesas.com>
This update is to adapt the change for handling interrupt id allocation

Signed-off-by: Tran Van Quy <quy.tran.pz@renesas.com>
This update is to adapt the change for handling interrupt id allocation

Signed-off-by: Tran Van Quy <quy.tran.pz@renesas.com>
Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

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

As discussed at length in #75946 and at the arch meeting, interrupt maps in the devicetree shall be used for mapping interrupts. I see there is some precedence with the map_arm_gic_irq_type fn, but as the TODO just above the function suggests, this should be moved to the devicetree as well.

@thaoluonguw
Copy link
Collaborator

thaoluonguw commented Sep 25, 2024

As discussed at length in #75946 and at the arch meeting, interrupt maps in the devicetree shall be used for mapping interrupts. I see there is some precedence with the map_arm_gic_irq_type fn, but as the TODO just above the function suggests, this should be moved to the devicetree as well.

@bjarki-andreasen: We aware the discussion in #75946.

  • As you may already know, the RA MCU interrupt mapping is complicated. The mapping can be up to 400+ signals map with 96 NVIC lines. Your proposal for using interrupt_map is almost impossible for RA Zephyr Users.

  • With this situation, we would like to propose a solution to support for RA Zephyr but not impact to others in Zephyr ecosystem. It is supported for RA MCU specifically. We would like to have your strongly consideration to have a change to improve for RA Zephyr User Experience.

Thank you so much.

@bjarki-andreasen
Copy link
Collaborator

As discussed at length in #75946 and at the arch meeting, interrupt maps in the devicetree shall be used for mapping interrupts. I see there is some precedence with the map_arm_gic_irq_type fn, but as the TODO just above the function suggests, this should be moved to the devicetree as well.

@bjarki-andreasen: We aware the discussion in #75946.

  • As you may already know, the RA MCU interrupt mapping is complicated. The mapping can be up to 400+ signals map with 96 NVIC lines. Your proposal for using interrupt_map is almost impossible for RA Zephyr Users.
  • With this situation, we would like to propose a solution to support for RA Zephyr but not impact to others in Zephyr ecosystem. It is supported for RA MCU specifically. We would like to have your strongly consideration to have a change to improve for RA Zephyr User Experience.

Thank you so much.

The effect in the Zephyr ecosystem will not be felt heavily by this addition specifically, it will be felt when others want to do the same. The gen_defines.py script will, with high certainty, be abused. Add a little here for one platform, a little there for another, until any change to introduce new platforms, or make changes to the overall interrupt architecture becomes impossible without breaking existing platforms.

A platform, redefining what an IRQ number is, how IRQs are modeled in the devicetree, how the isr table is generated, which is different from all other platforms, is not scalable. The solution in this PR, is not scalable.

The learning curve for any OS is already high, now users need to learn how each platform implements and manages interrupts?

The fact is that we have a solution for interrupt mapping, which supports all platforms, including this one. It may not be perfectly tailored to the RA (I believe it is fine), but that is the case for any standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants