Skip to content

Conversation

@ubieda
Copy link
Member

@ubieda ubieda commented Apr 8, 2025

Description

Update the driver to account for variations in the SDK driver
when it uses the instance number instead of the base address.

Changes come from #70866 and #83704 applied to I2C RTIO.

Fixes #88319.

Testing

Built for MCXN947 and tested I2C commands work.

west build -b frdm_mcxn947/mcxn947/cpu0 samples/subsys/shell/shell_module -- -DCONFIG_I2C=y -DCONFIG_I2C_SHELL=y -DCONFIG_I2C_RTIO=y

Output:

uart:~$ i2c scan lpi2c@
  lpi2c@b7800  lpi2c@94800  
uart:~$ i2c scan lpi2c@94800 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:             -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
1 devices found on lpi2c@94800
uart:~$ 

ubieda and others added 3 commits April 8, 2025 14:47
Update the driver to account for variations in the SDK driver
when it uses the instance number instead of the base address.

Applying 49bdcd2 on RTIO-version.

Co-authored-by: Mahesh Mahadevan <[email protected]>
Signed-off-by: Luis Ubieda <[email protected]>
Some NXP SoC's have a FlexComm interface that manages the
interrupts.

Applying 482e39e on RTIO-version.

Authored-by: Mahesh Mahadevan <[email protected]>
Signed-off-by: Luis Ubieda <[email protected]>
The Low Power Flexcomm driver manages the interrupt handling
and provides an API to register interrupt callbacks.
Register the NXP LPI2C interrupt handler.

Applying dca6e64 on RTIO-version.

Authored-by: Mahesh Mahadevan <[email protected]>
Signed-off-by: Luis Ubieda <[email protected]>
@ubieda ubieda added backport v3.7-branch Request backport to the v3.7-branch backport v4.0-branch Backport to the v4.0-branch backport v4.1-branch Request backport to the v4.1-branch and removed backport v3.7-branch Request backport to the v3.7-branch labels Apr 8, 2025
@ubieda ubieda marked this pull request as ready for review April 8, 2025 20:43
@github-actions github-actions bot added area: I2C platform: NXP Drivers NXP Semiconductors, drivers labels Apr 8, 2025
teburd
teburd previously approved these changes Apr 9, 2025
Copy link
Member

@decsny decsny left a comment

Choose a reason for hiding this comment

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

this PR is reverting #83704 , I don't understand the point

@ubieda
Copy link
Member Author

ubieda commented Apr 14, 2025

this PR is reverting #83704 , I don't understand the point

@decsny I'm confused, please ellaborate:

  • The point is that without these changes I2C RTIO does not work for LPI2C (at least on MCXN947) at all.
  • The referenced PR does not modify i2c_mcux_lpi2c_rtio.c. I don't see how this is a revert.
  • If the NACK is about including the changes in the referenced PR. I'm happy to do so.

Please provide feedback so we're on the same page before iterating.

bperseghetti
bperseghetti previously approved these changes Apr 14, 2025
@decsny
Copy link
Member

decsny commented Apr 14, 2025

this PR is reverting #83704 , I don't understand the point

@decsny I'm confused, please ellaborate:

* The point is that without these changes I2C RTIO does not work for LPI2C (at least on MCXN947) at all.

* The referenced PR does not modify `i2c_mcux_lpi2c_rtio.c`. I don't see how this is a revert.

* If the NACK is about including the changes in the referenced PR. I'm happy to do so.

Please provide feedback so we're on the same page before iterating.

I see, I confused them for the same file. In that case please follow the same paradigm as is being done for the other file. (or if you're feeling really ambitious, make some common file to share this, but I don't suggest that for this PR)

Determine if lpflexcomm wrapped lpi2c by instance and connect
irq differently dependending on that to support platforms with
both flexcomm wrapped and unwrapped lpi2c's.

Applying c1286a8 to RTIO version.

Authored-by: Declan Snyder <[email protected]>
Signed-off-by: Luis Ubieda <[email protected]>
@ubieda ubieda dismissed stale reviews from bperseghetti and teburd via b4ee463 April 14, 2025 17:39
@ubieda ubieda requested a review from decsny April 14, 2025 17:39
@ubieda ubieda requested review from bperseghetti and teburd April 14, 2025 18:36
@teburd
Copy link
Contributor

teburd commented Apr 14, 2025

just ran into this myself, thanks for fixing

@kartben kartben merged commit d7ebf67 into zephyrproject-rtos:main Apr 14, 2025
27 checks passed
@ubieda ubieda deleted the fix/i2c-rtio-update-with-flexcomm-changes branch April 14, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: I2C backport v3.7-branch Request backport to the v3.7-branch backport v4.0-branch Backport to the v4.0-branch backport v4.1-branch Request backport to the v4.1-branch platform: NXP Drivers NXP Semiconductors, drivers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i2c_mcux_lpi2c_rtio does not build for MCXN947

5 participants