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
Add support for Intel FPGA Nios V/g General Purpose Processor #59043
Conversation
To download the Zephyr Executable and Linkable Format .elf file, please use the niosv-download command within Nios V Command Shell environment. | ||
|
||
.. code-block:: console | ||
|
||
niosv-download -g <elf file> |
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.
a west runner should be implemented
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.
Okay. But suggest to have separate PR to support this.
I will study how west runner can works without niosv-download utility and can submit separate PR once it works for niosv_g and also niosv_m.
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.
sure, it's ok, just noting to avoid adding more boards with custom flashing mechanisms. I think we should be consistent and offer a uniform user experience.
CONFIG_PRINTK=y | ||
CONFIG_SERIAL=y | ||
CONFIG_UART_CONSOLE=y | ||
CONFIG_UART_ALTERA_JTAG=y |
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.
redundant
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.
Got it, will remove this. Thanks.
This needs rebasing after 8eeb5c9. |
Rebase done. Thanks. |
723f372
Add support for INTEL FPGA Nios V/g RISC-V based Processors. Also amended SOC_NIOSV_M to use ATOMIC_OPERATIONS_BUILTIN. Signed-off-by: Khor Swee Aun <swee.aun.khor@intel.com>
Add basic dts support for INTEL Nios V/g General Purpose Processor. Signed-off-by: Khor Swee Aun <swee.aun.khor@intel.com>
Add board support for INTEL Nios V/g General Processor. Signed-off-by: Khor Swee Aun <swee.aun.khor@intel.com>
Add code owner for INTEL FPGA Nios V/g dts, SoC and board. Signed-off-by: Khor Swee Aun <swee.aun.khor@intel.com>
reg = <0>; | ||
clock-frequency = <50000000>; | ||
|
||
/* Platform interrupts IRQs index start from 16 */ |
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.
Uhm, are you in this exact situation then? #59035
How are you dealing with this offset?
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.
@carlocaione , I have to add the offset manual in device tree. Nice patch from you to enable this, hope it go in main line soon.
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.
@carlocaione, wonder will that patch add offset to riscv machine timer as well? I don't think machine timer need add offset.
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.
@sweeaun yeah, that is not going to work with this patch then. In my use-case the offset-ted lines are not practically usable anymore. What is your actual configuration? You have CLINT + CLIC?
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.
Yes. we do hart local interrupt and Platform-Level Interrupt Controller (PLIC).
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.
oh ok, you have CLINT + PLIC. In that case I think that you can use CONFIG_2ND_LEVEL_INTERRUPTS
to get rid of the 16 lines offset.
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.
Hi @carlocaione , our core doesn't have multiple level and only 1 level for all interrupts. Just that the interrupt 16 to 31 is named as platform interrupt which is not another level of interrupt controller. Sorry for confusion.
https://www.intel.com/content/www/us/en/docs/programmable/683632/23-1/interrupt-controller-91908.html
bit 3 is for software interrupt
bit 7 is for machine timer
bit[31:16] for platform interrupt
I don't think multi level interrupt configuration is needed in our case.
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.
interesting. Out of curiosity: how the platform is managing mcause
? For example mcause
for software interrupt is carrying the id 3
and 19
for the third platform interrupt?
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.
software interrupt registered to irq 3
machine timer registred to irq 7
1st platform interrupt registered to irq 16
2nd platform interrupt registered to irq 17
3rd platform interrupt registered to irq 18
and so on...
In this system, we have jtag-uart connected to 1st platform interrupt. Thus the irq number is 16.
Not sure am I answered your question.
This PR add support for Intel FPGA Nios V/g SoC and board, board system design is based on Intel FPGA Design Store Nios® V/g Hello World Example Design system.
More information about Intel FPGA Nios V/g and Hello World Example Design system can be obtained here:
https://www.intel.com/content/www/us/en/products/details/fpga/nios-processor/v.html
https://www.intel.com/content/www/us/en/design-example/776196/intel-arria-10-fpga-hello-world-design-on-nios-v-g-processor.html
For testing, it was verified with following samples:
hello_world
synchronization
philosophers