Skip to content

Enabling DMA Support for frdm_mcxw7x #91869

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

EmilioCBen
Copy link
Contributor

Enabling DMA Support for frdm_mcxw7x

Copy link

@EmilioCBen EmilioCBen force-pushed the feature/frdm_mcxw7x_dma branch from 8fb1415 to 22d8690 Compare July 23, 2025 16:08
@zephyrbot zephyrbot requested a review from axelnxp July 23, 2025 16:09
@EmilioCBen EmilioCBen force-pushed the feature/frdm_mcxw7x_dma branch 2 times, most recently from 90c083d to 2cdd5f9 Compare July 28, 2025 14:43
@teburd teburd assigned dleach02 and unassigned teburd Jul 28, 2025
@teburd
Copy link
Contributor

teburd commented Jul 28, 2025

re-assigned to platform owner, no changes to DMA API in PR, all soc, dts, and driver changes from what I can tell.

Add DMA nodes for MCXW7X SOC DTS.
This SOC used TRIGMUX instead of DMAMUX.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Updating the dma_mcux_edma driver to support transfers
that do not use Always-On channels to transfer data yet
expected hardware to continue to move a buffer of data.
E.G. tests/drivers/dma/loop_transfer tests.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Enable EDMAv3 for the frdm_mcxw71 and frdm_mcxw72
platforms.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
@EmilioCBen EmilioCBen force-pushed the feature/frdm_mcxw7x_dma branch from 2cdd5f9 to fbe2d4c Compare July 28, 2025 16:28
Copy link

Comment on lines +147 to +148
dmas = <&edma 0 32>, <&edma 1 31>;
dma-names = "tx", "rx";
Copy link
Member

Choose a reason for hiding this comment

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

was this tested with uart async api test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Testing lpuart_async_api fails, debugging the issue at the moment.

@@ -202,6 +201,14 @@ if(CONFIG_SOC_FAMILY_MCXW OR CONFIG_SOC_MCXN947 OR CONFIG_SOC_MCXN547)
set_variable_ifdef(CONFIG_SOC_FLASH_MCUX CONFIG_MCUX_COMPONENT_driver.flash_k4)
endif()

if(CONFIG_SOC_FAMILY_MCXW OR CONFIG_SOC_MCXN547)
Copy link
Member

Choose a reason for hiding this comment

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

why or mcxn547?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typo, meant MCXN947, will be fixed in the next push.

Comment on lines +269 to +274
if(${MCUX_DEVICE} MATCHES "S32K3")
if(CONFIG_DMA)
zephyr_include_directories(${MCUX_SDK_NG_DIR}/drivers/dmamux)
set(CONFIG_MCUX_COMPONENT_driver.dmamux ON)
endif()
endif()
Copy link
Member

Choose a reason for hiding this comment

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

are you adding for s32 also?

Comment on lines +656 to +658
if (data->transferConfig.majorLoopCounts < 2) {
return -ENOSYS;
}
Copy link
Member

Choose a reason for hiding this comment

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

i dont understand this check and error code, maybe you can put a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A comment will be added on the next push.

@@ -613,6 +621,9 @@ static int dma_mcux_edma_start(const struct device *dev, uint32_t channel)
#endif
data->busy = true;
EDMA_StartTransfer(DEV_EDMA_HANDLE(dev, channel));
#if defined(CONFIG_DMA_MCUX_EDMA_V3)
EDMA_TriggerChannelStart(DEV_BASE(dev), channel);
Copy link
Member

Choose a reason for hiding this comment

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

this API exists on edma v4 and v2 as well, why is it only needed all the sudden for v3 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be fixed on the next update, this should actually be dependent on if the transfer is MemoryToMemory
AON feature on the channel is not enabled.

Comment on lines +397 to +398
config->source_burst_length = block_config->block_size;
config->dest_burst_length = block_config->block_size;
Copy link
Member

Choose a reason for hiding this comment

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

why are you writing to the config struct the user passed in?

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 longer needed, will be updated on the next push.

Comment on lines +391 to +396
#if (defined(FSL_FEATURE_DMAMUX_HAS_A_ON) && FSL_FEATURE_DMAMUX_HAS_A_ON)
data->transfer_settings.source_burst_length = config->source_burst_length;
data->transfer_settings.dest_burst_length = config->dest_burst_length;
#else
data->transfer_settings.source_burst_length = block_config->block_size;
data->transfer_settings.dest_burst_length = block_config->block_size;
Copy link
Member

Choose a reason for hiding this comment

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

commit message needs better explanation for these values or even a comment in the code maybe

Comment on lines +401 to +402
data->transfer_settings.source_data_size = config->source_data_size;
data->transfer_settings.dest_data_size = config->dest_data_size;
Copy link
Member

Choose a reason for hiding this comment

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

ditto commit message needs better explanation for these values or even a comment in the code maybe

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 platform: NXP Drivers NXP Semiconductors, drivers platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants