Skip to content

NXP: Enable eDMA on KE1xF SoC series #26813

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 5 commits into from
Jul 21, 2020

Conversation

henrikbrixandersen
Copy link
Member

This series of commits enables eDMA on the NXP KE1xF SoC series and on the NXP TWR-KE18F development board.

@henrikbrixandersen
Copy link
Member Author

I am putting this PR in draft mode for now due to #26812 also affecting the KE1xF.

@henrikbrixandersen henrikbrixandersen changed the title NXP: Enable eDMA KE1xF SoC series NXP: Enable eDMA on KE1xF SoC series Jul 11, 2020
Copy link
Collaborator

@hakehuang hakehuang left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -6,7 +6,7 @@
config DMA_MCUX_EDMA
bool "Enable MCUX DMA driver"
depends on HAS_MCUX_EDMA
select NOCACHE_MEMORY if HAS_MCUX_CACHE
imply NOCACHE_MEMORY if HAS_MCUX_CACHE
Copy link
Collaborator

Choose a reason for hiding this comment

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

the NOCACHE_MEMORY better not be disablable by users, in RT series without this, user need control the cache by them self, do you sure you want this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Problem here is, that the Kinetis KE1xF series has CONFIG_HAS_MCUX_CACHE=y but CONFIG_ARCH_HAS_NOCACHE_MEMORY_SUPPORT=n, so the dependency would not be fulfilled by the select statement.

The imply statement is like select except that it honours dependencies. Thus for SoCs with CONFIG_HAS_MCUX_CACHE=y that fulfils the dependencies for CONFIG_NOCACHE_MEMORY=y the result will be the same as with the select statement.

@hakehuang
Copy link
Collaborator

hakehuang commented Jul 14, 2020

log for two dma cases on ke18

`

------------------------- Target.main.com118 -------------------------
*** Booting Zephyr OS build zephyr-v2.3.0-997-g835113ee984a ***
Running test suite dma_m2m_test

START - test_dma_m2m_chan0_burst8
Preparing DMA Controller: Chan_ID=0, BURST_LEN=1
Starting the transfer
DMA transfer done
It is harder to be kind than to be wise........
PASS - test_dma_m2m_chan0_burst8

START - test_dma_m2m_chan1_burst8
Preparing DMA Controller: Chan_ID=1, BURST_LEN=1
Starting the transfer
DMA transfer done
It is harder to be kind than to be wise........
PASS - test_dma_m2m_chan1_burst8

START - test_dma_m2m_chan0_burst16
Preparing DMA Controller: Chan_ID=0, BURST_LEN=2
Starting the transfer
DMA transfer done
It is harder to be kind than to be wise........
PASS - test_dma_m2m_chan0_burst16

START - test_dma_m2m_chan1_burst16
Preparing DMA Controller: Chan_ID=1, BURST_LEN=2
Starting the transfer
DMA transfer done
It is harder to be kind than to be wise........
PASS - test_dma_m2m_chan1_burst16

Test suite dma_m2m_test succeeded

PROJECT EXECUTION SUCCESSFUL

`

and if apply the fix from hakehuang/zephyr@f805872 loop_test can pass

`

*** Booting Zephyr OS build zephyr-v2.3.0-997-g835113ee984a ***
DMA memory to memory transfer started on DMA_0
Preparing DMA Controller
Starting the transfer and waiting for 1 second
TX data: The quick brown fox jumps over the lazy dog ....
block_size 48
Each RX buffer should contain the full TX buffer string.
TX data: The quick brown fox jumps over the lazy dog ....
RX data Loop 0: The quick brown fox jumps over the lazy dog ....
RX data Loop 1: The quick brown fox jumps over the lazy dog ....
RX data Loop 2: The quick brown fox jumps over the lazy dog ....
RX data Loop 3: The quick brown fox jumps over the lazy dog ....
RX data Loop 4: The quick brown fox jumps over the lazy dog ....
Finished: DMA

`

@henrikbrixandersen henrikbrixandersen marked this pull request as ready for review July 19, 2020 08:16
@henrikbrixandersen
Copy link
Member Author

Moved out of draft since @hakehuang has found the cause for the DMA test failure reported in #26812. It is not related to the eDMA support on the KE1xF.

Copy link
Member

@MaureenHelm MaureenHelm left a comment

Choose a reason for hiding this comment

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

Can you also add dma to the supported list in boards/arm/twr_ke18f/twr_ke18f.yaml?

Only enable CONFIG_NOCACHE_MEMORY if supported by the SoC.

Signed-off-by: Henrik Brix Andersen <[email protected]>
Add support for the NXP KE1xF SoC to the eDMA driver. The KE1xF supports
m2m DMA transfers from sources 60 to 63.

Signed-off-by: Henrik Brix Andersen <[email protected]>
Add eDMA devicetree node to the NXP KE1xF SoC devicetree.

Signed-off-by: Henrik Brix Andersen <[email protected]>
Enable eDMA support.

Signed-off-by: Henrik Brix Andersen <[email protected]>
Enable eDMA on the NXP TWR-KE18F development board.

Signed-off-by: Henrik Brix Andersen <[email protected]>
@henrikbrixandersen
Copy link
Member Author

Can you also add dma to the supported list in boards/arm/twr_ke18f/twr_ke18f.yaml?

@MaureenHelm Thanks, added.

@MaureenHelm MaureenHelm merged commit 80c2a75 into zephyrproject-rtos:master Jul 21, 2020
@henrikbrixandersen henrikbrixandersen deleted the ke1xf_edma branch August 17, 2020 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants