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.

TDA4VM: The PCIE between two TDA4 on linux

Part Number: TDA4VM

Requirement: Communicate between two TDA4.

1) do the command "echo 1 > /sys/kernel/config/pci_ep/controllers/2900000.pcie-ep/start" on EP.

2) Reboot the RC.

3) The RC will crash, I found the releated code is 

drivers/pci/vpd.c
pci_vpd_init{
    cap = pci_find_capability(dev, PCI_CAP_ID_VPD);
    if (!cap)
        return -ENODEV;
}

The Crash log is 

ERROR:   Unhandled External Abort received on 0x80000001 from S-EL1
ERROR:   exception reason=0 syndrome=0xbf000000
Unhandled Exception from EL1
x0             = 0xffff8000145e0000
x1             = 0x0000000000000000
x2             = 0xffff800015400008
x3             = 0x0000000000000001
x4             = 0x000000000000000b
x5             = 0xffff000802375000
x6             = 0xffff800011bcf834
x7             = 0x000000000000ea60
x8             = 0x0000000080b5111d
x9             = 0x00000000b00d104c
x10            = 0x7f7f7f7f7f7f7f7f
x11            = 0x0101010101010101
x12            = 0xffff00080056f325
x13            = 0xffff00080056fa1c
x14            = 0xffffffffffffffff
x15            = 0xffff000800312f30
x16            = 0x0000000000000000
x17            = 0x0000000000000000
x18            = 0x0000000000000000
x19            = 0xffff800011bcf774
x20            = 0x0000000000000004
x21            = 0xffff000802376000
x22            = 0x0000000000000087
x23            = 0xffff800011bcf834
x24            = 0x0000000000000001
x25            = 0xffff8000112a3a88
x26            = 0x0000000000000000
x27            = 0x0000000000000000
x28            = 0x0000000000000000
x29            = 0xffff800011bcf6f0
x30            = 0xffff8000104ea30c
scr_el3        = 0x000000000000073d
sctlr_el3      = 0x0000000030cd183f
cptr_el3       = 0x0000000000000000
tcr_el3        = 0x0000000080803520
daif           = 0x00000000000002c0
mair_el3       = 0x00000000004404ff
spsr_el3       = 0x0000000020000085
elr_el3        = 0xffff8000104ea324
ttbr0_el3      = 0x0000000070010c00
esr_el3        = 0x00000000bf000000
far_el3        = 0x0000000000000000
spsr_el1       = 0x0000000060000005
elr_el1        = 0xffff8000100b2580
spsr_abt       = 0x0000000000000000
spsr_und       = 0x0000000000000000
spsr_irq       = 0x0000000000000000
spsr_fiq       = 0x0000000000000000
sctlr_el1      = 0x0000000034d4d91d
actlr_el1      = 0x0000000000000000
cpacr_el1      = 0x0000000000300000
csselr_el1     = 0x0000000000000000
sp_el1         = 0xffff800011bcf6f0
esr_el1        = 0x0000000000000000
ttbr0_el1      = 0x0000000083240000
ttbr1_el1      = 0x0000000082f00000
mair_el1       = 0x000c0400bb44ffff
amair_el1      = 0x0000000000000000
tcr_el1        = 0x00000034f5d07590
tpidr_el1      = 0xffff80086eae0000
tpidr_el0      = 0x0000000000000000
tpidrro_el0    = 0x0000000000000000
par_el1        = 0x0000000000000000
mpidr_el1      = 0x0000000080000001
afsr0_el1      = 0x0000000000000000
afsr1_el1      = 0x0000000000000000
contextidr_el1 = 0x0000000000000000
vbar_el1       = 0xffff800010010800
cntp_ctl_el0   = 0x0000000000000005
cntp_cval_el0  = 0x000000016bb0161a
cntv_ctl_el0   = 0x0000000000000000
cntv_cval_el0  = 0x0000000000000000
cntkctl_el1    = 0x00000000000000d6
sp_el0         = 0x000000007000abd0
isr_el1        = 0x0000000000000040
dacr32_el2     = 0x0000000000000000
ifsr32_el2     = 0x0000000000000000
cpuectlr_el1   = 0x0000001b00000040
cpumerrsr_el1  = 0x0000000000000000
l2merrsr_el1   = 0x0000000000000000

Could you please help to supply some suggestions for debug ?

Thanks.

  • The 3) is the wrong failed point.

    Issue occur when the RC read the EP vendorid.

    drivers/pci/probe.c
    pci_bus_generic_read_dev_vendor_id
    {
        if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, l))
            return false;
    }

    When the issue occur, the RC is scan the 

    [ 2.444082] pci 0000:01:00.0: [17cd:0100] type 00 class 0x000000 devfn 1
    [ 2.450243] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00000fff]

    Then RC and EP look likes all normally, but why it's crash when read the register ?

  • Ruifeng, 

    The crash seems to be a memory violation. for example, PCIe tried to read remote address space that was mapped incorrectly. 

    Can you double check the following:

    1. you've followed all steps for cable mods, board mods, linux device tree mods, and rebuilt the kernel for the EP?

    2. which version of the SDK are you using?

    3. Can you check boot log to see if you see "link up" or "link never come up" messages?

    Jian

  • Hi Jian,

    My environment is the two TDA4 SoC connected by the PCIe0 in one board.

    > 1. you've followed all steps for cable mods, board mods, linux device tree mods, and rebuilt the kernel for the EP?

    I reference the 3.2.2.12. PCIe End Point and change the dts as the following patch. Please help to check is there something missing ?

    /cfs-file/__key/communityserver-discussions-components-files/791/rc.diff

    /cfs-file/__key/communityserver-discussions-components-files/791/ep.diff

    > 2. which version of the SDK are you using?

    ti-processor-sdk-linux-j7-evm-08_00_00_08-Linux-x86-Install.bin

    > 3. Can you check boot log to see if you see "link up" or "link never come up" messages?

    I checked the EP log and it don't linkup itself. At this time to boot RC, the system will not crash but the RC could not find EP.

    I try to input command to linkup EP, then boot RC, the RC system will crash. The command is "echo 1 > /sys/kernel/config/pci_ep/controllers/2900000.pcie-ep/start".

    The issue occur when the RC try to scan EP, the code is :

    pci_bus_generic_read_dev_vendor_id
        pci_bus_read_config_dword
            bus->ops->read
                pci_generic_config_read {
                    *val = readl(addr); //crash
                }

    The RC is always has the "link up" log, and output many times.

    [ 1.265746] j721e-pcie 2900000.pcie: Link up
    [ 1.270160] j721e-pcie 2900000.pcie: PCI host bridge to bus 0000:00

    Best Regards,

    Ruifeng

  • Hi Jian,

    Please help to check this problem. Thanks.

  • In addition to the probe issue, Is there has any demo in linux for transfer data bewteen RC and EP.

  • Hi have you resolved this issue? I'm experiencing the same problem. 

    I also followed the EP setup process as well as modified the PCIe cable (removing CLK+, CLK-, and RST resistors) and using the 8.0 SDK. I do see a "j721e-pcie 2900000.pcie: Link up" in my boot up log.

    Appreciate any assistance! 

  • Hi Michelle,

    The EP must bind with pci_epf_test driver. All functions that from func1 to func6 need to bind.

    If using the PCIe 2, the address should be 2920000, you can find it in dts file. The following is my input command on EP.

    mount -t configfs none /sys/kernel/config
    cd /sys/kernel/config/pci_ep/
    mkdir functions/pci_epf_test/func1
    echo 0x104c > functions/pci_epf_test/func1/vendorid
    echo 0xb00d > functions/pci_epf_test/func1/deviceid
    echo 2 > functions/pci_epf_test/func1/msi_interrupts
    echo 2 > functions/pci_epf_test/func1/msix_interrupts
    ln -s functions/pci_epf_test/func1 controllers/2920000.pcie-ep/
    
    mkdir functions/pci_epf_test/func2
    echo 0x104c > functions/pci_epf_test/func2/vendorid
    echo 0xb00d > functions/pci_epf_test/func2/deviceid
    echo 2 > functions/pci_epf_test/func2/msi_interrupts
    echo 2 > functions/pci_epf_test/func2/msix_interrupts
    ln -s functions/pci_epf_test/func2 controllers/2920000.pcie-ep/
    
    mkdir functions/pci_epf_test/func3
    echo 0x104c > functions/pci_epf_test/func3/vendorid
    echo 0xb00d > functions/pci_epf_test/func3/deviceid
    echo 2 > functions/pci_epf_test/func3/msi_interrupts
    echo 2 > functions/pci_epf_test/func3/msix_interrupts
    ln -s functions/pci_epf_test/func3 controllers/2920000.pcie-ep/
    
    mkdir functions/pci_epf_test/func4
    echo 0x104c > functions/pci_epf_test/func4/vendorid
    echo 0xb00d > functions/pci_epf_test/func4/deviceid
    echo 2 > functions/pci_epf_test/func4/msi_interrupts
    echo 2 > functions/pci_epf_test/func4/msix_interrupts
    ln -s functions/pci_epf_test/func4 controllers/2920000.pcie-ep/
    
    mkdir functions/pci_epf_test/func5
    echo 0x104c > functions/pci_epf_test/func5/vendorid
    echo 0xb00d > functions/pci_epf_test/func5/deviceid
    echo 2 > functions/pci_epf_test/func5/msi_interrupts
    echo 2 > functions/pci_epf_test/func5/msix_interrupts
    ln -s functions/pci_epf_test/func5 controllers/2920000.pcie-ep/
    
    mkdir functions/pci_epf_test/func6
    echo 0x104c > functions/pci_epf_test/func6/vendorid
    echo 0xb00d > functions/pci_epf_test/func6/deviceid
    echo 2 > functions/pci_epf_test/func6/msi_interrupts
    echo 2 > functions/pci_epf_test/func6/msix_interrupts
    ln -s functions/pci_epf_test/func6 controllers/2920000.pcie-ep/
    echo 1 > controllers/2920000.pcie-ep/start