From 29a3e3db2da1cfa7579b94deacfc1ec5eb79355f Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Wed, 6 Jan 2016 18:18:07 +0100 Subject: PCI: imx6: improve GEN2 disable handling Improve GEN2 disable handling more in-line with how Gateworks did it in their gateworks_fslc_3.14_1.0.x_ga branch on github. Signed-off-by: Marcel Ziswiler Acked-by: Max Krummenacher --- drivers/pci/host/pci-imx6.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index fb01d6110d31..5dd6a33293bd 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -500,9 +500,8 @@ static int imx6_pcie_start_link(struct pcie_port *pp) struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); uint32_t tmp; int ret; -#ifndef CONFIG_PCI_FORCE_GEN1 int count; -#endif + /* * Force Gen1 operation when starting the link. In case the link is * started in Gen2 mode, there is a possibility the devices on the @@ -528,6 +527,9 @@ static int imx6_pcie_start_link(struct pcie_port *pp) tmp &= ~PCIE_RC_LCR_MAX_LINK_SPEEDS_MASK; tmp |= PCIE_RC_LCR_MAX_LINK_SPEEDS_GEN2; writel(tmp, pp->dbi_base + PCIE_RC_LCR); +#else + dev_info(pp->dev, "Configuration forces GEN1\n"); +#endif /* CONFIG_PCI_FORCE_GEN1 */ /* * Start Directed Speed Change so the best possible speed both link @@ -551,9 +553,6 @@ static int imx6_pcie_start_link(struct pcie_port *pp) ret = imx6_pcie_wait_for_link(pp); else ret = -EINVAL; -#else - dev_info(pp->dev, "Configuration forces GEN1\n"); -#endif /* CONFIG_PCI_FORCE_GEN1 */ out: if (ret) { -- cgit v1.2.3