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.

AM3874 PCI Express problem on custom board in EP and RC mode

Other Parts Discussed in Thread: AM3874, DM385

Hi, All!

I have a custom board, based on TI8148 EVM. On board placed AM3874 connected to PCIE switch PLX8750. I have a problem to use AM3874 in PCIE EP mode:

1) If I try to init PCIE PLL in u-boot, I have a hung u-boot in function pcie_pll_config() on while() cycle

... ... ...
/* wait for ADPLL lock */
while((__raw_readl(PCIE_PLLSTATUS) != 0x1));

In my case PCIE_PLLSTATUS = 0xD8ED and I change u-boot code (similar to linux kernel in device.c)

/* wait for ADPLL lock */
while(((__raw_readl(PCIE_PLLSTATUS) & 0x01) == 0x0));

and pcie_pll_config() can complete, but then I try to read/write PCIE configuration register I have some exception and u-boot hung in addresses 0x2008C.
2) If I disable PCIE in u-boot (by default) and try to use PCI Express Endpoint driver in linux as stated in 
http://processors.wiki.ti.com/index.php/DM81xx_AM38xx_PCI_Express_Endpoint_Driver_User_Guide

I compile linux kernel and ti81xx_pcie_epdrv.ko as a module. Reserve 8M memory for EP at boot time

DM81xx PCIe EP memory  size = 8388608

and then try insert driver in kernel, but have the kernel exception:

/ # insmod ti81xx_pcie_epdrv.ko
Unhandled fault: external abort on non-linefetch (0x1028) at 0xd5001004
Internal error: : 1028 [#1]
last sysfs file: /sys/devices/platform/omap/omap_i2c.3/i2c-3/i2c-dev/i2c-3/dev
Modules linked in: ti81xx_pcie_epdrv(+)
CPU: 0 Not tainted (2.6.37 #5)
PC is at ti81xx_ep_pcie_init+0x1b8/0x290 [ti81xx_pcie_epdrv]
LR is at kobject_put+0x48/0x5c
pc : [<bf000c2c>] lr : [<c01cd2e4>] psr: 60000013
sp : cc2aff18 ip : d5001050 fp : cc2aff44
r10: 00000000 r9 : cc2ae000 r8 : bf000e79
r7 : bf0011ec r6 : 00000000 r5 : bf0011dc r4 : d5000000
r3 : 00000000 r2 : d5001004 r1 : bf001250 r0 : bf001240
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5387d Table: 8c2e8019 DAC: 00000015
Process insmod (pid: 63, stack limit = 0xcc2ae2e8)
Stack: (0xcc2aff18 to 0xcc2b0000)
ff00: bf000e79 bf0011ec
ff20: c0084790 00000000 bf0010b8 001da3b9 001f0fe0 bf000a74 cc2aff7c cc2aff48
ff40: c003742c bf000a80 bf0010b8 001da3b9 001f0fe0 c0041fa8 00000000 bf0010b8
ff60: 001da3b9 001f0fe0 c0041fa8 00000000 cc2affa4 cc2aff80 c0094b30 c0037368
ff80: c00c1640 c00c1558 00000000 00000000 be8f7e78 00000080 00000000 cc2affa8
ffa0: c0041e00 c0094aa0 00000000 00000000 001f0fe0 00002d8f 001da3b9 00000000
ffc0: 00000000 00000000 be8f7e78 00000080 be8f7e74 be8f7e78 00000001 be8f7e74
ffe0: 00000069 be8f7b0c 0001f6b0 00009654 60000010 001f0fe0 8c5fe021 8c5fe421
Backtrace:
[<bf000a74>] (ti81xx_ep_pcie_init+0x0/0x290 [ti81xx_pcie_epdrv]) from [<c003742c>] (do_one_initcall+0xd0/0x1a4)
r8:bf000a74 r7:001f0fe0 r6:001da3b9 r5:bf0010b8 r4:00000000
[<c003735c>] (do_one_initcall+0x0/0x1a4) from [<c0094b30>] (sys_init_module+0x9c/0x1bc)
[<c0094a94>] (sys_init_module+0x0/0x1bc) from [<c0041e00>] (ret_fast_syscall+0x0/0x30)
r7:00000080 r6:be8f7e78 r5:00000000 r4:00000000
Code: e284cd41 e2822004 e584618c e28cc010 (e5923000)
---[ end trace ff59af696e5d5d09 ]---
Segmentation fault

3) In RC mode I have a linux hung on this stage:

ti81xx_pcie: Invoking PCI BIOS...
ti81xx_pcie: Setting up Host Controller...
ti81xx_pcie: Register base mapped @0xd0820000

Please tell me that I need to do for properly PCIE EP mode config? If you need any additional information about board or code I will provide it.

Thank you.

P.S. 

I make some experiments in u-boot code, and add write to the following register:

RM_DEFAULT_RSTCTRL = 0x7E

CM_DEFAULT_PCI_CLKCTRL = 0x2

CMD_DEFAULT_PCI_CLKSTCTRL = 0x0

After this, I can read write PCIE EP configuartion register in u-boot and can see AM3874 as PCIE device plugged into PC (linux not booted).

  • Moving this to the AM387X forum.

  • Vladimir,

    Are you using the AM387x EZSDK 5.04.00.11?

    Please refer to the below wiki pages:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_U-Boot_PCIe_Boot_User_Guide

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_PCI_Express_Endpoint_Boot_Driver_User_Guide

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_PCI_Express_Endpoint_Driver_User_Guide

    http://processors.wiki.ti.com/index.php/TI81XX_PCIe_FAQs

    Regards,
    Pavel

  • Hello, Pavel!

    Thank you for your answer.

    The first time I used EZSDK.5.04.00.11, but it not support chip with rev. 4 (I was add it by myself). At that moment I start using  EZSDK.5.05.00.02. And all my logs from latest EZSDK version. I try to use code from arago.git, but arago.git code too much differs with EZSDK. 

    Pavel, I read all this links that you provide me (except the last one) before asking here.

    Thank you.

  • Hello, Pavel!

    Please, tell me, there is a guide similar to http://processors.wiki.ti.com/index.php/TI81XX_PCIe_FAQs but for DM814x processors family? Thank you.

  • Vladimir Karakozov said:
    Please, tell me, there is a guide similar to http://processors.wiki.ti.com/index.php/TI81XX_PCIe_FAQs but for DM814x processors family?

    This user guide is common for all DM81xx device (DM816x, DM814x, DM813x/DM385), thus we do not have version of this user guide specific for DM814x.

    You can search for TI81xx and TI814x in this user guide for DM814x.

    Regards,
    Pavel

  • Hi, Pavel!

    Thank you for you answer and sorry for may delay with response.

    Pavel, I comile PCI Express endpoint driver and can load it into the kernel of embedded linux. But I don't understand how I can use it in my case. I will try describe my system and that I need to do.

    I have a board with several FPGA and one AM3874. All FPGAs and AM3874 are PCI Express endpoint devices and connected between themselves via PCI Express switch. Board plugged into the linux host machine on x86. On AM3874 working embedded linux and I need to read/write some registers of FPGAs.

    All FPGAs and AM3874 listed in lspci output on linux host machine and .

    Pavel, can I read and write FPGAs registers via PCI Express endpoint driver? All physical addresses of FPGAs are known. Can you give me some tips for my case. If you will need more information I will provide it.

    Thank you.