Adding ap_2_ap_fixed into sdma rom

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Adding ap_2_ap_fixed into sdma rom

2,842件の閲覧回数
jayakumar2
Contributor V

Hi,

I've been trying to get sdma working with a fixed destination address (host-to-eim). Currently, on 6sl with linux 4.1 it works but the eim destination address is incrementing on each dma cycle whereas my target device expects a fixed destination address.


I found the following post: https://community.nxp.com/docs/DOC-93891
which says:
"
The attached patch applies to iMX6_Platform_SDK for i.MX6 Dual and Quad and brings 2 additional SDMA memory to memory scripts:
fixed destination address, increasing source address
"

That sounds like exactly what I need.

I see from:
arch/arm/boot/dts/imx6sl.dtsi
...
/* imx6sl reuses imx6q sdma firmware */
fsl,sdma-ram-script-name = "imx/sdma/sdma-imx6q.bin";

So that looks promising as it suggests that the ap_2_ap_fixed script implemented above could be added to the 6q sdma firmware.

Looking at the log for the 6q sdma firmware shows:
$ git log firmware/imx/sdma/sdma-imx6q.bin.ihex
commit a2ec8df37f5dddc81592f3b911e0d7358990e8ae
Author: Robin Gong <yibin.gong@nxp.com>
Date: Thu Jan 14 11:40:40 2016 +0800

MLK-12256: firmware: imx: sdma: fix bugs in uart script code

I don't see the ap_2_ap_fixed mentioned in above history.

Looking in the sdma driver:
drivers/dma/imx-sdma.c
static struct sdma_script_start_addrs sdma_script_imx6q = {
.ap_2_ap_addr = 642,
.uart_2_mcu_addr = 817,
.mcu_2_app_addr = 747,
.uartsh_2_mcu_addr = 1032,
.mcu_2_shp_addr = 960,
.app_2_mcu_addr = 683,
.shp_2_mcu_addr = 891,
.spdif_2_mcu_addr = 1100,
.mcu_2_spdif_addr = 1134,
};

So my guess is that what is needed is:
a) ap_2_ap_fixed script needs to be added into the sdma-imx6q.bin
b) an ap_2_ap_fixed_addr needs to be added and then exposed via dmaengine api in the sdma driver (eg: device_prep_interleaved_dma).

I understand that the SDMA ROM scripts source is not available. That leaves me a bit stuck. What's the typical process to get above steps done? Thanks for any suggestions/advice.

Thanks!

ラベル(2)
タグ(1)
0 件の賞賛
返信
8 返答(返信)

1,547件の閲覧回数
jamesbone
NXP TechSupport
NXP TechSupport

Hello Jaka,

As you mention the source it is not available so let me ask internally if I can get  a patch for your case.  This may take a longer time since it is not in our pipeline.  I let you know once I get a response.

Have a nice day

0 件の賞賛
返信

1,547件の閲覧回数
jayakumar2
Contributor V

Thanks Jamesbone.

0 件の賞賛
返信

1,547件の閲覧回数
jamesbone
NXP TechSupport
NXP TechSupport

Hello Jaya,

From the application team,

.Does the patch work for you?

 

I can see on the patch:

 

+#if defined (CHIP_MX6DQ)
+     {SDMA_AP_2_AP_FIXED, ap_2_ap_fixed_ADDR},
+     {SDMA_AP_FIXED_2_AP, ap_fixed_2_ap_ADDR},
+#endif

 

0 件の賞賛
返信

1,547件の閲覧回数
jayakumar2
Contributor V

Hi Jamesbone,

Just wanted to follow-up and ask if there's been any update.

Thanks!

0 件の賞賛
返信

1,547件の閲覧回数
jamesbone
NXP TechSupport
NXP TechSupport

Hello Jaya,

We were not able to find any patch for the i.MX6SL, and I don't think it really exist as it's not part of the formal release process.

 

I suggest to adapt the patch to the MX6SL (it's only adding an OR to the if) and give it  try. There is no change in the sdma for both chips, and I think the test is worthy.

,


Have a great day,
Jaime

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

1,547件の閲覧回数
jayakumar2
Contributor V

Hi Jaime,

Thanks for your reply. I am trying to understand the meaning of:

"I suggest to adapt the patch to the MX6SL (it's only adding an OR to the if) and give it try. There is no change in the sdma for both chips, and I think the test is worthy."

I don't think that matches up with what I see. It isn't a simple case of just applying that patch and or-ing in 6sl. As I mentioned on Linux 4.1 , none of that code exists since it uses the sdma-imx6q.bin.ihex to store the various scripts rather than the array struct. Here's what I wrote about what's needed:

What is needed is:
a) ap_2_ap_fixed script needs to be added into the sdma-imx6q.bin
b) an ap_2_ap_fixed_addr needs to be added and then exposed via dmaengine api in the sdma driver (eg: device_prep_interleaved_dma).

If you are saying it is otherwise, could you elaborate on what steps you are suggesting, and whether you've tried applying the patch on your own setup?

Thanks!

0 件の賞賛
返信

1,547件の閲覧回数
meriororen
Contributor I

I am doing exactly the same thing. 

Is there any update on this?

0 件の賞賛
返信

1,547件の閲覧回数
jayakumar2
Contributor V

Hi James,

Thanks for your reply. Unfortunately, no, that patch doesn't work for me. I'm using i.MX6 SoloLite with Linux 4.1 so the patch is incompatible with sdma-imx6q.bin.ihex that is used in 4.1.

Thanks!

0 件の賞賛
返信