Hi all,
我当前使用的芯片是imx6sx, 需要用EXT_EVENT_1 触发SDMA进行MEM2MEM复制数据, 有下面几个疑问
1. DMA PAD #1 对应SDMA_EXT_EVENT0 ?
2. dts 文件这样是不是这样写就能够使用 GPIO_IO09 上升沿触发SMDA进行复制数据了
pinctrl_dma_ext_event: dma_ext_event {
fsl,pins = <
MX6SX_PAD_GPIO1_IO09__SDMA_EXT_EVENT_1 0x000010B0
>;
};
gpio-dma {
compatible = "dmatest";
pinctrl-names = "dmaext";
pinctrl-1 = <&pinctrl_dma_ext_event>;
dmas = <&sdma 14 16 0>;
dma-names = "dmatest";
fsl,sdma-event-remap = <0 13 1>;
status = "okay";
};
如果能够提供一份示例最好了。
期待你们的回复。
Thanks!
Solved! Go to Solution.
Hi dddd,
> I'm going to learn the SDMA script and try to write it myself.
As a first step, I recommend reading the following:
You should not expect much (free) support from NXP regarding SDMA.
Eli Billauer provides a free assembler for SDMA scripts, which is nice for the first steps. But for finding bugs in your own scripts you will likely require a debugger for SDMA (also very useful for learning how the existing scripts work). Additionally you may want to reuse existing ROM subroutines for your own scripts. As there is almost no documentation available, this will require reverse engineering...
Before reinventing the wheel, you may consider using my tools:
https://community.nxp.com/t5/i-MX-Processors/SDMA-port-for-GNU-binutils-assembler-linker-debugger/m-...
Don't hesitate to ask if you have further questions.
regards
Christian
Hi,
will try to answer your question. Can you please ask in English (or in German:-)) ?
regards
Christian
Hi ceggers1,
Thank you for helping me, there are a few questions about EXT_EVENT_1 triggering SDMA for MEM2MEM, I'm using imx6sx.
1. DMA PAD #1 is SDMA_EXT_EVENT0 , DMA PAD #2 is SDMA_EXT_EVENT1?
2. I want to use GPIO_IO09 rising edge to trigger SMDA,please check if there is a problem with dts。
pinctrl_dma_ext_event: dma_ext_event {
fsl,pins = <
MX6SX_PAD_GPIO1_IO09__SDMA_EXT_EVENT_1 0x000010B0
>;
};
gpio-dma {
compatible = "dmatest";
pinctrl-names = "dmaext";
pinctrl-1 = <&pinctrl_dma_ext_event>;
dmas = <&sdma 14 16 0>;
dma-names = "dmatest";
fsl,sdma-event-remap = <0 13 1>;
status = "okay";
};
3. Can you provide some examples about sdma EXT_EVENT?
Best Regards!
Hi,
interestingly I had a similar question a few days ago:
https://community.nxp.com/t5/i-MX-Processors/i-MX7D-SDMA-for-mem-to-ext-peripheral-transfers/m-p/117...
It looks like you want to use the SDMA for transferring data between the CPU's RAM (obvious) and an external peripheral (FPGA?) connected on the external memory interface (EMI). On the peripheral side, you want either ...
For the first case, you'll need different SDMA scripts (mcu_2_app/app_2_mcu). Peripheral type 16 (IMX_DMATYPE_MEMORY) uses the ap_2_ap script which copies to an address range (as opposed to a fixed FIFO address).
For the second case, IMX_DMATYPE_MEMORY (16) is correct, but this script doesn't utilize the SDMA event lines at all. It does more or less the same as memcpy(). Or in other words: <&sdma 14 16 X> is not a useful combination.
Can you provide me some more information? What type of external peripheral you would like to interface? Maybe you'll need a custom script for this. In this case, the tools created by me would be interesting for you: https://community.nxp.com/t5/i-MX-Processors/SDMA-port-for-GNU-binutils-assembler-linker-debugger/m-...
For the case you need a custom SDMA script and you don't want to do this on your own, I can help you with this task.
regards
Christian
Hi ceggers1,
Thank you for telling me this, I just need to trigger SDMA with EXT_EVENT_1, I don't know how to do it, and I don't understand SDMA scripts at all.
Best Regards!
Hi,
in order to help you, I need some more information. Can you please try to answer the following questions:
regards
Christian
Hi ceggers1,
Thanks for your help.
1. Peripheral is FPGA.
2. Peripheral --> RAM.
3. OCRAM 0x00901000 -- 0x0091FFFF
Best Regards!
> 3. OCRAM 0x00901000 -- 0x0091FFFF
sorry, I meant the FPGA side.
The address range 0x00901000 -- 0x0091FFFF is the CPU's internal SRAM. I need to know whether the FPGA has a single address for reading data (FIFO) or provides data via RAM like access (consecutive address range).
regards
Christian
FPGA side is consecutive address range
Best Regards!
> FPGA side is consecutive address range
ok, so you need a memcpy() style transfer from your FPGA's RAM (connected via EMI), to the CPU's internal OCRAM. This transfer shall be triggered by the SDMA event input.
As I already wrote, the exiting ap_2_ap script does memcpy() style transfers, but cannot be triggered by (S)DMA events (only by one of the ARM CPUs). In contrast, the mcu_2_app script uses (S)DMA events, but copies to a single address (FIFO).
In my opinion, you have the following options:
regarding 1)
Even if you can change the FPGA design, you probably would need a customized version of the mcu_2_app script.
regarding 2)
You should know that many processors have also limits accessing external devices via DMA. Some SOC series don't have external event lines at all.
regarding 3)
I have already successfully written a number scripts for the SDMA. In theory, you could do this yourself, but this would add additional efforts and risks to your project.
Christian
Hi ceggers1,
Thank you for your advice. It helped me a lot. I'm going to learn the SDMA script and try to write it myself.
Best Regards!
Hi dddd,
> I'm going to learn the SDMA script and try to write it myself.
As a first step, I recommend reading the following:
You should not expect much (free) support from NXP regarding SDMA.
Eli Billauer provides a free assembler for SDMA scripts, which is nice for the first steps. But for finding bugs in your own scripts you will likely require a debugger for SDMA (also very useful for learning how the existing scripts work). Additionally you may want to reuse existing ROM subroutines for your own scripts. As there is almost no documentation available, this will require reverse engineering...
Before reinventing the wheel, you may consider using my tools:
https://community.nxp.com/t5/i-MX-Processors/SDMA-port-for-GNU-binutils-assembler-linker-debugger/m-...
Don't hesitate to ask if you have further questions.
regards
Christian