[PATCH 0/3] PCI: Unify TLP type definitions across controller drivers

Hans Zhang posted 3 patches 1 week, 1 day ago
.../cadence/pcie-cadence-hpa-regs.h           | 12 ++++++-----
.../pci/controller/dwc/pcie-designware-ep.c   |  6 +++---
.../pci/controller/dwc/pcie-designware-host.c | 20 +++++++++----------
drivers/pci/controller/dwc/pcie-designware.c  |  2 +-
drivers/pci/controller/dwc/pcie-designware.h  |  5 -----
.../pci/controller/dwc/pcie-tegra194-acpi.c   |  4 ++--
drivers/pci/controller/pcie-aspeed.c          |  8 ++++----
drivers/pci/controller/pcie-mediatek.c        |  8 ++------
drivers/pci/pci.h                             |  9 +++++----
9 files changed, 34 insertions(+), 40 deletions(-)
[PATCH 0/3] PCI: Unify TLP type definitions across controller drivers
Posted by Hans Zhang 1 week, 1 day ago
This series replaces scattered hardcoded values and private macros for
PCIe TLP type fields with a single set of common definitions in pci.h.

Background:
PCIe Transaction Layer Packets (TLPs) have a Type field (bits 4:0 of
byte 0) that identifies the request type. Different controller drivers
(dwc, cadence, aspeed, mediatek) currently use either magic numbers or
their own macro names for these values, hurting code readability and
maintainability.

Changes:
- Patch 1: Introduce common macros in pci.h and convert aspeed/mediatek.
- Patch 2: Convert dwc driver (includes tegra194-acpi glue).
- Patch 3: Convert cadence driver.

All replacements are compile-time constant substitutions with identical
numeric values, so no runtime behavior change.

---
When I was integrating the DWC driver into the firmware of the GPU, 
discovered that the TLP type field of the iATU was similar to that
in drivers/pci/pci.h. Therefore, I wanted to make the code uniform.
---
Hans Zhang (3):
  PCI: Add common TLP type macros and convert aspeed/mediatek
  PCI: dwc: Replace ATU type macros with common TLP type macros
  PCI: cadence: Use common TLP type macros

 .../cadence/pcie-cadence-hpa-regs.h           | 12 ++++++-----
 .../pci/controller/dwc/pcie-designware-ep.c   |  6 +++---
 .../pci/controller/dwc/pcie-designware-host.c | 20 +++++++++----------
 drivers/pci/controller/dwc/pcie-designware.c  |  2 +-
 drivers/pci/controller/dwc/pcie-designware.h  |  5 -----
 .../pci/controller/dwc/pcie-tegra194-acpi.c   |  4 ++--
 drivers/pci/controller/pcie-aspeed.c          |  8 ++++----
 drivers/pci/controller/pcie-mediatek.c        |  8 ++------
 drivers/pci/pci.h                             |  9 +++++----
 9 files changed, 34 insertions(+), 40 deletions(-)


base-commit: 6916d5703ddf9a38f1f6c2cc793381a24ee914c6
-- 
2.34.1