- Notifications
You must be signed in to change notification settings - Fork 8.1k
add I2S and EDMA support for IMX9 platform #97777
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
yananyang-nxp wants to merge 14 commits into zephyrproject-rtos:main Choose a base branch from nxp-upstream:imx9_i2s_edma
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
+277 −53
Open
Changes from all commits
Commits
Show all changes
14 commits Select commit Hold shift + click to select a range
30b324c
west.yml: update hal_nxp to enable i.MX91 EDMA
yananyang-nxp 56b3b95
drivers: dma: dma_mcux_edma: enable MMIO mapping
yananyang-nxp e6a6bbe
drivers: mcux_ccm_rev2: add SAI clock support for i.MX9 platform
yananyang-nxp 6f6fec3
drivers: mcux_ccm_rev2: fix code format
Zhiqiang-Hou 6abdcc3
drivers: i2s: mcux_sai: correct DMA burst length
Zhiqiang-Hou 43556a5
drivers: i2s: i2s_mcux_sai: use device model MMIO mapping
yananyang-nxp 30cbb25
drivers: i2s: mcux_sai: fix the type of var num_of_bufs
Zhiqiang-Hou e37c878
drivers: i2s: mcux_sai: set the Bit Clock Swap on the feature enabled
Zhiqiang-Hou cb46047
drivers: i2s: i2s_mcux_sai: add i.MX9 platform support
Zhiqiang-Hou 79096cd
dts: arm64: imx93: add sai3_2 and edma4_2 node for i2s_mcux_sai driver
yananyang-nxp f829f03
boards: imx93_evk: add sai3_2 and edma4_2 node for i2s_mcux_sai driver
yananyang-nxp 96d7a17
boards: frdm_imx93: add sai3_2 and edma4_2 node for i2s_mcux_sai driver
yananyang-nxp be32ffc
dts: arm64: imx9131: add sai3_2 and edma4_2 node for i2s_mcux_sai driver
yananyang-nxp bac888f
boards: frdm_imx91: add sai3_2 and edma4_2 node for i2s_mcux_sai driver
yananyang-nxp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2020-2024 NXP | ||
* Copyright 2020-2025 NXP | ||
* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please explain in the commit message why this entire change is needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No functionality change, just updated to use the device model MMIO APIs. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
| @@ -47,7 +47,7 @@ typedef DMA_Type DMAx_Type; | |
#endif | ||
| ||
struct dma_mcux_edma_config { | ||
DMAx_Type *base; | ||
DEVICE_MMIO_NAMED_ROM(edma_mmio); | ||
#if defined(FSL_FEATURE_SOC_DMAMUX_COUNT) && FSL_FEATURE_SOC_DMAMUX_COUNT | ||
DMAMUX_Type **dmamux_base; | ||
#endif | ||
| @@ -91,6 +91,7 @@ struct call_back { | |
}; | ||
| ||
struct dma_mcux_edma_data { | ||
DEVICE_MMIO_NAMED_RAM(edma_mmio); | ||
struct dma_context dma_ctx; | ||
struct call_back *data_cb; | ||
atomic_t *channels_atomic; | ||
| @@ -99,7 +100,7 @@ struct dma_mcux_edma_data { | |
#define DEV_CFG(dev) \ | ||
((const struct dma_mcux_edma_config *const)dev->config) | ||
#define DEV_DATA(dev) ((struct dma_mcux_edma_data *)dev->data) | ||
#define DEV_BASE(dev) ((DMAx_Type *)DEV_CFG(dev)->base) | ||
#define DEV_BASE(dev) ((DMAx_Type *)DEVICE_MMIO_NAMED_GET(dev, edma_mmio)) | ||
| ||
#define DEV_CHANNEL_DATA(dev, ch) \ | ||
((struct call_back *)(&(DEV_DATA(dev)->data_cb[ch]))) | ||
| @@ -1013,6 +1014,8 @@ static int dma_mcux_edma_init(const struct device *dev) | |
| ||
LOG_DBG("INIT NXP EDMA"); | ||
| ||
DEVICE_MMIO_NAMED_MAP(dev, edma_mmio, K_MEM_CACHE_NONE | K_MEM_DIRECT_MAP); | ||
| ||
#if defined(FSL_FEATURE_SOC_DMAMUX_COUNT) && FSL_FEATURE_SOC_DMAMUX_COUNT | ||
uint8_t i; | ||
| ||
| @@ -1156,7 +1159,7 @@ static int dma_mcux_edma_init(const struct device *dev) | |
static __aligned(DMA_TCD_ALIGN_SIZE) EDMA_TCDPOOL_CACHE_ATTR edma_tcd_t \ | ||
dma_tcdpool##n[DT_INST_PROP(n, dma_channels)][CONFIG_DMA_TCD_QUEUE_SIZE];\ | ||
static const struct dma_mcux_edma_config dma_config_##n = { \ | ||
.base = (DMAx_Type *)DT_INST_REG_ADDR(n),\ | ||
DEVICE_MMIO_NAMED_ROM_INIT(edma_mmio, DT_DRV_INST(n)),\ | ||
DMAMUX_BASE_INIT(n) \ | ||
.dma_requests = DT_INST_PROP(n, dma_requests), \ | ||
.dma_channels = DT_INST_PROP(n, dma_channels), \ | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't mix code cleanups with new feature. Create a separate patch for cleanups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the updated PR. Thanks!