-
Notifications
You must be signed in to change notification settings - Fork 18
pinctrl: introduce pin configuration autogenerator #2
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
Conversation
nandojve
left a comment
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.
Need clarify better documentation. It is not clear how user will pick model AFIO vs AF.
Need review package, see comment at docs.
|
Can you rebase and send an update? |
db111cc to
73b34d3
Compare
|
Changed "package" to "pincount" to make naming more clear |
nandojve
left a comment
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
Very nice @gmarull !
4c0e7fe to
dd0be15
Compare
Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add common AFIO utilities, e.g. config bit field and helper macros. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add details on the format of the pin configuration files. Signed-off-by: Gerard Marull-Paretas <[email protected]>
dd0be15 to
52e07d2
Compare
|
@cameled reviews welcome |
|
|
||
| - `model` (required): Choose between `afio` or `af` | ||
| - `series` (required): Series name, e.g. gd32vf103 | ||
| - `variants` (required): Each variant has a different set of valid pin |
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.
From GD32 MCU Selection Guide, GD32F405/407 BGA100 and LQPF100 package both have 82 IO pins. But actually, the BGA100 doesn't have the PD8 pin. It can be check at datasheet 2.3, 2.6 section. GD32F403 doesn't have this issue.
I think it's a GigaDevice mistake, they told GD32F405/407 BGA100 have 82 IO too, but actually is 81.
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.
We can probably document that in the config file with a comment (or allow inserting comments from the config file to the generated headers). Let's do that when we introduce F405/407
cameled
left a comment
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, great work!
cameled
left a comment
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.
Since I'm not familiar with pinctrl related area, just add some comment.
The gd32pinctrl script autogenerates valid pinctrl definitions from a configuration file. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Test that generated content matches reference files. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add development requirements, including flake8 config file. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add readme with some usage details (dependencies, tests, etc.) Signed-off-by: Gerard Marull-Paretas <[email protected]>
Signed-off-by: Gerard Marull-Paretas <[email protected]>
Allow DT to access `include/dt-bindings/...`. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add pin configurations for the GD32VF103XX series. Information has been taken from datasheet/reference manual. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add definitions for remap options. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Files autogenerated using gd32pinctrl script. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add pin configurations for the GD32F450XX series. Information has been taken from datasheet. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Files autogenerated using gd32pinctrl script. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add pin configurations for the GD32F403XX SoCs. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add remap definitions for GD32F403XX SoCs. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Files autogenerated using the gd32pinctrl.py script. Signed-off-by: Gerard Marull-Paretas <[email protected]>
52e07d2 to
e2891b4
Compare
|
Hi @gmarull , I was wondering what is pending since we still have a DNM Label. |
This PR adds support for autogenerating valid pin configurations for GD32 devices based on a set of configuration files build from datasheets/reference manuals. The script supports both, devices using the remap model, e.g. GD32F103 and devices using the alternate function model, e.g. GD32F450.
The autogenerated definitions contain the following information:
Remap/AFIO model:
AF model:
The definitions can be used later in a pinctrl driver like this:
Considerations: