Skip to content

Add rt1180 spi/edma support #77458

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

Merged
merged 6 commits into from
Jan 13, 2025

Conversation

lucien-nxp
Copy link
Contributor

@lucien-nxp lucien-nxp commented Aug 23, 2024

  1. Add lpspi and edma instances on RT1180
  2. Update edma driver to adapt EDMA4
  3. Port lpspi_loopback case on RT1180, need wired connection shown below:
    /* To test this sample, connect J44.8 <-> J44.10 */
  4. Fix uart case build issue, add overlay files for cm33/cm7 cores

teburd
teburd previously approved these changes Aug 23, 2024
@@ -651,10 +651,39 @@ static int dma_mcux_edma_init(const struct device *dev)
irq_enable(DT_INST_IRQ_BY_IDX(n, idx, irq)); \
}

#define DMA_CHANNLES_SHARED_IRQ_MASK(i, n) \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you be a little more specific?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think CHANNLES should be CHANNELS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thank you, I will correct it later.

Copy link
Member

Choose a reason for hiding this comment

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

Does the build give an error on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, build error is caused by dma_mcux_edma_error_irq_handler function defined but not used. However, IRQ_CONNECT function will include the function into interrupt function. I don't know how to resolve the building warning issue, and it seems a legacy issue. (There is standalone error IRQ on RT1180 edma.)

Copy link
Member

@bperseghetti bperseghetti left a comment

Choose a reason for hiding this comment

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

Currently edma is not properly supported with NXP's LPSPI in Zephyr since the hardware chip select is not currently working in the LPSPI driver.

@teburd teburd dismissed their stale review August 23, 2024 14:55

Seems I was a bit eager, will wait for the reviews to shake out from people with this hardware on hand

@lucien-nxp
Copy link
Contributor Author

Currently edma is not properly supported with NXP's LPSPI in Zephyr since the hardware chip select is not currently working in the LPSPI driver.

However, I enabled the lpspi_loopback case with edma and tested passed on my local. @dleach02 @danieldegrasse @decsny ,do you have any comment on lpspi_edma issue?
By the way, it seems the test building result is a problem left over by history.
Building Error

bperseghetti
bperseghetti previously approved these changes Aug 23, 2024
@bperseghetti
Copy link
Member

Currently edma is not properly supported with NXP's LPSPI in Zephyr since the hardware chip select is not currently working in the LPSPI driver.

However, I enabled the lpspi_loopback case with edma and tested passed on my local. @dleach02 @danieldegrasse @decsny ,do you have any comment on lpspi_edma issue? By the way, it seems the test building result is a problem left over by history. Building Error

I think it would be good to consider using a test other than loopback for testing DMA with LPSPI that also tests HW CS.
I believe that this EVK has mikrobus and could use the in tree sensor streaming API with the ICM42688 using https://www.mikroe.com/6dof-imu-14-click?srsltid=AfmBOop3WDHNqW-m4sLp4pcR6l5OtbKUhniA-__iqOI2SMP6_6vGbf1D

Linking these here for tracking purposes:

decsny
decsny previously approved these changes Aug 23, 2024
@lucien-nxp lucien-nxp force-pushed the add_rt1180_spi_support branch from 11c9e70 to 839a9cf Compare December 4, 2024 06:09
@lucien-nxp
Copy link
Contributor Author

Only rebase to the newest commit and resolve the conflicts.

@lucien-nxp lucien-nxp force-pushed the add_rt1180_spi_support branch from 839a9cf to 1f56a00 Compare December 4, 2024 08:17
@lucien-nxp
Copy link
Contributor Author

Update lpspi blinding from "nxp,imx-lpspi" to "nxp,lpspi"

danieldegrasse
danieldegrasse previously approved these changes Dec 4, 2024
@lucien-nxp
Copy link
Contributor Author

Only rebase to the newest commit and resolve the conflicts.

@lucien-nxp lucien-nxp force-pushed the add_rt1180_spi_support branch from d6ba470 to d0f88e7 Compare December 10, 2024 07:07
@lucien-nxp
Copy link
Contributor Author

Rebase to #82761, resolve the tpm building issues.

@lucien-nxp lucien-nxp force-pushed the add_rt1180_spi_support branch from d0f88e7 to c315945 Compare December 11, 2024 07:34
@hakehuang
Copy link
Collaborator

@PerMac the bsim CI failure is from latest main line code, see
#82835

Multi channels share one IRQ, add channels-shared-irq-mask on RT1180
attribution to describe the channel shared status, and add code
implementation to register the handler function for each channel
in different interrupts.

Fix legacy building warning issue

Signed-off-by: Lucien Zhao <[email protected]>
add lpspi clock enablement code

DMA3/4 access different domain is controlled by TRDC, release all
the domain access permission for DMA3/4, and add privilege and secure
information in dma access request signal by DAC module

Signed-off-by: Lucien Zhao <[email protected]>
add lpspi and edma instances for RT118X
Find mpu description missed for RT1180X, add mpu in dts
add dmas controller setting for lpspi instances

Signed-off-by: Lucien Zhao <[email protected]>
On RT1180, two lpspis share the same clock root,
support lpspi in clock driver for RT118x

Signed-off-by: Lucien Zhao <[email protected]>
Add pinctrl and dma channel/mux information for lpspi3 on cm33/cm7 cores.
Set dma4 status is OK.
Add pinctrl for lpuart3

tests: driver: spi: support spi_loopback case on MIMXRT1180_EVK
Add .config/.overlay files for cm33/cm7 cores
Link to ocram1 as RAM region on cm7 core
Link to dtcm as RAM region on cm33 core

Signed-off-by: Lucien Zhao <[email protected]>
Due to cm7 on RT1180 is secondary core, and dtcm have been used
as sram directly, so there is no need to define zephyr,dtcm node.

Signed-off-by: Lucien Zhao <[email protected]>
@lucien-nxp lucien-nxp force-pushed the add_rt1180_spi_support branch from c92775b to 94e34f2 Compare December 18, 2024 08:36
@lucien-nxp
Copy link
Contributor Author

Only rebase the main branch newest commit and resolve the conflicts.

@lucien-nxp
Copy link
Contributor Author

Anyone can help to merge the PR?

@decsny
Copy link
Member

decsny commented Jan 8, 2025

need assignee approval

@lucien-nxp
Copy link
Contributor Author

@tbursztyka , could you help approve and merge the PR?

@kartben kartben merged commit f039ad5 into zephyrproject-rtos:main Jan 13, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Clock Control area: DMA Direct Memory Access area: SPI SPI bus area: UART Universal Asynchronous Receiver-Transmitter platform: NXP Drivers NXP Semiconductors, drivers platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.