public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4] pci: pcie_imx: Fix hang on mx6qp
@ 2015-10-13 14:01 Fabio Estevam
  2015-10-15  8:50 ` Stefano Babic
  2015-10-15 13:05 ` [U-Boot] [U-Boot,v4] " Tom Rini
  0 siblings, 2 replies; 5+ messages in thread
From: Fabio Estevam @ 2015-10-13 14:01 UTC (permalink / raw)
  To: u-boot

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>
---
Changes since v3:
- Remove blank line from commit log
Changes since v2:
- Remove unneeded blank line (Bin)

 arch/arm/include/asm/arch-mx6/iomux.h | 2 ++
 drivers/pci/pcie_imx.c                | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/arch/arm/include/asm/arch-mx6/iomux.h b/arch/arm/include/asm/arch-mx6/iomux.h
index 9b3a91f..907cb40 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..f1e189e 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;
 
@@ -536,6 +541,9 @@ static int imx6_pcie_deassert_core_reset(void)
 
 	enable_pcie_clock();
 
+	if (is_mx6dqp())
+		clrbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_PCIE_SW_RST);
+
 	/*
 	 * Wait for the clock to settle a bit, when the clock are sourced
 	 * from the CPU, we need about 30 ms to settle.
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v4] pci: pcie_imx: Fix hang on mx6qp
  2015-10-13 14:01 [U-Boot] [PATCH v4] pci: pcie_imx: Fix hang on mx6qp Fabio Estevam
@ 2015-10-15  8:50 ` Stefano Babic
  2015-10-15 12:23   ` Fabio Estevam
  2015-10-15 13:05 ` [U-Boot] [U-Boot,v4] " Tom Rini
  1 sibling, 1 reply; 5+ messages in thread
From: Stefano Babic @ 2015-10-15  8:50 UTC (permalink / raw)
  To: u-boot

On 13/10/2015 16:01, 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>
> ---
> Changes since v3:
> - Remove blank line from commit log
> Changes since v2:
> - Remove unneeded blank line (Bin)
> 
>  arch/arm/include/asm/arch-mx6/iomux.h | 2 ++
>  drivers/pci/pcie_imx.c                | 8 ++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-mx6/iomux.h b/arch/arm/include/asm/arch-mx6/iomux.h
> index 9b3a91f..907cb40 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..f1e189e 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;
>  
> @@ -536,6 +541,9 @@ static int imx6_pcie_deassert_core_reset(void)
>  
>  	enable_pcie_clock();
>  
> +	if (is_mx6dqp())
> +		clrbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_PCIE_SW_RST);
> +
>  	/*
>  	 * Wait for the clock to settle a bit, when the clock are sourced
>  	 * from the CPU, we need about 30 ms to settle.
> 

Thanks Fabio - as fix, I pick it up for the release.

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v4] pci: pcie_imx: Fix hang on mx6qp
  2015-10-15  8:50 ` Stefano Babic
@ 2015-10-15 12:23   ` Fabio Estevam
  2015-10-15 12:37     ` Stefano Babic
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2015-10-15 12:23 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On Thu, Oct 15, 2015 at 5:50 AM, Stefano Babic <sbabic@denx.de> wrote:

> Thanks Fabio - as fix, I pick it up for the release.

I don't see this one included in your pull request for Tom.

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v4] pci: pcie_imx: Fix hang on mx6qp
  2015-10-15 12:23   ` Fabio Estevam
@ 2015-10-15 12:37     ` Stefano Babic
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Babic @ 2015-10-15 12:37 UTC (permalink / raw)
  To: u-boot

On 15/10/2015 14:23, Fabio Estevam wrote:
> Hi Stefano,
> 
> On Thu, Oct 15, 2015 at 5:50 AM, Stefano Babic <sbabic@denx.de> wrote:
> 
>> Thanks Fabio - as fix, I pick it up for the release.
> 
> I don't see this one included in your pull request for Tom.
> 


Aargh ! Thanks for noting this, I am fixing it.

Regards,
Stefano


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [U-Boot,v4] pci: pcie_imx: Fix hang on mx6qp
  2015-10-13 14:01 [U-Boot] [PATCH v4] pci: pcie_imx: Fix hang on mx6qp Fabio Estevam
  2015-10-15  8:50 ` Stefano Babic
@ 2015-10-15 13:05 ` Tom Rini
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2015-10-15 13:05 UTC (permalink / raw)
  To: u-boot

On Tue, Oct 13, 2015 at 11:01:27AM -0300, 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>
> Acked-by: Stefano Babic <sbabic@denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151015/33697a38/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-15 13:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 14:01 [U-Boot] [PATCH v4] pci: pcie_imx: Fix hang on mx6qp Fabio Estevam
2015-10-15  8:50 ` Stefano Babic
2015-10-15 12:23   ` Fabio Estevam
2015-10-15 12:37     ` Stefano Babic
2015-10-15 13:05 ` [U-Boot] [U-Boot,v4] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox