-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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 EOS S3 GPIO driver #28765
Add EOS S3 GPIO driver #28765
Conversation
40fba0d
to
f5734b5
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.
Some initial comments. The architecture of this peripheral is not clear to me.
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
f3abb6e
to
664e718
Compare
While I'm looking at this could somebody please do something about #29283? I have no idea what this board is, and neither will anybody else. |
I'm pulling out my response to #28765 (comment) a direct comment because this is a design-level point:
OK, so that's a little more clear. It looks like this driver is mixing pinmux configuration with GPIO configuration, by giving each of the 8 actual GPIO pins two pin indexes, which encode the pin to use in bit 3 with the true GPIO ordinal in bits 0..2. So you can configure pin 1 and pin 2 and you'd have two GPIOs active, but if you configure pin 1 and pin 9 then you've got one GPIO (GPIO1 on pad 26) working and have quietly broken subsequent use of pin 1 (GPIO1 on pad 9). Do I have that right? If so, this seems way too fragile. Would you expect to have an application switch between pads at runtime? If not then I think the GPIO controller devicetree binding should have a bitset property that indicates for the 8 gpios whether they should be connected to the primary (0) or secondary (1) pad for that GPIO. Then the controller If you do expect to need to move GPIOs between pads right now, we need to figure out another solution, because having two pin ordinals that refer to the same GPIO signal is going to confuse the stuffing out of everybody. |
Link to the TRM just in case: https://www.quicklogic.com/wp-content/uploads/2020/06/QL-S3-Technical-Reference-Manual-Vol-1.pdf#page=154 Generally there are two peripherals in EOS S3 which controls GPIOs:
Yep that's right. Well it seems that it is possible to switch between pads in runtime, but currently we can go with non-runtime version of the driver to keep it simple. Also it is noted in the TRM that the |
664e718
to
13178d4
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.
Turning #28765 (comment) into a real review:
Rework this so the pads associated with the GPIO are determined at build time, rather than encoding a pad selection into the GPIO ordinal.
13178d4
to
da6115e
Compare
I've added pin-cfgs property to EOS S3 devicetree. It is now possible to setup either primary or secondary pin for each GPIO in the build time. @pabigot please take a look |
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.
Let's test the driver with tests/drivers/gpio/gpio_api_1pin/
testcase.
The "Add GPIO support for QuickLogic EOS S3 SoCs." commit relies on |
da6115e
to
624d5f8
Compare
624d5f8
to
9fefc0f
Compare
e479679
to
a3f6822
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.
Thanks, the things I was concerned about have been addressed.
Does this pass the tests in tests/drivers/gpio?
@pabigot I've just checked and there are still some adjustments that have to be done to make GPIO tests pass on hardware. I'll notify here when I'll have them green. |
a3f6822
to
4fa1341
Compare
Add GPIO definitions to QuickLogic EOS S3 devicetree. Co-authored-by: Jan Kowalewski <[email protected]> Signed-off-by: Wojciech Tatarski <[email protected]> Signed-off-by: Jan Kowalewski <[email protected]>
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, though I still have some comments. If you address the comments and let us know that the testcases are passing I will be happy to approve this PR.
4fa1341
to
4c680e9
Compare
4c680e9
to
e6ebe95
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.
I propose to squash all the "boards: arm: quick_feather:" commits into one, or at least the following two
- "boards: quick_feather: enable GPIO driver"
- "boards: arm: quick_feather: add GPIO feature to docs"
Enable GPIO driver for Quick Feather board. Co-authored-by: Jan Kowalewski <[email protected]> Signed-off-by: Wojciech Tatarski <[email protected]> Signed-off-by: Jan Kowalewski <[email protected]>
Add GPIO driver for QuickLogic EOS S3 SoC. Co-authored-by: Jan Kowalewski <[email protected]> Signed-off-by: Wojciech Tatarski <[email protected]> Signed-off-by: Jan Kowalewski <[email protected]>
This commit provides the necessary overlay to make the test pass on the QuickFeather hardware. Signed-off-by: Jan Kowalewski <[email protected]>
e6ebe95
to
bbff0a9
Compare
@mnkp I squashed all the |
This PR introduces the GPIO driver for EOS S3 SoC and enables the driver for the QuickFeather board.
Note: This PR can be merged after hal_quicklogic PR to avoid conflicts between Zephyr API and HAL.