Hi Siddharth,
Prior to this patch, I don't think hard-coded is that reasonable. Because
the SOC design of each company does not guarantee that the offset of each
capability is the same. This parameter can be configured when selecting PCIe
configuration options. The current code that just happens to hit the offset
address is the same.
1. You are modifying the driver for the Cadence PCIe Controller IP and
not the one for your SoC (a.k.a the application/glue/wrapper driver).
2. The offsets are tied to the Controller IP and not to your SoC. Any
differences that arise due to IP Integration into your SoC should be
handled in the Glue driver (the one which you haven't upstreamed yet).
3. If the offsets in the Controller IP itself have changed, this
indicates a different IP version which has nothing to do with the SoC
that you are using.
Please clarify whether you are facing problems with the offsets due to a
difference in the IP Controller Version, or due to the way in which the IP
was integrated into your SoC.
You can refer to the pci_find_*capability() or dw_pcie_find_*capability API.
The meaning of their appearance is the same as what I said, and the design
of each company may be different.
These APIs exits since there are multiple users with different Controllers
(in the case of pci_find_*capability()) or different versions of the
Controller (in the case of dw_pcie_find_*capability) due to which we cannot
hard-code offsets. In the case of the Cadence PCIe Controller, I see only
one user in Upstream Linux at the moment which happens to be the
"pci-j721e.c" driver. Maybe there are other users, but the offsets seem
to be compatible with their SoCs in that case.