That helped a lot!
I have a dts that is working, however, I'm having another problem that seems pretty typical.
Background info:
1. I'm using the cv_soc_rp_simple_design (pcie_rp_ed_5csxfc6.qsys) as the basis for this design.
2. It does not have the DMA module in it. (I was not able to use the version that does because it would not fit with my code in the part I have chosen).
3. My system ties X4 pcie to an NVMe board.
I have two issues at this point:
A. The board hangs after this message in the log: "Deasserting all peripheral resets," unless I remove the PCIe info from the dtb. It stops hanging after the board warms up. After the SOC heat sink has become warm to the touch, the system will boot just fine.
B. The NVMe is timing out at boot:
...
[ 0.612618] altera-pcie c0000000.pcie: host bridge /soc/bridge@c0000000/pcie@000000000 ranges:
[ 0.612640] altera-pcie c0000000.pcie: Parsing ranges property...
[ 0.612675] altera-pcie c0000000.pcie: MEM 0xc0000000..0xdfffffff -> 0x00000000
[ 0.612859] altera-pcie c0000000.pcie: PCI host bridge to bus 0000:00
[ 0.612874] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 0.612888] pci_bus 0000:00: root bus resource [mem 0xc0000000-0xdfffffff] (bus address [0x00000000-0x1fffffff])
[ 0.612899] pci_bus 0000:00: scanning bus
[ 0.613082] pci 0000:00:00.0: [1172:e000] type 01 class 0x060400
[ 0.616677] pci_bus 0000:00: fixups for bus
[ 0.616772] PCI: bus0: Fast back to back transfers disabled
[ 0.616800] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 0
[ 0.616810] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[ 0.616899] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1
[ 0.617399] pci_bus 0000:01: scanning bus
[ 0.617636] pci 0000:01:00.0: [8086:2522] type 00 class 0x010802
[ 0.618152] pci 0000:01:00.0: reg 0x10: [mem 0xc0000000-0xc0003fff 64bit]
[ 0.618519] pci 0000:01:00.0: reg 0x20: [mem 0xc0000000-0xc000ffff 64bit]
[ 0.618746] pci 0000:01:00.0: enabling Extended Tags
[ 0.620471] pci 0000:01:00.0: 4.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s x2 link at 0000:00:00.0 (capable of 15.752 Gb/s with 8 GT/s x2 link)
[ 0.622632] pci_bus 0000:01: fixups for bus
[ 0.622718] PCI: bus1: Fast back to back transfers disabled
[ 0.622729] pci_bus 0000:01: bus scan returning with max=01
[ 0.622743] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[ 0.622772] pci_bus 0000:00: bus scan returning with max=01
[ 0.622799] pci 0000:00:00.0: BAR 8: assigned [mem 0xc0000000-0xc00fffff]
[ 0.622816] pci 0000:01:00.0: BAR 4: assigned [mem 0xc0000000-0xc000ffff 64bit]
[ 0.622954] pci 0000:01:00.0: BAR 0: assigned [mem 0xc0010000-0xc0013fff 64bit]
[ 0.623089] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 0.623127] pci 0000:00:00.0: bridge window [mem 0xc0000000-0xc00fffff]
[ 0.623344] pcieport 0000:00:00.0: assign IRQ: got 132
[ 0.623408] pcieport 0000:00:00.0: enabling device (0140 -> 0142)
[ 0.623535] pcieport 0000:00:00.0: enabling bus mastering
[ 0.624027] pcieport 0000:00:00.0: PME: Signaling with IRQ 133
...
[ 1.459278] nvme 0000:01:00.0: assign IRQ: got 132
[ 1.464339] nvme nvme0: pci function 0000:01:00.0
[ 1.469107] nvme 0000:01:00.0: enabling device (0140 -> 0142)
...
[ 64.471966] nvme nvme0: I/O 16 QID 0 timeout, disable controller
[ 64.478147] nvme nvme0: Identify Controller failed (-4)
[ 64.483380] nvme nvme0: Removing after probe failure status: -5
The delay is so long that sometimes watchdog triggers and u-boot is reinitialized, sometimes it boots normally and lspci shows this:
root@cyclone5:~# lspci -v
00:00.0 PCI bridge: Altera Corporation Device e000 (rev 01) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 133
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00000000-00000fff [size=4K]
Memory behind bridge: 00000000-000fffff [size=1M]
Prefetchable memory behind bridge: 00000000-000fffff [size=1M]
Capabilities: [50] MSI: Enable+ Count=1/4 Maskable- 64bit+
Capabilities: [78] Power Management version 3
Capabilities: [80] Express Root Port (Slot-), MSI 00
Capabilities: [100] Virtual Channel
Capabilities: [200] Vendor Specific Information: ID=a000 Rev=0 Len=044 <?>
Kernel driver in use: pcieport
lspci: Unable to load libkmod resources: error -12
01:00.0 Non-Volatile memory controller: Intel Corporation Device 2522 (prog-if 02 [NVM Express])
Subsystem: Intel Corporation Device 3810
Flags: fast devsel, IRQ 132
Memory at c0010000 (64-bit, non-prefetchable) [size=16K]
[virtual] Memory at c0000000 (64-bit, non-prefetchable) [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI-X: Enable- Count=9 Masked-
Capabilities: [60] Express Endpoint, MSI 00
Capabilities: [a0] MSI: Enable- Count=1/16 Maskable+ 64bit+
Capabilities: [100] Advanced Error Reporting
Capabilities: [150] Virtual Channel
Capabilities: [180] Power Budgeting <?>
Capabilities: [190] Alternative Routing-ID Interpretation (ARI)
Capabilities: [2a0] Secondary PCI Express <?>
Capabilities: [2d0] Latency Tolerance Reporting
Capabilities: [310] L1 PM Substates
I have read that issues with the SOC memory mapping are to blame for this, however, I haven't changed any of the addresses or remapping as far as I know, so it should be set to the same as in the example PCIe qsys file.
Does the pcie driver support implementations without the MSGDMA module installed?
Any clues would be appreciated.
Thanks.