Skip to content

rw612: Fix SCTIMER offset overflow in pinctrl definitions - #633

Open
dragomirecky wants to merge 1 commit into
zephyrproject-rtos:masterfrom
dragomirecky:ad/fix/incorrect-offsets
Open

dragomirecky wants to merge 1 commit into
zephyrproject-rtos:masterfrom
dragomirecky:ad/fix/incorrect-offsets

Conversation

@dragomirecky

Copy link
Copy Markdown

This PR is not really meant to be merged, as the edited file starts with a note that it was generated by "parse_iomux.py". I couldn't find it anywhere. I would have created just an Issue, but this repo doesn't have them enabled.

The problem: SCTIMER_IN/OUT_CLR offset fields are using only 3 bits (max value 7), but some GPIO pins require
SCTIMER offsets 8 and 9, causing truncation and incorrect pin configuration.

To fix this, one extra bit needs to be allocated for the offset fields (as in this PR). Similar change needs to be done in Zephyr's soc/nxp/rw/pinctrl_defs.h.

Feel free to tell me if there is a way I can contribute those changes properly.

The SCTIMER_IN/OUT_CLR offset fields were using only 3 bits (max value 7),
but some GPIO pins require SCTIMER offsets 8 and 9, causing truncation
and incorrect pin configuration.
@mmahadevan108

Copy link
Copy Markdown
Collaborator

Seems related to zephyrproject-rtos/zephyr#99007

#define IOMUX_CTIMER_CLR(offset, enable)\
IOMUX_OFFSET_ENABLE(offset, enable, 8)
#define IOMUX_FSEL_CLR(mask) ((mask) << 13)
IOMUX_OFFSET_ENABLE(offset, enable, 10)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Any reason you went to 10 instead of 9

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