PCI: qcom: Add support for configuring BDF to SID mapping for SM8250
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tue, 8 Dec 2020 12:14:02 +0000 (17:44 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 9 Dec 2020 15:07:11 +0000 (15:07 +0000)
commit4c9398822106c366d88c8c68ddf44bd371d39961
tree39bbeef404ee4db7d1e3a00270657f62168e25fa
parente1dd639e374a1345c63eb7e8931e08de7cb8f904
PCI: qcom: Add support for configuring BDF to SID mapping for SM8250

For SM8250, we need to write the BDF to SID mapping in PCIe controller
register space for proper working. This is accomplished by extracting
the BDF and SID values from "iommu-map" property in DT and writing those
in the register address calculated from the hash value of BDF. In case
of collisions, the index of the next entry will also be written.

For the sake of it, let's introduce a "config_sid" callback and do it
conditionally for SM8250.

Link: https://lore.kernel.org/r/20201208121402.178011-4-mani@kernel.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/pci/controller/dwc/Kconfig
drivers/pci/controller/dwc/pcie-qcom.c