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.

PROCESSOR-SDK-AM64X: Issue on PCIE region 0x68000000

Part Number: PROCESSOR-SDK-AM64X

Hi,TI team

I'm developing an FPGA based PCIE device on AM64x EVM + Processor SDK Linux for AM64X 08_00_00_21 with following:

1. My pcie device is in a 32-bit ep mode.

2. BAR0: 0x6810_0000, len = 1MB, BAR1 = 0x6830_0000, len = 64KB, BAR2 = 0x6820_0000, len=1MB

3. The pcie device driver can been loaded correctly, pci_enable_device, ioremap, etc.

4. It's fine to access registers in FPGA with readl(..) / writel(..) in the kernel driver.

5. But it always gets "Unhandled Exception in EL3" with command devmem2 in user space, and then system seems crashed.

6. devmem2 works fine on other peripheral regions in TRM, it seems that it gets error only on PCIE data region.

Q: Are there any restrictions on PCIE data region (0x6800_0000, 128MB)? If the restriction existed, how to remove it?

Cheng Shi

  • Hi, Bin Liu

    It's bit different. In previous post, pcie device is in dsiabled state, so it's understandable that the device can not been accessed. In this post, pcie device memory region is enabled, and all the modules can been accessed correctly in kernel driver mode. But it's failed (EL3) to access pcie module registers in Linux user mode using devmem2. Here are some message about pcie:

    root@am64xx-evm:~# lspci -vxs 1:0.0
    01:00.0 Serial controller: Xilinx Corporation Device 7021 (prog-if 00 [8250])
    Subsystem: Xilinx Corporation Device 0007
    Flags: bus master, fast devsel, latency 0, IRQ 41
    Memory at 68100000 (32-bit, non-prefetchable) [size=1M]
    Memory at 68300000 (32-bit, non-prefetchable) [size=64K]
    Memory at 68200000 (32-bit, non-prefetchable) [size=1M]
    Capabilities: [40] Power Management version 3
    Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [60] Express Endpoint, MSI 00
    Capabilities: [100] Device Serial Number 00-00-00-00-00-00-00-00
    Kernel driver in use: xdma-pcie
    00: ee 10 21 70 06 00 10 00 00 00 00 07 00 00 00 00
    10: 00 00 10 68 00 00 30 68 00 00 20 68 00 00 00 00
    20: 00 00 00 00 00 00 00 00 00 00 00 00 ee 10 07 00
    30: 00 00 00 00 40 00 00 00 00 00 00 00 29 01 00 00

    In pcie config space, the COMMAND = 0x0006 which means memory access granted. I wonder if there are some special restrictions on PCIE data region (0x68000000, 128MB).

    Cheng Shi

  • Hi Cheng,

    Do you mean you can access the memory region 0x68000000 in your kernel driver, but accessing it in user space causes EL3 failure?

  • Hi Bin Liu

    Yes, all the BAR regions can been read/written correctly in my kernel driver, but EL3 failure in user space. Furthmore, applying the same kernel driver to an intel pcie network card(intel 82575EB) which plugged into am64x-evm, read/write are all fine in both kernel driver mode and user space mode. It's a really confused situation.