Skip to content

Conversation

@danieldegrasse
Copy link
Contributor

This PR is an alternative approach from #41810 which uses pin groups instead of pin nodes defined at the SOC level. An SOC level header file is still included for readability and so that the user is aware of all pinmux options present on the SOC.

The pin groups approach offers the following benefits:

  • multiple pinctrl nodes can be created with the same pinmux value, enabling pins to have a different states in different power modes without changing their mux settings
  • selecting a pinctrl group in the board level DTS is simpler and less error prone than individually selecting pins for that peripheral

@github-actions
Copy link

github-actions bot commented Jan 27, 2022

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
hal_nxp zephyrproject-rtos/hal_nxp@072bf81 zephyrproject-rtos/hal_nxp@da6c141 (master) zephyrproject-rtos/[email protected]

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

@danieldegrasse danieldegrasse changed the title Add pinctrl implementation for RT1062 Alternative pin group based pinctrl implementation for RT1062 Jan 27, 2022
hakehuang
hakehuang previously approved these changes Jan 28, 2022
@zephyrbot zephyrbot added area: Build System area: UART Universal Asynchronous Receiver-Transmitter labels Feb 1, 2022
@zephyrbot zephyrbot requested review from anangl and dcpleung February 1, 2022 13:12
hakehuang
hakehuang previously approved these changes Mar 7, 2022
tejlmand
tejlmand previously approved these changes Mar 7, 2022
Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

lgtm - re-approved

gmarull
gmarull previously approved these changes Mar 7, 2022
@carlescufi
Copy link
Member

@dleach02 ping

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

Seeing that you add pinctrl support to the lpuart driver, I tried testing this on the twr_ke18f board (west build -b twr_ke18f samples/hello_world/ -- -DCONFIG_PINCTRL=y), which uses the Kinetis pinctrl driver along with the lpuart driver - but compilation of the lpuart driver is now failing (see #43486).

@danieldegrasse
Copy link
Contributor Author

danieldegrasse commented Mar 8, 2022

Seeing that you add pinctrl support to the lpuart driver, I tried testing this on the twr_ke18f board

@henrikbrixandersen, just to confirm: #43486 fixed pinctrl support on the twr_ke18f, and the lpuart driver now works with pinctrl, correct? Just want to verify that there is not an issue with this PR, and that the bug was in the Kinetis pinctrl implementation

@danieldegrasse danieldegrasse dismissed stale reviews from gmarull, tejlmand, and hakehuang via e00e356 March 8, 2022 00:27
@hakehuang hakehuang self-requested a review March 8, 2022 03:17
hakehuang
hakehuang previously approved these changes Mar 8, 2022
danieldegrasse and others added 10 commits March 10, 2022 16:12
NXP hal will define constants for pinmux options in RT pinctrl
implementation. Update hal revision to pull in dtsi file.

Signed-off-by: Daniel DeGrasse <[email protected]>
Add dts binding for rt1xxx pinctrl driver settings. A binding file is
present for the pinctrl node itself, and for the pinctrl child node that
defines all pinmux options

Signed-off-by: Hake Huang <[email protected]>
Signed-off-by: Daniel DeGrasse <[email protected]>
enable pinctrl in i2s and lpuart driver bindings

Signed-off-by: Hake Huang <[email protected]>
Signed-off-by: Daniel DeGrasse <[email protected]>
Pinctrl requires header file with Z_PINCTRL_STATE_PINS_INIT macro
defined. Add header file for mcux RT pinctrl implementation.
Signed-off-by: Hake Huang <[email protected]>
Signed-off-by: Daniel DeGrasse <[email protected]>
add dtsi settings for rt series
dtsi use gpr to replace pinmux
nxp iomuxc has gpr which has more settings than mux and io settings
current solution is to export gpr separately and access then directly

Signed-off-by: Hake Huang <[email protected]>
Signed-off-by: Daniel DeGrasse <[email protected]>
Add pinctrl driver for rt1xxx

Signed-off-by: Hake Huang <[email protected]>
Signed-off-by: Daniel DeGrasse <[email protected]>
enable pinctrl in lpuart driver, and clean up driver instance definition
macros

Signed-off-by: Hake Huang <[email protected]>
enable i2s pinctrl

Signed-off-by: Hake Huang <[email protected]>
enable pin control for RT1060 EVK.

Signed-off-by: Hake Huang <[email protected]>
Signed-off-by: Daniel DeGrasse <[email protected]>
rename pinmux to gpr
different from pinmux and io settings gpr will do more IO
settings.

Signed-off-by: Hake Huang <[email protected]>
@henrikbrixandersen
Copy link
Member

@henrikbrixandersen, just to confirm: #43486 fixed pinctrl support on the twr_ke18f, and the lpuart driver now works with pinctrl, correct? Just want to verify that there is not an issue with this PR, and that the bug was in the Kinetis pinctrl implementation

@danieldegrasse Sorry, I somehow missed your question. Yes, the problem was in the Kinetis pinctrl implementation and was fixed by #43486.

@dleach02 dleach02 merged commit 084e6df into zephyrproject-rtos:main Mar 15, 2022
@dleach02 dleach02 deleted the pinctrl-pin-groups branch March 15, 2022 15:12
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.

8 participants