Skip to content

PCI: Introduce new PCI_CONF1_ADDRESS() and PCI_CONF1_EXT_ADDRESS() macros

Pali Rohár linux-pci lkml 1 version Applied

Status from this message: Applied to pci/misc, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesApplied

Changes since RFC from the cover letter

* Move macros to file drivers/pci/pci.h

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3PCI: Add standard PCI Config Address macrosdrivers/pci/pci.h+45 -01 reply
2/3PCI: ftpci100: Use PCI_CONF1_ADDRESS() macrodrivers/pci/controller/pci-ftpci100.c+4 -170 replies
3/3PCI: mt7621: Use PCI_CONF1_EXT_ADDRESS() macrodrivers/pci/controller/pcie-mt7621.c+6 -111 reply

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchBjorn HelgaasSergio Paracuellos
1/3A-b
2/3
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] PCI: Introduce new PCI_CONF1_ADDRESS() and PCI_CONF1_EXT_ADDRESS() macros

PCI controllers and lot of non-ECAM compliant PCIe controllers still use Intel PCI Configuration Mechanism #1 for accessing PCI config space.

Native PCIe controller drivers invents its own macros which implements config space address calculation and in lof of cases it is just duplication of the same code.

PCIe ECAM address macro PCIE_ECAM_OFFSET() is already in include header file linux/pci-ecam.h and ECAM compliant drivers were already converted to use it.

Do similar thing also for Intel PCI Configuration Mechanism #1. Introduce into file drivers/pci/pci.h new PCI_CONF1_ADDRESS() and PCI_CONF1_EXT_ADDRESS() macros and convert two drivers pci-ftpci100.c and pcie-mt7621.c to use it.

There are many more drivers which could be converted to this common macros. This can be done later.

Note that similar cleanup was applied for U-Boot PCI controller drivers:
https://lore.kernel.org/u-boot/[email protected]/

Changes since RFC:
* Move macros to file drivers/pci/pci.h

Pali Rohár (3):
PCI: Add standard PCI Config Address macros
PCI: ftpci100: Use PCI_CONF1_ADDRESS() macro
PCI: mt7621: Use PCI_CONF1_EXT_ADDRESS() macro

 drivers/pci/controller/pci-ftpci100.c | 21 +++----------
 drivers/pci/controller/pcie-mt7621.c  | 17 ++++------
 drivers/pci/pci.h                     | 45 +++++++++++++++++++++++++++
 3 files changed, 55 insertions(+), 28 deletions(-)
Signature · 1 line
2.20.1