Skip to content

dma: enable edma drivers for mcux#23689

Merged
MaureenHelm merged 6 commits intozephyrproject-rtos:masterfrom
hakehuang:dma
Jun 12, 2020
Merged

dma: enable edma drivers for mcux#23689
MaureenHelm merged 6 commits intozephyrproject-rtos:masterfrom
hakehuang:dma

Conversation

@hakehuang
Copy link
Copy Markdown
Contributor

@hakehuang hakehuang commented Mar 23, 2020

edma rt series support. tested on mimxrt1060_evt/frdmk64f
MEMORY_NOCACHE is needed for rt
test slot need special set for kinetis

Signed-off-by: Hake Huang hake.huang@oss.nxp.com

Depends on zephyrproject-rtos/hal_nxp#35

@zephyrbot zephyrbot added area: Devicetree area: Boards area: API Changes to public APIs area: Tests Issues related to a particular existing or missing test labels Apr 7, 2020
@zephyrbot
Copy link
Copy Markdown

zephyrbot commented Apr 7, 2020

All checks are passing now.

checkpatch (informational only, not a failure)

-:890: WARNING:DT_SPLIT_BINDING_PATCH: DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.txt

-:914: WARNING:DT_SPLIT_BINDING_PATCH: DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.txt

-:1057: WARNING:PREFER_SECTION: __section(.nocache) is preferred over __attribute__((section(".nocache")))
#1057: FILE: tests/drivers/dma/chan_blen_transfer/src/test_dma.c:31:
+	__attribute__((__section__(".nocache")));

-:1060: WARNING:PREFER_SECTION: __section(.nocache.dma) is preferred over __attribute__((section(".nocache.dma")))
#1060: FILE: tests/drivers/dma/chan_blen_transfer/src/test_dma.c:34:
+	__attribute__((__section__(".nocache.dma")));

-:1125: WARNING:PREFER_SECTION: __section(.nocache) is preferred over __attribute__((section(".nocache")))
#1125: FILE: tests/drivers/dma/loop_transfer/src/dma.c:25:
+	__attribute__((__section__(".nocache")));

-:1127: WARNING:PREFER_SECTION: __section(.nocache.dma) is preferred over __attribute__((section(".nocache.dma")))
#1127: FILE: tests/drivers/dma/loop_transfer/src/dma.c:27:
+	__attribute__((__section__(".nocache.dma")));

- total: 0 errors, 6 warnings, 1053 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: AVOID_EXTERNS BRACES CONFIG_EXPERIMENTAL CONST_STRUCT DATE_TIME FILE_PATH_CHANGES MINMAX NETWORKING_BLOCK_COMMENT_STYLE PRINTK_WITHOUT_KERN_LEVEL SPDX_LICENSE_TAG SPLIT_STRING VOLATILE

NOTE: If any of the errors are false positives, please report
      them to the maintainers.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

@hakehuang hakehuang force-pushed the dma branch 9 times, most recently from 6a9f8fe to 5788b73 Compare April 10, 2020 05:43
@hakehuang hakehuang force-pushed the dma branch 2 times, most recently from a4aed9b to bd4e7da Compare April 12, 2020 13:26
@MaureenHelm MaureenHelm added the DNM This PR should not be merged (Do Not Merge) label Apr 13, 2020
@MaureenHelm MaureenHelm requested a review from jfischer-no April 13, 2020 18:07
@hakehuang hakehuang force-pushed the dma branch 2 times, most recently from 6e628ac to d948610 Compare April 16, 2020 16:47
Copy link
Copy Markdown
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

I'm fine with current change, but it would have been nice that others can use DMA_MCUX_TEST_SLOT_START. This can be changed in upcoming change.

@hakehuang hakehuang force-pushed the dma branch 4 times, most recently from 09fbf0c to a70c11f Compare May 11, 2020 08:31
@carlescufi
Copy link
Copy Markdown
Member

API meeting:

No objections to the changes in the DMA config structure, except for additional comments.

@hakehuang hakehuang force-pushed the dma branch 2 times, most recently from cbf2c70 to 90ad283 Compare May 13, 2020 02:53
@hakehuang hakehuang requested a review from MaureenHelm May 14, 2020 05:01
@MaureenHelm
Copy link
Copy Markdown
Member

tests/drivers/dma/loop_transfer doesn't seem to work at runtime:

On frdm_k64f:

*** Booting Zephyr OS build v2.3.0-rc1-6-g90ad28307ca0  ***
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 43
I: channel 0 error status is 0x2
ERROR: unfinished transfer
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 jups
RX data Loop 2: 
RX data Loop 3: 
RX data Loop 4: 
Finished: DMA

On mimxrt1064_evk:

*** Booting Zephyr OS build v2.3.0-rc1-6-g90ad28307ca0  ***
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 43
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 dogpqt
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 dogp
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

@hakehuang
Copy link
Copy Markdown
Contributor Author

hakehuang commented May 15, 2020

@MaureenHelm , Thanks for this checking. I see problem in FRDM_K64F, I will debug this. for RT1064 problem, it is because the received buffer size is more than the data transferred, and some random data is print out, let me fix it as well.

the frdmk64f problem seems we can not call the strlen in irq call back, if I replace it to sizeof, or a fix value, this problem gone. some analysis foundings: we'd better not access the tx/rx memory then we start to use it as dma in dma ira handler, strlen(tx) will try to access tx memory, this would cause problem, in dma finish irq.

and for frdmk64f the src size shall be times of 8 bytes, according to the reference manual, so I add padding.

log for frdmk64f

Booting Zephyr OS build zephyr-v2.2.0-2822-g91ac7bd2bfb1  ***
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

log for rt1064

*** Booting Zephyr OS build zephyr-v2.2.0-2822-g91ac7bd2bfb1  ***
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 43
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

@hakehuang hakehuang force-pushed the dma branch 2 times, most recently from b76f313 to 2e59a18 Compare May 15, 2020 09:52
@carlescufi carlescufi added this to the v2.4.0 milestone May 26, 2020
for RT series CONFIG_NOCACHE_MEMORY need enabled
for Kinetis series CONFIG_DMA_TEST_SLOT_START for test
modify the target and dest alignment

frdmk64f need replace strlen to sizeof in irq callback
clean the unused receive buffer, so output is tidy

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
1. expand PERIPHERAL_TO_PERIPHERAL
2. add slot size to 128 as i.MX-rt has 127 slot
3. add link_channel member in dma_conf which is used to
   support chain channel

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
add clock rate for RT series from ipg
Kinetis does not need additional clock added

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
add MCUX EDMA support for dts binding

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
tested on mimxrt1060_evt
  MEMORY_NOCACHE is needed
test on frdmk64f
  special test slot need configure with
  CONFIG_DMA_TEST_SLOT_START

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
add dma direction check for dma_sam0

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
@MaureenHelm MaureenHelm merged commit 999c59c into zephyrproject-rtos:master Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Changes to public APIs area: Boards area: Devicetree area: Modules area: Tests Issues related to a particular existing or missing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants