Hi All,
I am leaning how the SDMA working on iMX6q CPU, but there are only few audio codec and uart examples in driver. i am wondering is there some simple example to show how the i.MX6q SDMA working theory?
i found mxc_sdma_memcopy_test.c in the imx-test-3.0.35-4.0.0.tar.gz, but it is not working, always shows kernel NULL pointer error just like following shows
-------------
Unable to handle kernel NULL pointer dereference at virtual address 00000010
pgd = b874c000
[00000010] *pgd=4919b831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#8] PREEMPT SMP
Modules linked in: mxsdma [last unloaded: mxsdma]
CPU: 0 Tainted: G D W (3.0.15-g108480f-dirty #16)
PC is at sdma_write+0x2c4/0x354 [mxsdma]
LR is at sdma_write+0x2c0/0x354 [mxsdma]
pc : [<7f0183a4>] lr : [<7f0183a0>] psr: 60000013
sp : b872bf10 ip : 00000001 fp : 00000001
r10: 8b9004e0 r9 : 00000200 r8 : 00000000
r7 : 7f018c28 r6 : 7f018bf8 r5 : 7f018bdc r4 : 00000400
r3 : 00000000 r2 : b8c6c000 r1 : 7f018434 r0 : 00000000
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c53c7d Table: 4874c04a DAC: 00000015
SP: 0xb872be90:
be90 00000000 80048aa0 00100100 00200200 b8c6c030 00000000 8b9004e0 18027000
beb0 18027400 0000040f 00000007 7f018bf8 7f018c28 8003fa10 00000000 7f018434
bed0 b8c6c000 00000000 00000400 7f018bdc 7f018bf8 7f018c28 00000000 00000200
bef0 8b9004e0 00000001 00000001 b872bf10 7f0183a0 7f0183a4 60000013 ffffffff
bf10 00000001 b90a9150 00000101 00000000 00000000 00000000 00000020 00000002
bf30 80a47d10 000083e0 b802da80 b8f1e000 00000000 7ea786fc b872bf80 00000000
bf50 b872a000 00000000 7ea78734 800e69c8 b872a000 b90a9150 b8f1e000 7ea786fc
bf70 00000000 00000000 00000000 800e6c38 00000000 00000000 2aae5568 00000000
R2: 0xb8c6bf80:
bf80 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfa0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
c000 b81cee08 0000ffff 00000000 b8c6c000 00000000 00000000 00000000 00000000
c020 00000000 00000000 00000000 00000000 00000000 00000000 b8c6c038 b8c6c038
c040 00000000 ffdfe000 18001000 00000000 00000000 00000000 00000000 00000000
c060 00000000 00000000 00000000 00000000 00000000 00000000 b8c6d924 00000000
R10: 0x8b900460:
0460 00008000 00000000 ffffffff 8b900400 00000000 00000000 8b900478 8b900478
0480 000040c0 00000001 00100004 b8002a00 00000000 88026000 00100100 00200200
04a0 00008000 00000000 ffffffff 8b900480 00000000 00000000 800b7a14 00000002
04c0 00008000 00000000 ffffffff 8b900480 00000000 00000000 8b9004d8 8b9004d8
04e0 00008000 00000000 ffffffff 8b900480 00000000 00000000 8b9004f8 8b9004f8
0500 000040c0 00000001 0010000a b8002980 00000000 88028800 00100100 00200200
0520 00008000 00000000 ffffffff 8b900500 00000000 00000000 800b7a14 00000001
0540 00000000 00000000 ffffff80 00000001 00000000 00000000 80a8817c 80a8817c
Process sdma_test (pid: 5993, stack limit = 0xb872a2f0)
Stack: (0xb872bf10 to 0xb872c000)
bf00: 00000001 b90a9150 00000101 00000000
bf20: 00000000 00000000 00000020 00000002 80a47d10 000083e0 b802da80 b8f1e000
bf40: 00000000 7ea786fc b872bf80 00000000 b872a000 00000000 7ea78734 800e69c8
bf60: b872a000 b90a9150 b8f1e000 7ea786fc 00000000 00000000 00000000 800e6c38
bf80: 00000000 00000000 2aae5568 00000000 00000000 7ea78758 000083e0 00000004
bfa0: 800401c4 80040040 00000000 7ea78758 00000003 7ea786fc 00000000 7ea786fc
bfc0: 00000000 7ea78758 000083e0 00000004 00000000 00000000 2aae5000 7ea78734
bfe0: 00000000 7ea786f4 000084d8 2acebbac 40000010 00000003 00000000 00000000
[<7f0183a4>] (sdma_write+0x2c4/0x354 [mxsdma]) from [<800e69c8>] (vfs_write+0xa8/0x138)
[<800e69c8>] (vfs_write+0xa8/0x138) from [<800e6c38>] (sys_write+0x40/0x6c)
[<800e6c38>] (sys_write+0x40/0x6c) from [<80040040>] (ret_fast_syscall+0x0/0x30)
Code: e58db000 e59cc054 e12fff3c e59f107c (e5903010)
imx-ipuv3 imx-ipuv3.1: ext di clk already in use, go back to internal clk
BUG: scheduling while atomic: sdma_test/5993/0x00000002
Modules linked in: mxsdma [last unloaded: mxsdma]
[<80045d7c>] (unwind_backtrace+0x0/0xf8) from [<804c56b4>] (__schedule+0x4c0/0x6c0)
[<804c56b4>] (__schedule+0x4c0/0x6c0) from [<804c5e94>] (schedule_timeout+0x14c/0x1e8)
[<804c5e94>] (schedule_timeout+0x14c/0x1e8) from [<80076cb0>] (msleep+0x14/0x20)
[<80076cb0>] (msleep+0x14/0x20) from [<80373f38>] (ipu_init_sync_panel+0x134/0x12c8)
[<80373f38>] (ipu_init_sync_panel+0x134/0x12c8) from [<802468f8>] (mxcfb_set_par+0x384/0x4f0)
[<802468f8>] (mxcfb_set_par+0x384/0x4f0) from [<80246af8>] (mxcfb_blank+0x94/0xa8)
[<80246af8>] (mxcfb_blank+0x94/0xa8) from [<8022f308>] (fb_blank+0x3c/0x68)
[<8022f308>] (fb_blank+0x3c/0x68) from [<802390a8>] (fbcon_blank+0x1c4/0x258)
[<802390a8>] (fbcon_blank+0x1c4/0x258) from [<8026a090>] (do_unblank_screen+0x94/0x194)
[<8026a090>] (do_unblank_screen+0x94/0x194) from [<80220bc4>] (bust_spinlocks+0x24/0x4c)
[<80220bc4>] (bust_spinlocks+0x24/0x4c) from [<800439b0>] (die+0xa8/0x284)
[<800439b0>] (die+0xa8/0x284) from [<804c14c8>] (__do_kernel_fault.part.4+0x54/0x74)
[<804c14c8>] (__do_kernel_fault.part.4+0x54/0x74) from [<80049970>] (do_page_fault+0x2a4/0x30c)
[<80049970>] (do_page_fault+0x2a4/0x30c) from [<8003a408>] (do_DataAbort+0x34/0x9c)
[<8003a408>] (do_DataAbort+0x34/0x9c) from [<8003fa10>] (__dabt_svc+0x70/0xa0)
Exception stack(0xb872bec8 to 0xb872bf10)
bec0: 00000000 7f018434 b8c6c000 00000000 00000400 7f018bdc
bee0: 7f018bf8 7f018c28 00000000 00000200 8b9004e0 00000001 00000001 b872bf10
bf00: 7f0183a0 7f0183a4 60000013 ffffffff
[<8003fa10>] (__dabt_svc+0x70/0xa0) from [<7f0183a4>] (sdma_write+0x2c4/0x354 [mxsdma])
[<7f0183a4>] (sdma_write+0x2c4/0x354 [mxsdma]) from [<800e69c8>] (vfs_write+0xa8/0x138)
[<800e69c8>] (vfs_write+0xa8/0x138) from [<800e6c38>] (sys_write+0x40/0x6c)
[<800e6c38>] (sys_write+0x40/0x6c) from [<80040040>] (ret_fast_syscall+0x0/0x30)
---[ end trace a0592d8c63058810 ]---
Segmentation fault
------------
for the details, check it out in this post https://community.freescale.com/message/337658#337658
thank you
The examples and information that you found in the community link are the only available at the moment but I can recommend if you have an NDA within FSL please contact us, using the Service Request so we can provide more specific details of the SDMA
thank you, Jamesbone
this blog here has good detail about imx sdma (imx5 and imx6 use same sdma peripheral) : Freescale i.MX51 SDMA tutorial (part I)