-
Notifications
You must be signed in to change notification settings - Fork 166
Add script to generate pin control headers and pin control groups for iMX RT parts #133
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 script to generate pin control headers and pin control groups for iMX RT parts #133
Conversation
06d59b1 to
16a1b91
Compare
|
Just to be sure, the output of this script is what is included in PR #132. Can you please confirm. |
cf61f6b to
ea9138a
Compare
|
@mmahadevan108, yes, and the board dtsi file included in the Zephyr PR is also generated by this script |
0d470fb to
0704704
Compare
f0676c9 to
ebe31e8
Compare
2913bdc to
cda5917
Compare
bd434e1 to
1cbf6e3
Compare
dbd32fb to
f735e2b
Compare
| signal_name = pin.attrib.get('pin_signal') | ||
| signal = signal_map[signal_name] | ||
| if not signal: | ||
| print(f"Warning: Signal name {signal_name} not present in mapping") | ||
| # No way to find mux option | ||
| continue |
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 was hitting a KeyError here for any signals not present in the signal map. I think this should be:
| signal_name = pin.attrib.get('pin_signal') | |
| signal = signal_map[signal_name] | |
| if not signal: | |
| print(f"Warning: Signal name {signal_name} not present in mapping") | |
| # No way to find mux option | |
| continue | |
| signal_name = pin.attrib.get('pin_signal') | |
| if signal_name not in signal_map: | |
| print(f"Warning: Signal name {signal_name} not present in mapping") | |
| # No way to find mux option | |
| continue | |
| signal = signal_map[signal_name] |
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.
Added this change in the latest push. Out of interest, what signal was causing a KeyError? Some signals require no configuration by the pinctrl driver, and so aren't placed in the signal mapping. I want to make sure this is one of those signals and that the pinctrl driver isn't missing the ability to configure some pins.
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.
These are the pins I get warned about:
Warning: Signal name USB_OTG1_VBUS not present in mapping
Warning: Signal name USB_OTG1_DP not present in mapping
Warning: Signal name USB_OTG1_DN not present in mapping
Warning: Signal name USB_OTG1_CHD_B not present in mapping
Warning: Signal name XTALI not present in mapping
Warning: Signal name XTALO not present in mapping
Warning: Signal name DCDC_GND0 not present in mapping
Warning: Signal name DCDC_GND1 not present in mapping
Warning: Signal name DCDC_IN0 not present in mapping
Warning: Signal name DCDC_IN1 not present in mapping
Warning: Signal name DCDC_IN_Q not present in mapping
Warning: Signal name DCDC_LP0 not present in mapping
Warning: Signal name DCDC_LP1 not present in mapping
Warning: Signal name DCDC_PSWITCH not present in mapping
Warning: Signal name DCDC_SENSE not present in mapping
Warning: Signal name GPANAIO not present in mapping
Warning: Signal name NGND_KEL0 not present in mapping
Warning: Signal name NVCC_EMC0 not present in mapping
Warning: Signal name NVCC_EMC1 not present in mapping
Warning: Signal name NVCC_GPIO0 not present in mapping
Warning: Signal name NVCC_GPIO1 not present in mapping
Warning: Signal name NVCC_GPIO2 not present in mapping
Warning: Signal name NVCC_PLL not present in mapping
Warning: Signal name NVCC_SD0 not present in mapping
Warning: Signal name NVCC_SD1 not present in mapping
Warning: Signal name VDD_HIGH_CAP not present in mapping
Warning: Signal name VDD_HIGH_IN not present in mapping
Warning: Signal name VDD_SNVS_CAP not present in mapping
Warning: Signal name VDD_SNVS_IN not present in mapping
Warning: Signal name VDD_SOC_IN0 not present in mapping
Warning: Signal name VDD_SOC_IN1 not present in mapping
Warning: Signal name VDD_SOC_IN2 not present in mapping
Warning: Signal name VDD_SOC_IN3 not present in mapping
Warning: Signal name VDD_SOC_IN4 not present in mapping
Warning: Signal name VDD_SOC_IN5 not present in mapping
Warning: Signal name VDD_SOC_IN6 not present in mapping
Warning: Signal name VDD_SOC_IN7 not present in mapping
Warning: Signal name VDD_USB_CAP not present in mapping
Warning: Signal name VDD_SOC_IN8 not present in mapping
Warning: Signal name VDDA_ADC_3P3 not present in mapping
Warning: Signal name VSS1 not present in mapping
Warning: Signal name VSS2 not present in mapping
Warning: Signal name VSS3 not present in mapping
Warning: Signal name VSS0 not present in mapping
Warning: Signal name VSS4 not present in mapping
Warning: Signal name VSS5 not present in mapping
Warning: Signal name VSS6 not present in mapping
Warning: Signal name VSS7 not present in mapping
Warning: Signal name VSS8 not present in mapping
Warning: Signal name VSS9 not present in mapping
Warning: Signal name VSS10 not present in mapping
Warning: Signal name VSS11 not present in mapping
Warning: Signal name VSS12 not present in mapping
Warning: Signal name VSS13 not present in mapping
Warning: Signal name VSS14 not present in mapping
Warning: Signal name VSS15 not present in mapping
Warning: Signal name VSS16 not present in mapping
Warning: Signal name VSS17 not present in mapping
Warning: Signal name VSS18 not present in mapping
Warning: Signal name USB_OTG2_DN not present in mapping
Warning: Signal name USB_OTG2_DP not present in mapping
Warning: Signal name USB_OTG2_VBUS not present in mapping
I think these are all voltage/ special function pins that I don't expect to generate pincfg drivers but would appreciate a second set of eyes if you see anything odd here that should be generating a mapping.
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.
Those do all look like special function pins to me. I wouldn't worry about the warnings.
7c84f70 to
f333cdb
Compare
|
@dleach02 This PR should be good to merge now that the pin control PR in Zephyr has gone in. |
f333cdb to
4b565bc
Compare
|
Two other things that I noticed on this PR, for example when trying to generate pinctrl for the RT1060-EVKB.
|
@NickolasLapp this is interesting. That namespace versioning number looks off (I'd expect that value to go up, not down). When I attempt a generation using the default MEX file for the EVKB, I don't have that issue (I've attached the file I used, as a ZIP). I created this file using the new file dialogue in MCUXpresso config tools, then saved the file that was generated by the tool.
This is an issue I've seen, but in the data packs I have downloaded directly from the MCUXpresso SDK generator I haven't seen this structure being used. Parsing these references is be a feature I may add to this script, since following a reference like that is relatively easy to encode. |
4b565bc to
c5530f4
Compare
c3fd3dd to
6a66b36
Compare
Add script to parse iMX RT configuration data, including signal_configuration.xml and MEX files, and output pinctrl SOC level DTSI files as well as pinctrl groups Signed-off-by: Daniel DeGrasse <[email protected]>
… parts Add wrapper script around rt_cfg_utils.py that is able to generate pinctrl soc DTSI files for all packages defined within a processor Signed-off-by: Daniel DeGrasse <[email protected]>
Add wrapper script capable of generating pinctrl groups for iMX RT parts from MEX files, that uses the rt_cfg_utils library Signed-off-by: Daniel DeGrasse <[email protected]>
add script to generate gpio pinmux settings Signed-off-by: Daniel DeGrasse <[email protected]>
RT11xx series signal configuration lacks daisy register settings. Add script to identify these issues and fix them Signed-off-by: Daniel DeGrasse <[email protected]>
6a66b36 to
37593c4
Compare
|
@NickolasLapp I've updated this script to use the v11 configuration files from MCUXpresso config tools. Could you verify that the script still works for you? |
Add initial script to generate pinctrl groups from MEX file for iMX.RT
parts. This script uses the files provided in MCUXpresso config tools offline data
(downloadable from MCUXpresso SDK builder), combined with a MEX configuration file (editable with MCUXpresso config tools),
to automatically generate pinctrl groups for a given board.
Pinctrl groups can be handcoded without the aid of this script, it is only made available to simplify generation of pinctrl groups for NXP boards.