Skip to content

Conversation

@danieldegrasse
Copy link
Contributor

The NXP Kinetis series uses the PORT peripheral for pin control. At the time the driver was introduced, this IP was only used on the Kinetis series in tree. However, it is now used on NXP S32, MCX, and Kinetis series SOCs. Rename the pin control driver compatible and files to use the naming scheme nxp_port, which better reflects the name of the IP in the reference manual.

This PR also consolidates the header files used for pin control with this driver, by checking if PCR_XXX bitfields are defined as a method of determining which pin configuration features a given PORT IP instantiation supports.

@zephyrbot
Copy link

zephyrbot commented Nov 19, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_nxp zephyrproject-rtos/hal_nxp@3c64cd6 zephyrproject-rtos/hal_nxp@cae4002 zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@danieldegrasse
Copy link
Contributor Author

@hakehuang I believe we should run some basic hardware tests on this PR, covering all Kinetis and MCX targets (as well as S32, if possible). We likely just need to verify hello world builds and runs to make sure that the pin control driver is functioning as expected on these parts.

@danieldegrasse danieldegrasse force-pushed the feature/nxp-port-pinctrl branch from b37f03f to be7caee Compare November 19, 2024 20:20
decsny
decsny previously approved these changes Nov 19, 2024
manuargue
manuargue previously approved these changes Nov 20, 2024
Copy link
Member

@manuargue manuargue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@hakehuang
Copy link
Contributor

hakehuang commented Nov 20, 2024

believe we should run some basic hardware tests on this PR, covering all Kinetis and MCX targets (as well as S32, if possible). We likely just need to verify hello world builds and runs to make sure that the pin control driver is functioning as expected on these parts.

@danieldegrasse I do not have s32 paltform sin my test range, all BLEP platform test are kicked. all test pass, and tseted platforms are as below.

<style> </style>
Top 50 values of platform.keyword Top 3 values of release.keyword count(kql='result: passed')
frdm_k64f/mk64f12 v4.0.0-448-gbe7caeedabe0 1
frdm_k82f/mk82f25615 v4.0.0-448-gbe7caeedabe0 1
frdm_ke17z/mke17z7 v4.0.0-448-gbe7caeedabe0 1
frdm_ke17z512/mke17z9 v4.0.0-448-gbe7caeedabe0 1
frdm_kl25z/mkl25z4 v4.0.0-448-gbe7caeedabe0 1
frdm_kw41z/mkw41z4 v4.0.0-448-gbe7caeedabe0 1
frdm_mcxc242/mcxc242 v4.0.0-448-gbe7caeedabe0 1
frdm_mcxc444/mcxc444 v4.0.0-448-gbe7caeedabe0 1
frdm_mcxn236/mcxn236 v4.0.0-448-gbe7caeedabe0 1
frdm_mcxn947/mcxn947/cpu0 v4.0.0-448-gbe7caeedabe0 1
frdm_mcxw71/mcxw716c v4.0.0-448-gbe7caeedabe0 1
frdm_rw612/rw612 v4.0.0-448-gbe7caeedabe0 1
lpcxpresso11u68/lpc11u68 v4.0.0-448-gbe7caeedabe0 1
lpcxpresso55s06/lpc55s06 v4.0.0-448-gbe7caeedabe0 1
lpcxpresso55s28/lpc55s28 v4.0.0-448-gbe7caeedabe0 1
lpcxpresso55s36/lpc55s36 v4.0.0-448-gbe7caeedabe0 1
lpcxpresso55s69/lpc55s69/cpu0 v4.0.0-448-gbe7caeedabe0 1
mimxrt1010_evk/mimxrt1011 v4.0.0-448-gbe7caeedabe0 1
mimxrt1015_evk/mimxrt1015 v4.0.0-448-gbe7caeedabe0 1
mimxrt1020_evk/mimxrt1021 v4.0.0-448-gbe7caeedabe0 1
mimxrt1024_evk/mimxrt1024 v4.0.0-448-gbe7caeedabe0 1
mimxrt1040_evk/mimxrt1042 v4.0.0-448-gbe7caeedabe0 1
mimxrt1050_evk@hyperflash/mimxrt1052 v4.0.0-448-gbe7caeedabe0 1
mimxrt1160_evk/mimxrt1166/cm7 v4.0.0-448-gbe7caeedabe0 1
mimxrt1170_evk@A/mimxrt1176/cm7 v4.0.0-448-gbe7caeedabe0 1
mimxrt1180_evk/mimxrt1189/cm33 v4.0.0-448-gbe7caeedabe0 1
mimxrt595_evk/mimxrt595s/cm33 v4.0.0-448-gbe7caeedabe0 1
mimxrt685_evk/mimxrt685s/cm33 v4.0.0-448-gbe7caeedabe0 1
rd_rw612_bga/rw612 v4.0.0-448-gbe7caeedabe0 1
rd_rw612_bga/rw612/ethernet v4.0.0-448-gbe7caeedabe0 1
twr_ke18f/mke18f16 v4.0.0-448-gbe7caeedabe0 1
twr_kv58f220m/mkv58f24 v4.0.0-448-gbe7caeedabe0 1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have it shorter, without "port":

- nxp,pinctrl
- nxp,pinmux
- CONFIG_PINCTRL_NXP

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, the name of the hardware is "port" , and nxp has many different pinmux controllers. Also, the name "pinmux" and "pinctrl" is technically not supposed to be in the binding because it refers to a software subsystem, but it is what it is right now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree here, the shortened version would be nxp,port. Ideally we would use that, but we have this awkward situation where there is a compatible for the pin control node itself as well as for each PORT IP instance, so we have the software pinmux and pinctrl prefixes.

Copy link
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do all modified socs share the same IP? If not, compatibles must be different, and instead, make pinctrl driver support multiple of them.

@decsny
Copy link
Member

decsny commented Nov 20, 2024

do all modified socs share the same IP? If not, compatibles must be different, and instead, make pinctrl driver support multiple of them.

its the same

gmarull
gmarull previously approved these changes Nov 20, 2024
@Raymond0225
Copy link
Contributor

I believe that RT700 also use same IP. Just want to make sure, Is this new definition easily to extend to RT700 SOC?

@decsny
Copy link
Member

decsny commented Nov 21, 2024

I believe that RT700 also use same IP. Just want to make sure, Is this new definition easily to extend to RT700 SOC?

rt700 does not use the same IP, the PR for it is here #81086

west.yml Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the SHA

@danieldegrasse danieldegrasse dismissed stale reviews from gmarull, manuargue, and decsny via 0a053ab November 21, 2024 19:29
@danieldegrasse danieldegrasse force-pushed the feature/nxp-port-pinctrl branch from be7caee to 0a053ab Compare November 21, 2024 19:29
@danieldegrasse
Copy link
Contributor Author

PR has been rebased, and updated to pull SHA from NXP HAL

@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label Nov 21, 2024
decsny
decsny previously approved these changes Nov 21, 2024
@dleach02 dleach02 self-assigned this Nov 22, 2024
@dleach02
Copy link
Member

@gmarull I added myself to the assignee so we can help move this PR to merge. You had already approved it but we lost all the approvals when we updated the manifest with the HAL PR merging. We have some HAL side PRs we are trying to sequence.

The NXP PORT pinmuxing peripheral is reused across the MCX, S32, and
Kinetis lines. Rename the compatible from the family-specific
nxp,kinetis-pinctrl to a more generic nxp,port-pinctrl to reflect the
actual name for the IP block used within reference manuals.

Update the NXP HAL revision to include a change to use the new Kconfig
name for the PORT pinctrl driver

Update the MAINTAINERS.yml path, as there are no longer any NXP drivers
matching the string "drivers/*/*kinetis*

Signed-off-by: Daniel DeGrasse <[email protected]>
NXP PORT IP instantiations often have different features absent, IE
input buffer, open drain, or slew rate support. Check if the relevant
PCR register bitmasks are defined in the common pin control file, and
define the bitmasks to 0x0 (no effect) if they are not. This allows us
to further consolidate the pinctrl_soc.h headers for SOCs using the PORT
IP.

Signed-off-by: Daniel DeGrasse <[email protected]>
Add note about compatible change for NXP PORT IP. Also, update
references to the DT compatible within board docs.

Signed-off-by: Daniel DeGrasse <[email protected]>
@danieldegrasse danieldegrasse force-pushed the feature/nxp-port-pinctrl branch from 889d5e6 to 9ab134d Compare November 22, 2024 17:32
@mmahadevan108 mmahadevan108 merged commit cc8ab68 into zephyrproject-rtos:main Nov 22, 2024
26 checks passed
@mmahadevan108 mmahadevan108 deleted the feature/nxp-port-pinctrl branch November 22, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants