Skip to content

Commit

Permalink
PCI: mvebu: Drop unused PCI express capability code
Browse files Browse the repository at this point in the history
Commit dc0352a ("PCI: mvebu: Add PCI Express root complex
capability block") added support for emulating the PCI Express
capability block. As part of this, the pcie_sltcap, pcie_devctl and
pcie_rtctl fields were added to the mvebu_sw_pci_bridge structure, and
used when reading the corresponding PCI Express capability block
registers.

However, those structure members are never set to any value other than
zero. This makes them unneeded because:

 - pcie_devctl is used to OR *value, so with pcie_devctl always zero,
   it has no effect.

 - for pcie_sltcap and pcie_rtstl, the mvebu_sw_pci_bridge_read()
   function always returns 0 for registers that are not explicitly
   handled.

In preparation for reworking the PCI bridge emulation logic in
pci-mvebu, let's simplify the code by dropping those structure
members.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
  • Loading branch information
Thomas Petazzoni authored and Lorenzo Pieralisi committed Oct 18, 2018
1 parent 23a5fba commit eae6aaf
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions drivers/pci/controller/pci-mvebu.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ struct mvebu_sw_pci_bridge {
u8 intline;
u8 intpin;
u16 bridgectrl;

/* PCI express capability */
u32 pcie_sltcap;
u16 pcie_devctl;
u16 pcie_rtctl;
};

struct mvebu_pcie_port;
Expand Down Expand Up @@ -588,7 +583,6 @@ static int mvebu_sw_pci_bridge_read(struct mvebu_pcie_port *port,
*value = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_DEVCTL) &
~(PCI_EXP_DEVCTL_URRE | PCI_EXP_DEVCTL_FERE |
PCI_EXP_DEVCTL_NFERE | PCI_EXP_DEVCTL_CERE);
*value |= bridge->pcie_devctl;
break;

case PCISWCAP_EXP_LNKCAP:
Expand All @@ -604,18 +598,10 @@ static int mvebu_sw_pci_bridge_read(struct mvebu_pcie_port *port,
*value = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_LNKCTL);
break;

case PCISWCAP_EXP_SLTCAP:
*value = bridge->pcie_sltcap;
break;

case PCISWCAP_EXP_SLTCTL:
*value = PCI_EXP_SLTSTA_PDS << 16;
break;

case PCISWCAP_EXP_RTCTL:
*value = bridge->pcie_rtctl;
break;

case PCISWCAP_EXP_RTSTA:
*value = mvebu_readl(port, PCIE_RC_RTSTA);
break;
Expand Down

0 comments on commit eae6aaf

Please sign in to comment.