AnsweredAssumed Answered

Adding ap_2_ap_fixed into sdma rom

Question asked by jayakumar2 on Nov 21, 2016
Latest reply on Mar 17, 2017 by Isa Ansharullah
Branched to a new discussion

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!

Outcomes