[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240429104633.11060-11-ilpo.jarvinen@linux.intel.com>
Date: Mon, 29 Apr 2024 13:46:33 +0300
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: linux-pci@...r.kernel.org,
Bjorn Helgaas <bhelgaas@...gle.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Rob Herring <robh@...nel.org>,
Krzysztof Wilczyński <kw@...ux.com>,
Linus Walleij <linus.walleij@...aro.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
linux-kernel@...r.kernel.org
Cc: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: [PATCH 10/10] PCI: v3: Use generic PCI Conf Type 0/1 helpers
Convert v3 to use pci_conf{0,1}_addr() from PCI core to calculate PCI
Configuration Space address for Type 0/1 access.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
---
drivers/pci/controller/pci-v3-semi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/controller/pci-v3-semi.c b/drivers/pci/controller/pci-v3-semi.c
index 460a825325dd..a07323148007 100644
--- a/drivers/pci/controller/pci-v3-semi.c
+++ b/drivers/pci/controller/pci-v3-semi.c
@@ -327,7 +327,7 @@ static void __iomem *v3_map_bus(struct pci_bus *bus,
* 3:1 = config cycle (101)
* 0 = PCI A1 & A0 are 0 (0)
*/
- address = PCI_FUNC(devfn) << 8;
+ address = pci_conf0_addr(devfn, offset);
mapaddress = V3_LB_MAP_TYPE_CONFIG;
if (slot > 12)
@@ -354,7 +354,7 @@ static void __iomem *v3_map_bus(struct pci_bus *bus,
* 0 = PCI A1 & A0 from host bus (1)
*/
mapaddress = V3_LB_MAP_TYPE_CONFIG | V3_LB_MAP_AD_LOW_EN;
- address = (busnr << 16) | (devfn << 8);
+ address = pci_conf1_addr(busnr, devfn, offset, false);
}
/*
@@ -375,7 +375,7 @@ static void __iomem *v3_map_bus(struct pci_bus *bus,
v3->base + V3_LB_BASE1);
writew(mapaddress, v3->base + V3_LB_MAP1);
- return v3->config_base + address + offset;
+ return v3->config_base + address;
}
static void v3_unmap_bus(struct v3_pci *v3)
--
2.39.2
Powered by blists - more mailing lists