-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
drivers: intc: plic: add support for multiple instances #62907
Merged
carlescufi
merged 5 commits into
zephyrproject-rtos:main
from
ycsin:pr/plic_multi_instance_2
Nov 9, 2023
Merged
drivers: intc: plic: add support for multiple instances #62907
carlescufi
merged 5 commits into
zephyrproject-rtos:main
from
ycsin:pr/plic_multi_instance_2
Nov 9, 2023
Conversation
This file contains 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
ycsin
added
area: RISCV
RISCV Architecture (32-bit & 64-bit)
area: Interrupt Controller
labels
Sep 21, 2023
ycsin
changed the title
[drivers][interrupt-controller][plic] Add support for multiple instances
[drivers][interrupt-controller][riscv-plic] Add support for multiple instances
Sep 21, 2023
cfriedt
reviewed
Sep 21, 2023
ycsin
force-pushed
the
pr/plic_multi_instance_2
branch
from
September 21, 2023 10:01
63fcbe4
to
bfc4bda
Compare
cfriedt
reviewed
Sep 21, 2023
cfriedt
reviewed
Sep 21, 2023
tests/drivers/build_all/interrupt_controller/intc_plic/app.edge_interrupt.overlay
Outdated
Show resolved
Hide resolved
cfriedt
reviewed
Sep 21, 2023
cfriedt
reviewed
Sep 21, 2023
cfriedt
reviewed
Sep 21, 2023
ycsin
force-pushed
the
pr/plic_multi_instance_2
branch
9 times, most recently
from
September 25, 2023 05:59
40a87a0
to
b5589f3
Compare
ycsin
commented
Sep 25, 2023
ycsin
force-pushed
the
pr/plic_multi_instance_2
branch
from
September 25, 2023 07:51
b5589f3
to
772d36a
Compare
|
ycsin
force-pushed
the
pr/plic_multi_instance_2
branch
from
September 26, 2023 06:43
9324eb4
to
2d6b199
Compare
ycsin
changed the title
[drivers][interrupt-controller][riscv-plic] Add support for multiple instances
drivers: intc: plic: add support for multiple instances
Oct 3, 2023
cfriedt
previously approved these changes
Oct 3, 2023
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.
Pre-emptively acking. Please remember to rebase once #63172 is merged (for sw_isr_common changes)
ycsin
force-pushed
the
pr/plic_multi_instance_2
branch
from
October 4, 2023 14:33
21e8387
to
6548d76
Compare
ycsin
commented
Oct 4, 2023
cfriedt
previously approved these changes
Oct 11, 2023
ycsin
force-pushed
the
pr/plic_multi_instance_2
branch
from
October 16, 2023 08:07
6548d76
to
2b6e000
Compare
rebased on top of #63172, following the changes over there |
cfriedt
previously approved these changes
Oct 16, 2023
Use a config struct to store per-instance device config during init and connect the IRQ based on the devicetree instead of hardcoded value and instance number. The `get_plic_dev_from_irq` is still a placeholder for now and always return the first instance. Signed-off-by: Yong Cong Sin <[email protected]>
Most of the public APIs in `riscv_plic.h` (except `riscv_plic_get_irq` & `riscv_plic_get_dev`) expect the `irq` argument to be in Zephyr-encoded format, instead of the previously `irq_from_level_2`-stripped version. The first level IRQ is needed by `intc_plic` to differentiate between the parent interrupt controllers, so that correct ISR offset can be obtained using the LUT in `sw_isr_common`. Signed-off-by: Yong Cong Sin <[email protected]>
ycsin
force-pushed
the
pr/plic_multi_instance_2
branch
from
November 9, 2023 10:39
2b6e000
to
747467e
Compare
ycsin
force-pushed
the
pr/plic_multi_instance_2
branch
2 times, most recently
from
November 9, 2023 10:48
0f61111
to
6b4f996
Compare
Add PLIC multi-instance build-only test. Signed-off-by: Yong Cong Sin <[email protected]>
Added some defines and helper functions to help with the arithmetics so that the bit shifts and stuff do not look like magic number. Converted manual bit shift/set/unset to use macros provided by Zephyr. Signed-off-by: Yong Cong Sin <[email protected]>
Use arch-specific sys IO APIs to access the memory-mapped registers to ensure safe memory operations fixes zephyrproject-rtos#62956 Signed-off-by: Yong Cong Sin <[email protected]>
ycsin
force-pushed
the
pr/plic_multi_instance_2
branch
from
November 9, 2023 10:55
6b4f996
to
ec0ae61
Compare
fkokosinski
approved these changes
Nov 9, 2023
cfriedt
approved these changes
Nov 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: Architectures
area: Devicetree Binding
PR modifies or adds a Device Tree binding
area: Interrupt Controller
area: Kernel
area: RISCV
RISCV Architecture (32-bit & 64-bit)
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.
intc_plic
driver to be multi-instance readysw_isr_*
so that it also records the device pointer of the interrupt controllers & provide functions to do a lookup for the controller using the IRQN, as well as getting the ISR table offset for a controllerintc_plic
driver to use the functions in thesw_isr
so that it can differentiate parent controller from IRQN, and invoke the correct ISR with the correct offset fromsw_isr_*
riscv_plic
header file, previously the driver expects the trimmed IRQN returned byirq_from_level_2
as there can only be one controller, with multi-instance, we need the full multi-level-encoded IRQN, so that the driver can determine the right controller withz_get_sw_isr_device
using the 1st level IRQ.qemu_riscv*
as no QEMU machine supports more than one PLIC. Not sure if this is helpful.fixes #62441
fixes #62956
fixes #63465