Skip to content
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 various enhancements to genpinctrl script #225

Merged

Conversation

mathieuchopstm
Copy link
Contributor

This PR adds three new features to the genpinctrl script to improve QoL, notably when introducing new series or regenerating pinctrl for new signals:

  • graceful handling of non-Git pin data folders
    • If the pin data folder is not a git repository, script no longer crashes when generating the README file
  • support family filtering for (re)generation
    • In allowlist mode, pinctrl is generated only for specified families
    • In forbidlist mode, pinctrl is generated for all families except those specified
    • N.B.: when filtering is active, unlike in "default" mode, existing pinctrl files are not deleted
  • automatically detect the XML namespace from pin data files
    • Script will now attempt to detect the correct XMLNS from one file of the corpus
      • Files sourced from other places that the GitHub STMicroelectronics GitHub may use a different XML namespace
      • Before this modification, the script had to be manually edited
    • If automatic detection fails, the default https://dummy.com is still used
    • N.B.: the script assumes that all files in the pin data use the same XMLNS (which should always be the case)

This commit adds error checking to the call to `git rev-parse HEAD`,
to ensure genpinctrl does not crash when the pin data folder is not
a Git repository. In such cases, "<unknown commit>" is written to
the pinctrl README file.

Signed-off-by: Mathieu Choplain <[email protected]>
This commit adds a family filtering feature to genpinctrl.
Filtering can be used in two modes:
  * in "inclusive" mode, pinctrl is generated for
    specified families only
  * in "exclusive" mode, pinctrl is generated for
    all but specified families

This is useful when introducing new series.

Signed-off-by: Mathieu Choplain <[email protected]>
This commit modifies the genpinctrl script to detect
the XML namespace of pin data files automatically.

Signed-off-by: Mathieu Choplain <[email protected]>
@erwango
Copy link
Member

erwango commented Sep 2, 2024

Merging despite the <3.9 failing tests, cf python version

@erwango erwango merged commit 63c23f8 into zephyrproject-rtos:main Sep 2, 2024
2 of 4 checks passed
@mathieuchopstm mathieuchopstm deleted the genpinctrl_enhancements branch September 2, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants