-
Notifications
You must be signed in to change notification settings - Fork 0
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
fpga: Add reset controller for FPGA peripherals #371
base: master
Are you sure you want to change the base?
Conversation
Code looks good in general, I just started wondering about one thing
So, IMHO the drivers require to use some generic api & stubs to issue block reset, which can be implemented by whomever designs the FPGA, if reset functionality is required... Or have some CONFIG flag that can be used to leave out the reset functionality. In other words, as the state of this PR is now, it is not possible to instantiate only publicly available IP blocks on FPGA and take the corresponding CoreXXX drivers into use with those, since the reset interfaces wouldn't work. |
Yes this code is not upstreamable. It is very specifically stated here as well. If you want a, generic reset and clock control driver is of course an option. That driver should precede this content. |
9450949
to
ffd3653
Compare
The stub driver is the first patch, that is going to upstream. The rest will stay with us. |
This patch adds a driver framework to control individual FPGA reset and clock gates. For FPGA devices, only the fabric (FIC0/FIC1/FIC3) clock and reset can be controlled, which affects the whole fabric / domain. This is problematic for obvious reasons. For MSS peripherals, clocks and reset are controlled individually for each peripheral via MSS memory mapped registers (MPFS_SYSREG). To get the same capability for FPGA peripherals, the same controller needs to be fabricated on the FPGA. However, the FPGA clock/reset controller is entirely user dependent, so a generic implementation is not possible. However, a generic driver is needed in order to build the current FPGA peripheral drivers. A stub implementation of the driver is provided in order to achieve this. # Conflicts: # arch/risc-v/src/mpfs/Make.defs # arch/risc-v/src/mpfs/mpfs_corepwm.c # arch/risc-v/src/mpfs/mpfs_i2c.c
…ller This adds peripheral reset support for the FPGA peripherals we have. Note: This is NOT for upstream
2d2b224
to
3a70748
Compare
This driver can control resets for: - CAN - UART - SPI - I2C - PWM Others can be added as needed.
3a70748
to
4dd5cb2
Compare
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.
LGTM!
I'll do the upstream part first. |
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.
Looks good
Needs FPGA + bootloader update