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).