This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

66AK2H12: K2hk pcie-ep : Unable to access the EDMA channel

Part Number: 66AK2H12

Hi,

Configure the SOC PCIESS as endpoint with phy-a 2 lane serdes config.

In Linux:

Integrated the EDMA0 & EDMA1(where its memory map is 0x2770000) in dts by taking k2g as reference.

+
+               edma0: edma@2700000 {
+                       compatible = "ti,edma3-tpcc";
+                       reg =   <0x02700000 0x8000>;
+                       reg-names = "edma3_cc";
+                       interrupts = <GIC_SPI 200 IRQ_TYPE_EDGE_RISING>,
+                                       <GIC_SPI 216 IRQ_TYPE_EDGE_RISING>,
+                                       <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "edma3_ccint", "emda3_mperr",
+                                         "edma3_ccerrint";
+                       dma-requests = <64>;
+                       #dma-cells = <2>;
+
+                       ti,tptcs = <&edma0_tptc0 7>, <&edma0_tptc1 0>;
+
+                       ti,edma-memcpy-channels = <32 33 34 35>;
+
+               };
+
+               edma0_tptc0: tptc@2760000 {
+                       compatible = "ti,edma3-tptc";
+                       reg =   <0x02760000 0x400>;
+               };
+
+               edma0_tptc1: tptc@2768000 {
+                       compatible = "ti,edma3-tptc";
+                       reg =   <0x02768000 0x400>;
                };

+               edma1: edma@2720000 {
+                       compatible = "ti,edma3-tpcc";
+                       reg =   <0x02720000 0x8000>;
+                       reg-names = "edma3_cc";
+                       interrupts = <GIC_SPI 208 IRQ_TYPE_EDGE_RISING>,
+                                       <GIC_SPI 219 IRQ_TYPE_EDGE_RISING>,
+                                       <GIC_SPI 220 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "edma3_ccint", "emda3_mperr",
+                                         "edma3_ccerrint";
+                       dma-requests = <64>;
+                       #dma-cells = <2>;
+
+                       ti,tptcs = <&edma1_tptc0 7>, <&edma1_tptc1 0>;
+
+                       /*
+                        * memcpy is disabled, can be enabled with:
+                        * ti,edma-memcpy-channels = <12 13 14 15>;
+                        * for example.
+                        */
+                        ti,edma-memcpy-channels = <12 13 14 15>;
+
+               };
+
+               edma1_tptc0: tptc@2770000 {
+                       compatible = "ti,edma3-tptc";
+                       reg =   <0x02770000 0x400>;
+               };
+
+               edma1_tptc1: tptc@2778000 {
+                       compatible = "ti,edma3-tptc";
+                       reg =   <0x027b8000 0x400>;
+               };




Loaded the dtb on node, but still we are observing similar to previous as mentioned below.

root@k2hk-evm:~# ls /sys/kernel/config/pci_ep/controllers/
21800000.pcie-ep
root@k2hk-evm:~# dmesg | grep -i edma
[    0.667919] edma 2700000.edma: TI EDMA DMA engine driver
[    0.674221] edma 2720000.edma: TI EDMA DMA engine driver
root@k2hk-evm:~# dmesg | grep  edma
[    0.667919] edma 2700000.edma: TI EDMA DMA engine driver
[    0.674221] edma 2720000.edma: TI EDMA DMA engine driver
root@k2hk-evm:~# mkdir /sys/kernel/config/pci_ep/functions/pci_epf_test/func1
root@k2hk-evm:~# echo 0x104c >/sys/kernel/config/pci_ep/functions/pci_epf_test/func1/vendorid
root@k2hk-evm:~# echoe 0xb00b > /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/deviceid
root@k2hk-evm:~# echo 16 > /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/msi_interrupts
root@k2hk-evm:~# echo 8 > /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/msix_interrupts
root@k2hk-evm:~# ln -s /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/ /sys/kernel/config/pci_ep/controllers/21800000.pci
e-ep/
[  191.929743]  line =70, func = __dw_pcie_read_dbi size = 4
[  191.935170]  line =74, func = __dw_pcie_read_dbi size = 4
[  191.940593] line =25, add = f518ba41 size = 4, val = c05b67a0
[  191.940602] line =32, add = f518ba41 size = 4, val = c05b67a0
[  191.947618] Unhandled fault: asynchronous external abort (0x211) at 0x00000000
[  191.947622] pgd = 4f184a46
[  191.947625] [00000000] *pgd=81c42c003, *pmd=87fcaa003
[  191.947636] Internal error: : 211 [#1] PREEMPT SMP ARM
[  191.947638] Modules linked in: cmemk(O)
[  191.947650] CPU: 0 PID: 649 Comm: ln Tainted: G           O      4.19.38-Private #11
[  191.947653] Hardware name: Keystone
[  191.947664] PC is at dw_pcie_read+0x8c/0xec
[  191.947674] LR is at irq_work_queue+0x64/0x108
[  191.947678] pc : [<c0593994>]    lr : [<c02c75e8>]    psr: 60060013
[  191.947682] sp : dc47fda8  ip : dc47fcc8  fp : dc47fdcc
[  191.947685] r10: dc873690  r9 : 00000000  r8 : e096d000
[  191.947688] r7 : dc47fdd0  r6 : 00000004  r5 : e096d8bc  r4 : 00000000
[  191.947691] r3 : 00000000  r2 : 794275fe  r1 : de59b5a0  r0 : 0000339c
[  191.947696] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  191.947699] Control: 30c5387d  Table: 1c41cc80  DAC: fffffffd
[  191.947703] Process ln (pid: 649, stack limit = 0x7e5da926)
[  191.947707] Stack: (0xdc47fda8 to 0xdc480000)
[  191.947713] fda0:                   c05b67a0 c1007488 c1007488 ddc46e40 00000004 000008bc
[  191.947719] fdc0: dc47fdfc dc47fdd0 c0593a90 c0593914 c05b67a0 794275fe ddc46f30 ddc46e40
[  191.947725] fde0: c101e924 c101e924 c0a338d8 c0a33910 dc47fe24 dc47fe00 c0593f90 c0593a00
[  191.947730] fe00: ddc52400 00000000 dc47fe24 ddc52400 00000000 ddc525dc dc47fe44 dc47fe28
[  191.947736] fe20: c05909bc c0593f6c c101e924 dce74800 ddc52400 00000000 dc47fea4 dc47fe48
[  191.947742] fe40: c0591af4 c0590960 00000000 00000001 dc47fe4c 00000000 00000001 00000001
[  191.947747] fe60: c02460c0 dce74a7c ddc525c0 dd716c40 ddc52400 00000000 dd5be200 dce74800
[  191.947753] fe80: dce74a90 dce74800 00000000 ddc52400 dd5be200 dc873690 dc47fec4 dc47fea8
[  191.947758] fea0: c0591588 c0591a2c dce74800 dc873320 00000000 ddc371d8 dc47feec dc47fec8
[  191.947764] fec0: c058f238 c0591544 ddc37180 c1007488 c0a337b4 dc873320 dc873640 dd5be200
[  191.947769] fee0: dc47ff2c dc47fef0 c03c19a0 c058f1d0 00000002 dd4cd110 dc873640 794275fe
[  191.947775] ff00: dc47ff2c de05b880 dc873320 00000000 ddbe0010 0009e190 c1007488 00000053
[  191.947781] ff20: dc47ff54 dc47ff30 c0353fd8 c03c1888 00000000 ddbe0000 dc873320 00000000
[  191.947786] ff40: ddbe0000 ffffff9c dc47ff94 dc47ff58 c0358f7c c0353f54 dc47ffa4 dd4cd110
[  191.947792] ff60: de006b40 794275fe 2a51bd80 be904d2c 0009e190 00000001 00000053 c0201204
[  191.947798] ff80: dc47e000 00000053 dc47ffa4 dc47ff98 c0359008 c0358efc 00000000 dc47ffa8
[  191.947804] ffa0: c0201000 c0358ffc be904d2c 0009e190 be904e3c 0009e190 be904e3c 00015064
[  191.947809] ffc0: be904d2c 0009e190 00000001 00000053 0009e190 00000000 0009dc6c 000858ec
[  191.947815] ffe0: b6eac070 be904af4 00060d3f b6eac07c 600f0010 be904e3c 00000000 00000000
[  191.947817] Backtrace:
[  191.947827] [<c0593908>] (dw_pcie_read) from [<c0593a90>] (__dw_pcie_read_dbi+0x9c/0xd4)
[  191.947832]  r7:000008bc r6:00000004 r5:ddc46e40 r4:c1007488
[  191.947839] [<c05939f4>] (__dw_pcie_read_dbi) from [<c0593f90>] (dw_pcie_ep_write_header+0x30/0x18c)
[  191.947845]  r9:c0a33910 r8:c0a338d8 r7:c101e924 r6:c101e924 r5:ddc46e40 r4:ddc46f30
[  191.947851] [<c0593f60>] (dw_pcie_ep_write_header) from [<c05909bc>] (pci_epc_write_header+0x68/0x88)
[  191.947855]  r6:ddc525dc r5:00000000 r4:ddc52400
[  191.947861] [<c0590954>] (pci_epc_write_header) from [<c0591af4>] (pci_epf_test_bind+0xd4/0x3c4)
[  191.947866]  r7:00000000 r6:ddc52400 r5:dce74800 r4:c101e924
[  191.947872] [<c0591a20>] (pci_epf_test_bind) from [<c0591588>] (pci_epf_bind+0x50/0xa8)
[  191.947877]  r10:dc873690 r9:dd5be200 r8:ddc52400 r7:00000000 r6:dce74800 r5:dce74a90
[  191.947879]  r4:dce74800
[  191.947886] [<c0591538>] (pci_epf_bind) from [<c058f238>] (pci_epc_epf_link+0x74/0x98)
[  191.947890]  r5:ddc371d8 r4:00000000
[  191.947898] [<c058f1c4>] (pci_epc_epf_link) from [<c03c19a0>] (configfs_symlink+0x124/0x304)

[  191.947903]  r9:dd5be200 r8:dc873640 r7:dc873320 r6:c0a337b4 r5:c1007488 r4:ddc37180
[  191.947911] [<c03c187c>] (configfs_symlink) from [<c0353fd8>] (vfs_symlink+0x90/0xf0)
[  191.947916]  r10:00000053 r9:c1007488 r8:0009e190 r7:ddbe0010 r6:00000000 r5:dc873320
[  191.947919]  r4:de05b880
[  191.947925] [<c0353f48>] (vfs_symlink) from [<c0358f7c>] (do_symlinkat+0x8c/0xec)
[  191.947930]  r7:ffffff9c r6:ddbe0000 r5:00000000 r4:dc873320
[  191.947936] [<c0358ef0>] (do_symlinkat) from [<c0359008>] (sys_symlink+0x18/0x1c)
[  191.947941]  r10:00000053 r9:dc47e000 r8:c0201204 r7:00000053 r6:00000001 r5:0009e190
[  191.947943]  r4:be904d2c
[  191.947951] [<c0358ff0>] (sys_symlink) from [<c0201000>] (ret_fast_syscall+0x0/0x54)
[  191.947954] Exception stack(0xdc47ffa8 to 0xdc47fff0)
[  191.947959] ffa0:                   be904d2c 0009e190 be904e3c 0009e190 be904e3c 00015064
[  191.947965] ffc0: be904d2c 0009e190 00000001 00000053 0009e190 00000000 0009dc6c 000858ec
[  191.947969] ffe0: b6eac070 be904af4 00060d3f b6eac07c
[  191.947975] Code: ebf395f0 e5953000 f57ff04f e303039c (e5873000)
Segmentation fault


Is there anything to be additionally? Is our edma config is properly entered?
Please guide us further.