Re: [v4 4/4] PCI: cadence: Use cdns_pcie_find_*capability to find capability offset instead of hardcore

From: Hans Zhang
Date: Fri Mar 21 2025 - 10:06:12 EST




On 2025/3/21 21:18, Manivannan Sadhasivam wrote:
On Fri, Mar 21, 2025 at 06:17:10PM +0800, Hans Zhang wrote:
The offset address of capability or extended capability designed by
different SOC design companies may not be the same. Therefore, a flexible
public API is required to find the offset address of a capability or
extended capability in the configuration space.


The PCIe capability/extended capability offsets are not guaranteed to be
the same across all SoCs integrating the Cadence PCIe IP. Hence, use the
cdns_pcie_find_{ext}_capability() APIs for finding them.

This avoids hardcoding the offsets in the driver.


Hi Mani,

Thank you very much for your advice. Will change.

Best regards,
Hans

- Mani