1. Brief description of our system (please tell if additional details are needed):
- customized board based on i.MX7 dual SoC
- Pericom PI7C9X2G404SL switch is connected to iMX7 via PCIe bus
- 4.1.29 kernel(from official NXP imx-4.1-krogoth Yocto branch) customized for our board
2. Description of the problem:
Synopsys PCIe root bridge gets 0 when it tries to read its classcode with PCI_CLASS_REVISION command during initialization. This happens in 50 % of cases. In other 50% of cases it's read correctly - we obtain "6040001". Moreover vendor and product IDs are always (100% of cases) reported/read properly as "16c3:abcd", plus other values/registers are also read normally.
We tried to work around the problem by:
- re-reading the Synopsis classcode two and more times;
- flushing caches;
- playing with delays during initialization;
but nothing has helped - the classcode remains 0 if the first reading of the register returned a zero value.
We managed to "solve" the problem by substituting the zero classcode with proper value during the initialization routine. With this hack, the Synopsys root brigde is initialized properly and a Pericom PCIe switch connected to the root bridge works well too.
3. Speculations and open questions:
At the moment we can't tell:
- whether the problem can be reproduced on reference NXP system with reference Yocto BSP;
- whether the problem can be reproduced with latest NXP kernel/BSP;
- whether it can be reproduced on our system when the Pericom PCIe switch is disconnected from the root bridge.
We will provide an update if we will manage to perform such experiments.
As a brief search for similar problems on Internet gave no results, we speculate that the problem is specific to our particular customized system, but we can't find a root cause. So any input will be greatly appreciated.