Skip to content

Commit

Permalink
PCI: dwc/intel-gw: Move ATU offset out of driver match data
Browse files Browse the repository at this point in the history
The ATU offset should be a register range in DT called 'atu', not driver
match data. Any future platforms with a different ATU offset should add
it to their DT.

This is also in preparation to do DBI resource setup in the core DWC
code, so let's move setting atu_base later in intel_pcie_rc_setup().

Link: https://lore.kernel.org/r/20201105211159.1814485-3-robh@kernel.org
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
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>
  • Loading branch information
Rob Herring authored and Lorenzo Pieralisi committed Nov 19, 2020
1 parent 74081de commit 1d567aa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/pci/controller/dwc/pcie-intel-gw.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@

struct intel_pcie_soc {
unsigned int pcie_ver;
unsigned int pcie_atu_offset;
u32 num_viewport;
};

Expand Down Expand Up @@ -155,11 +154,15 @@ static void intel_pcie_init_n_fts(struct dw_pcie *pci)

static void intel_pcie_rc_setup(struct intel_pcie_port *lpp)
{
struct dw_pcie *pci = &lpp->pci;

pci->atu_base = pci->dbi_base + 0xC0000;

intel_pcie_ltssm_disable(lpp);
intel_pcie_link_setup(lpp);
intel_pcie_init_n_fts(&lpp->pci);
dw_pcie_setup_rc(&lpp->pci.pp);
dw_pcie_upconfig_setup(&lpp->pci);
intel_pcie_init_n_fts(pci);
dw_pcie_setup_rc(&pci->pp);
dw_pcie_upconfig_setup(pci);
}

static int intel_pcie_ep_rst_init(struct intel_pcie_port *lpp)
Expand Down Expand Up @@ -425,7 +428,6 @@ static const struct dw_pcie_host_ops intel_pcie_dw_ops = {

static const struct intel_pcie_soc pcie_data = {
.pcie_ver = 0x520A,
.pcie_atu_offset = 0xC0000,
.num_viewport = 3,
};

Expand Down Expand Up @@ -461,7 +463,6 @@ static int intel_pcie_probe(struct platform_device *pdev)

pci->ops = &intel_pcie_ops;
pci->version = data->pcie_ver;
pci->atu_base = pci->dbi_base + data->pcie_atu_offset;
pp->ops = &intel_pcie_dw_ops;

ret = dw_pcie_host_init(pp);
Expand Down

0 comments on commit 1d567aa

Please sign in to comment.