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 

Fullscreen
1
2
3
4
5
6
drivers/pci/vpd.c
pci_vpd_init{
cap = pci_find_capability(dev, PCI_CAP_ID_VPD);
if (!cap)
return -ENODEV;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The Crash log is 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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.

    Fullscreen
    1
    2
    3
    4
    5
    6
    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;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    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 :

    Fullscreen
    1
    2
    3
    4
    5
    6
    pci_bus_generic_read_dev_vendor_id
    pci_bus_read_config_dword
    bus->ops->read
    pci_generic_config_read {
    *val = readl(addr); //crash
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    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.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX