Skip to content

Commit fdd056f

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: dwc: Use DBI accessors
Convert the remaining cases of register accesses using dbi_base rather than dw_pcie_(read|write)[bwl]_dbi accessors. Link: https://lore.kernel.org/r/20200821035420.380495-41-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Pratyush Anand <pratyush.anand@gmail.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: linux-tegra@vger.kernel.org
1 parent aeaa0bf commit fdd056f

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎drivers/pci/controller/dwc/pcie-spear13xx.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ static int spear13xx_pcie_establish_link(struct spear13xx_pcie *spear13xx_pcie)
8686
* default value in capability register is 512 bytes. So force
8787
* it to 128 here.
8888
*/
89-
dw_pcie_read(pci->dbi_base + exp_cap_off + PCI_EXP_DEVCTL, 2, &val);
89+
val = dw_pcie_readw_dbi(pci, exp_cap_off + PCI_EXP_DEVCTL);
9090
val &= ~PCI_EXP_DEVCTL_READRQ;
91-
dw_pcie_write(pci->dbi_base + exp_cap_off + PCI_EXP_DEVCTL, 2, val);
91+
dw_pcie_writew_dbi(pci, exp_cap_off + PCI_EXP_DEVCTL, val);
9292

93-
dw_pcie_write(pci->dbi_base + PCI_VENDOR_ID, 2, 0x104A);
94-
dw_pcie_write(pci->dbi_base + PCI_DEVICE_ID, 2, 0xCD80);
93+
dw_pcie_writew_dbi(pci, PCI_VENDOR_ID, 0x104A);
94+
dw_pcie_writew_dbi(pci, PCI_DEVICE_ID, 0xCD80);
9595

9696
/* enable ltssm */
9797
writel(DEVICE_TYPE_RC | (1 << MISCTRL_EN_ID)

‎drivers/pci/controller/dwc/pcie-tegra194.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -816,26 +816,24 @@ static void config_gen3_gen4_eq_presets(struct tegra_pcie_dw *pcie)
816816

817817
/* Program init preset */
818818
for (i = 0; i < pcie->num_lanes; i++) {
819-
dw_pcie_read(pci->dbi_base + CAP_SPCIE_CAP_OFF
820-
+ (i * 2), 2, &val);
819+
val = dw_pcie_readw_dbi(pci, CAP_SPCIE_CAP_OFF + (i * 2));
821820
val &= ~CAP_SPCIE_CAP_OFF_DSP_TX_PRESET0_MASK;
822821
val |= GEN3_GEN4_EQ_PRESET_INIT;
823822
val &= ~CAP_SPCIE_CAP_OFF_USP_TX_PRESET0_MASK;
824823
val |= (GEN3_GEN4_EQ_PRESET_INIT <<
825824
CAP_SPCIE_CAP_OFF_USP_TX_PRESET0_SHIFT);
826-
dw_pcie_write(pci->dbi_base + CAP_SPCIE_CAP_OFF
827-
+ (i * 2), 2, val);
825+
dw_pcie_writew_dbi(pci, CAP_SPCIE_CAP_OFF + (i * 2), val);
828826

829827
offset = dw_pcie_find_ext_capability(pci,
830828
PCI_EXT_CAP_ID_PL_16GT) +
831829
PCI_PL_16GT_LE_CTRL;
832-
dw_pcie_read(pci->dbi_base + offset + i, 1, &val);
830+
val = dw_pcie_readb_dbi(pci, offset + i);
833831
val &= ~PCI_PL_16GT_LE_CTRL_DSP_TX_PRESET_MASK;
834832
val |= GEN3_GEN4_EQ_PRESET_INIT;
835833
val &= ~PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK;
836834
val |= (GEN3_GEN4_EQ_PRESET_INIT <<
837835
PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT);
838-
dw_pcie_write(pci->dbi_base + offset + i, 1, val);
836+
dw_pcie_writeb_dbi(pci, offset + i, val);
839837
}
840838

841839
val = dw_pcie_readl_dbi(pci, GEN3_RELATED_OFF);

0 commit comments

Comments
 (0)