Support Handling each PLIC interrupt on each hart on multi-core#322
Open
aidenschoi wants to merge 2 commits intosifive:masterfrom
Open
Support Handling each PLIC interrupt on each hart on multi-core#322aidenschoi wants to merge 2 commits intosifive:masterfrom
aidenschoi wants to merge 2 commits intosifive:masterfrom
Conversation
Contributor
keith-packard
left a comment
There was a problem hiding this comment.
The issue underlying this bug is that Freedom Metal does not correctly support CPU interrupt configuration in multi-HART systems. Configuration of the CPU interrupt controller can only be done by instructions executing on the target CPU. Freedom Metal has no way to get a particular core to execute those instructions. This patch does not solve that problem. It may make some code work in some environments which does not work today, but that's essentially entirely accidental.
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.
Hi,
I have an issue.
The implementation of freedom-metal should be considered about PLIC interrupt handling on multi-core. But, currently, PLIC can be handled on only 1 core that registers an interrupt at first among several cores. For example, when the PLIC interrupt of BTN0 is registered on hart0 and PLIC of BTN1 is registered on hart1, only BTN0 works on hart0 and BTN1 doesn't work. Because mtvec and mie of only one core are enabled normally and other cores keep initial value - early_trap_vector (mtvec) and NULL (mie) instead of the address of __metal_exception_handler() (mtvec) and 0x800 (MEIE in mie).
So. I modified 2 files for this problem.
The modification in riscv_cpu.c is to enable mtvec on each core.
The modification in riscv_plic0.c is to set mie to 0x800 (MEIE) on each core.
Please refer IPOBHD-176 for detail.
Thanks,
Aiden.