All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] pci: pcie_imx: Fix hang on mx6qp
Date: Thu, 8 Oct 2015 22:58:43 +0200	[thread overview]
Message-ID: <201510082258.43592.marex@denx.de> (raw)
In-Reply-To: <1444319367-31066-1-git-send-email-fabio.estevam@freescale.com>

On Thursday, October 08, 2015 at 05:49:27 PM, Fabio Estevam wrote:
> PCI driver currently hangs on mx6qp.
> 
> Toggle the reset bit with the appropriate timings to fix the issue.
> 
> Based on the FSL kernel driver implementation.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  arch/arm/include/asm/arch-mx6/iomux.h |  2 ++
>  drivers/pci/pcie_imx.c                | 14 ++++++++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-mx6/iomux.h
> b/arch/arm/include/asm/arch-mx6/iomux.h index 9b3a91f..e3ef59f 100644
> --- a/arch/arm/include/asm/arch-mx6/iomux.h
> +++ b/arch/arm/include/asm/arch-mx6/iomux.h
> @@ -18,6 +18,8 @@
>  #define IOMUXC_GPR1_REF_SSP_EN			(1 << 16)
>  #define IOMUXC_GPR1_TEST_POWERDOWN		(1 << 18)
> 
> +#define IOMUXC_GPR1_PCIE_SW_RST 		(1 << 29)
> +
>  /*
>   * IOMUXC_GPR5 bit fields
>   */
> diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c
> index 1568f20..ddfe389 100644
> --- a/drivers/pci/pcie_imx.c
> +++ b/drivers/pci/pcie_imx.c
> @@ -19,6 +19,7 @@
>  #include <asm/io.h>
>  #include <linux/sizes.h>
>  #include <errno.h>
> +#include <asm/arch/sys_proto.h>
> 
>  #define PCI_ACCESS_READ  0
>  #define PCI_ACCESS_WRITE 1
> @@ -430,6 +431,10 @@ static int imx_pcie_write_config(struct pci_controller
> *hose, pci_dev_t d, static int imx6_pcie_assert_core_reset(void)
>  {
>  	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
> +
> +	if (is_mx6dqp())
> +		setbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_PCIE_SW_RST);
> +
>  #if defined(CONFIG_MX6SX)
>  	struct gpc *gpc_regs = (struct gpc *)GPC_BASE_ADDR;
> 
> @@ -542,6 +547,15 @@ static int imx6_pcie_deassert_core_reset(void)
>  	 */
>  	mdelay(50);
> 
> +	if (is_mx6dqp()) {
> +		clrbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_PCIE_SW_RST);

Why don't you put this section before the mdelay(50) above ? This should
produce the same effect as adding additional delay, as you do below, no?

> +		/*
> +		 * some delay is required by 6qp, after the SW_RST is

The sentence should start with capital letter.

> +		 * cleared and before accessing the cfg register.
> +		 */
> +		udelay(200);
> +	}
> +
>  #if defined(CONFIG_MX6SX)
>  	/* SSP_EN is not used on MX6SX anymore */
>  	clrbits_le32(&iomuxc_regs->gpr[12], IOMUXC_GPR12_TEST_POWERDOWN);

Best regards,
Marek Vasut

  parent reply	other threads:[~2015-10-08 20:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 15:49 [U-Boot] [PATCH] pci: pcie_imx: Fix hang on mx6qp Fabio Estevam
2015-10-08 17:55 ` Tim Harvey
2015-10-08 21:08   ` Fabio Estevam
2015-10-08 20:58 ` Marek Vasut [this message]
2015-10-08 21:19   ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201510082258.43592.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.