Which PCIe controllers are enabled?

The LX2160 manual and the device tree both refer to 6 controllers. However, mapping and attempting to read the configuration space for each of those causes the board to hang for most controllers, suggesting they are either not powered or simply not there. It seems that only 3 and 5 are enabled. Is that correct?

Also, when I try to enumerate controller 3 I get some odd results on the first few BDF entries, which look like bridges but have a type 1 header.

–Elad

P.S.,
Keep in mind that I know very little about PCI. Just trying to get more hardware enabled on this board for my real job…

The LX2160a can support up to 6 PCIe controllers, however that requires the carrier to support it. The RCW determines how the SERDES channels are designated. By default the HoneyComb and ClearFog CX carriers have PCIe enabled for controllers 3 and 5, however the x8 slot can be bifurcated and support controllers 5 and 6 in 2x x4 configurations.

The LX2160a V2 board uses a Synopsis based controller, which has a Linux driver to manage the config accesses. Are you having issues with the BSP detecting your PCIe card?

Linux sees bridges at 0:0:0 and 1:0:0 (controllers 3 and 5?) and then the NVMe card on the M2 slot at 0:1:0. When I try enumerating myself (to get the QNX driver to work) I see a bridge in 0:0:0. But then reading the mapped ECAM at the offset for 0:1:0 shows a device with the same VID/DID (so not the NVMe), a header type of 1 and an unexpected class/subclass:

# ./pcie                                                       
VID/DID: 1957/8d80 Type: 1 Class: 6 Subclass:4
VID/DID: 1957/8d80 Type: 1 Class: b Subclass:20

Where pcie just maps the ECAM and looks at the headers at offsets 0 and 1 << 15.

device-tree pcie enumeration does not use ecam.

I found a QNX PCI driver for the NXP LS2xxx SoCs that appears to be close enough, but there is at least one important difference. In the LS2xxxx you can get information on which PCIe controllers are available and what is their configuration by reading the SerDes PCCR0 register. It seems that on the LX2160 this is done by reading the reset control word instead, but it is not clear to me how to do that.

By the way, if these questions are better directed at NXP please let me know.

–Elad

u-boot dumps the RCW, and if I interpret it correctly we have:

912-916 (SerDes1): 8
917-921 (SerDes2): 5 (PCIe controller 3 x4, 4 SATA)
922-926 (SerDes3): 2 (PCIe controller 5 x8)

I’d still like to know how to get the information programatically after boot.

–Elad

This should all be obtained by parsing the device-tree. This is what describes the hardware to the host OS.

I am utterly confused now. The device tree on the default Debian image suggests that the controller is actually the LS2088 one, which is confirmed by

# cat driver/3600000.pcie/modalias
of:NpcieTpciCfsl,ls2088a-pcie

The honeycomb device tree blob I found wants the lx2160a controller, as I would have expected, and which has a different Linux driver.

lx2160a has 2 variants. The original V1 hardware which was only shipped as pre-release had a mobiveil pcie controller, the V2 hardware which is what in current mass production changed the PCIe controller IP and is now a synopsis based design more similar to the other Layerscape SOCs

That explains it, thanks.

I have PCIe (and NVMe) working now. Thanks for the help.
At some point I will need to figure out how to create a proper boot image and get the device tree from the firmware, instead of using the default image.

–Elad

1 Like