linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto.
@ 2014-10-20  5:25 Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 1/9] PCI: designware: Refine setup_rc and add msi data restore Richard Zhu
                   ` (9 more replies)
  0 siblings, 10 replies; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci; +Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2

Main changes since the v6(v7 is ignored):
1. Regarding to Lucas' suggestion, assert per-reset in suspend,
and de-assert it in resume.
2. Use pp->ops->get_msi_data in dw_pcie_msi_cfg_restore()
if there is one get_msi_data pp ops callback, refer to Muali's comment.
3. In order to avoid the compilation, squash imx6 changes with patch2-5
of v6, since the prototype of the host_init is changed.


[PATCH v8 1/9] PCI: designware: Refine setup_rc and add msi data
[PATCH v8 2/9] PCI: designware: Fix one potential assignment error of
[PATCH v8 3/9] ARM: imx6sx: Add imx6sx pcie related gpr bits
[PATCH v8 4/9] PCI: imx6: Wait the clocks to stabilize after ref_en
[PATCH v8 5/9] PCI: imx6: Add imx6sx pcie support
[PATCH v8 6/9] ARM: imx6qdl: Enable pcie on imx6qdl sabreauto
[PATCH v8 7/9] ARM: imx6: Update dts and binding for imx6sx pcie
[PATCH v8 8/9] ARM: imx6sx: Add syscon into gpc dts
[PATCH v8 9/9] ARM: imx6sx: Enable pcie on imx6sx sdb board

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

* [PATCH v8 1/9] PCI: designware: Refine setup_rc and add msi data restore
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
@ 2014-10-20  5:25 ` Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 2/9] PCI: designware: Fix one potential assignment error of cfg start Richard Zhu
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci
  Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2, Richard Zhu,
	Richard Zhu

From: Richard Zhu <r65037@freescale.com>

- move "program correct class for RC" from dw_pcie_host_init()
to dw_pcie_setup_rc(). since this is RC setup, it's
better to contained in dw_pcie_setup_rc function.
Then, RC can be re-setup really by dw_pcie_setup_rc().

- add one store/re-store msi cfg functions. Because that
pcie controller maybe powered off during system suspend,
and the msi data configuration would be lost.
these functions can be used to store/restore the msi data
and msi_enable during the suspend/resume callback.
  * all the four msi enable register are stored/re-stored.
  * use pp->ops->get_msi_data if there is get_msi_data
  callback.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
---
 drivers/pci/host/pcie-designware.c | 41 +++++++++++++++++++++++++++++++++++---
 drivers/pci/host/pcie-designware.h |  6 ++++++
 2 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 538bbf3..8d1c809 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -44,6 +44,15 @@
 #define PCIE_MSI_INTR0_ENABLE		0x828
 #define PCIE_MSI_INTR0_MASK		0x82C
 #define PCIE_MSI_INTR0_STATUS		0x830
+#define PCIE_MSI_INTR1_ENABLE		0x834
+#define PCIE_MSI_INTR1_MASK		0x838
+#define PCIE_MSI_INTR1_STATUS		0x83C
+#define PCIE_MSI_INTR2_ENABLE		0x840
+#define PCIE_MSI_INTR2_MASK		0x844
+#define PCIE_MSI_INTR2_STATUS		0x848
+#define PCIE_MSI_INTR3_ENABLE		0x84C
+#define PCIE_MSI_INTR3_MASK		0x850
+#define PCIE_MSI_INTR3_STATUS		0x854
 
 #define PCIE_ATU_VIEWPORT		0x900
 #define PCIE_ATU_REGION_INBOUND		(0x1 << 31)
@@ -194,6 +203,32 @@ void dw_pcie_msi_init(struct pcie_port *pp)
 	dw_pcie_wr_own_conf(pp, PCIE_MSI_ADDR_HI, 4, 0);
 }
 
+void dw_pcie_msi_cfg_store(struct pcie_port *pp)
+{
+	dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR0_ENABLE, 4, &pp->msi_int0_enable);
+	dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR1_ENABLE, 4, &pp->msi_int1_enable);
+	dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR2_ENABLE, 4, &pp->msi_int2_enable);
+	dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR3_ENABLE, 4, &pp->msi_int3_enable);
+}
+
+void dw_pcie_msi_cfg_restore(struct pcie_port *pp)
+{
+	u32 address_lo;
+
+	if (pp->ops->get_msi_data)
+		address_lo = pp->ops->get_msi_data(pp);
+	else
+		address_lo = virt_to_phys((void *)pp->msi_data);
+
+	dw_pcie_wr_own_conf(pp, PCIE_MSI_ADDR_LO, 4, address_lo);
+	dw_pcie_wr_own_conf(pp, PCIE_MSI_ADDR_HI, 4, 0);
+
+	dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE, 4, pp->msi_int0_enable);
+	dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR1_ENABLE, 4, pp->msi_int1_enable);
+	dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR2_ENABLE, 4, pp->msi_int2_enable);
+	dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR3_ENABLE, 4, pp->msi_int3_enable);
+}
+
 static int find_valid_pos0(struct pcie_port *pp, int msgvec, int pos, int *pos0)
 {
 	int flag = 1;
@@ -570,9 +605,6 @@ int __init dw_pcie_host_init(struct pcie_port *pp)
 
 	dw_pcie_wr_own_conf(pp, PCI_BASE_ADDRESS_0, 4, 0);
 
-	/* program correct class for RC */
-	dw_pcie_wr_own_conf(pp, PCI_CLASS_DEVICE, 2, PCI_CLASS_BRIDGE_PCI);
-
 	dw_pcie_rd_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, &val);
 	val |= PORT_LOGIC_SPEED_CHANGE;
 	dw_pcie_wr_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, val);
@@ -917,6 +949,9 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
 	val = memlimit | membase;
 	dw_pcie_writel_rc(pp, val, PCI_MEMORY_BASE);
 
+	/* program correct class for RC */
+	dw_pcie_wr_own_conf(pp, PCI_CLASS_DEVICE, 2, PCI_CLASS_BRIDGE_PCI);
+
 	/* setup command register */
 	dw_pcie_readl_rc(pp, PCI_COMMAND, &val);
 	val &= 0xffff0000;
diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h
index a476e60..1a59600 100644
--- a/drivers/pci/host/pcie-designware.h
+++ b/drivers/pci/host/pcie-designware.h
@@ -56,6 +56,10 @@ struct pcie_port {
 	int			msi_irq;
 	struct irq_domain	*irq_domain;
 	unsigned long		msi_data;
+	unsigned int		msi_int0_enable;
+	unsigned int		msi_int1_enable;
+	unsigned int		msi_int2_enable;
+	unsigned int		msi_int3_enable;
 	DECLARE_BITMAP(msi_irq_in_use, MAX_MSI_IRQS);
 };
 
@@ -83,6 +87,8 @@ int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);
 int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val);
 irqreturn_t dw_handle_msi_irq(struct pcie_port *pp);
 void dw_pcie_msi_init(struct pcie_port *pp);
+void dw_pcie_msi_cfg_store(struct pcie_port *pp);
+void dw_pcie_msi_cfg_restore(struct pcie_port *pp);
 int dw_pcie_link_up(struct pcie_port *pp);
 void dw_pcie_setup_rc(struct pcie_port *pp);
 int dw_pcie_host_init(struct pcie_port *pp);
-- 
1.9.1


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

* [PATCH v8 2/9] PCI: designware: Fix one potential assignment error of cfg start
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 1/9] PCI: designware: Refine setup_rc and add msi data restore Richard Zhu
@ 2014-10-20  5:25 ` Richard Zhu
  2014-10-21 10:27   ` Lucas Stach
  2014-10-20  5:25 ` [PATCH v8 3/9] ARM: imx6sx: Add imx6sx pcie related gpr bits definitions Richard Zhu
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci
  Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2, Richard Zhu,
	Richard Zhu

From: Richard Zhu <r65037@freescale.com>

if va_cfg0_base/va_cfg1_base are initialized by
designware core, the pp->cfg.start is not initialized
properly, when IORESOURCE_MEM "config" is represented
as cfg space resource.
solution: assign cfg_res->start to pp->cfg.start.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
---
 drivers/pci/host/pcie-designware.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 8d1c809..e3cd54a 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -472,6 +472,7 @@ int __init dw_pcie_host_init(struct pcie_port *pp)
 	if (cfg_res) {
 		pp->config.cfg0_size = resource_size(cfg_res)/2;
 		pp->config.cfg1_size = resource_size(cfg_res)/2;
+		pp->cfg.start = cfg_res->start;
 		pp->cfg0_base = cfg_res->start;
 		pp->cfg1_base = cfg_res->start + pp->config.cfg0_size;
 
-- 
1.9.1


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

* [PATCH v8 3/9] ARM: imx6sx: Add imx6sx pcie related gpr bits definitions
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 1/9] PCI: designware: Refine setup_rc and add msi data restore Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 2/9] PCI: designware: Fix one potential assignment error of cfg start Richard Zhu
@ 2014-10-20  5:25 ` Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 4/9] PCI: imx6: Wait the clocks to stabilize after ref_en Richard Zhu
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci
  Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2, Richard Zhu,
	Richard Zhu

From: Richard Zhu <r65037@freescale.com>

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
---
 include/linux/mfd/syscon/imx6q-iomuxc-gpr.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
index ff44374..3273b87 100644
--- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
+++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
@@ -301,6 +301,7 @@
 #define IMX6Q_GPR12_DEVICE_TYPE			(0xf << 12)
 #define IMX6Q_GPR12_PCIE_CTL_2			BIT(10)
 #define IMX6Q_GPR12_LOS_LEVEL			(0x1f << 4)
+#define IMX6Q_GPR12_LOS_LEVEL_9			(0x9 << 4)
 
 #define IMX6Q_GPR13_SDMA_STOP_REQ		BIT(30)
 #define IMX6Q_GPR13_CAN2_STOP_REQ		BIT(29)
@@ -395,4 +396,12 @@
 #define IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK    (0x3 << 17)
 #define IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK    (0x1 << 14)
 
+/* For imx6sx iomux gpr register field define */
+#define IMX6SX_GPR5_PCIE_BTNRST			BIT(19)
+#define IMX6SX_GPR5_PCIE_PERST			BIT(18)
+
+#define IMX6SX_GPR12_PCIE_PM_TURN_OFF		BIT(16)
+#define IMX6SX_GPR12_PCIE_TEST_PD		BIT(30)
+#define IMX6SX_GPR12_RX_EQ_MASK			(0x7 << 0)
+#define IMX6SX_GPR12_RX_EQ_2			(0x2 << 0)
 #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */
-- 
1.9.1


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

* [PATCH v8 4/9] PCI: imx6: Wait the clocks to stabilize after ref_en
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
                   ` (2 preceding siblings ...)
  2014-10-20  5:25 ` [PATCH v8 3/9] ARM: imx6sx: Add imx6sx pcie related gpr bits definitions Richard Zhu
@ 2014-10-20  5:25 ` Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 5/9] PCI: imx6: Add imx6sx pcie support Richard Zhu
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci
  Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2, Richard Zhu,
	Richard Zhu

From: Richard Zhu <r65037@freescale.com>

For boards without a reset gpio we skip the delay between enabling
the pcie_ref_clk and touching the RC registers for configuration.
System would be hangs when the clocks are not yet settled in the DW
PCIe core. So we need to make sure that there is always an
appropriate delay between those two actions.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
Tested-by: Tim Harvey <tharvey@gateworks.com>
---
 drivers/pci/host/pci-imx6.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index 233fe8a..eac96fb 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -275,15 +275,22 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
 		goto err_pcie;
 	}
 
-	/* allow the clocks to stabilize */
-	usleep_range(200, 500);
-
 	/* power up core phy and enable ref clock */
 	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
 			IMX6Q_GPR1_PCIE_TEST_PD, 0 << 18);
+	/*
+	 * the async reset input need ref clock to sync internally,
+	 * when the ref clock comes after reset, internal synced
+	 * reset time is too short , cannot meet the requirement.
+	 * add one ~10us delay here.
+	 */
+	udelay(10);
 	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
 			IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
 
+	/* allow the clocks to stabilize */
+	usleep_range(200, 500);
+
 	/* Some boards don't have PCIe reset GPIO. */
 	if (gpio_is_valid(imx6_pcie->reset_gpio)) {
 		gpio_set_value(imx6_pcie->reset_gpio, 0);
-- 
1.9.1


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

* [PATCH v8 5/9] PCI: imx6: Add imx6sx pcie support
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
                   ` (3 preceding siblings ...)
  2014-10-20  5:25 ` [PATCH v8 4/9] PCI: imx6: Wait the clocks to stabilize after ref_en Richard Zhu
@ 2014-10-20  5:25 ` Richard Zhu
  2014-10-27 18:24   ` Murali Karicheri
  2014-10-20  5:25 ` [PATCH v8 6/9] ARM: imx6qdl: Enable pcie on imx6qdl sabreauto Richard Zhu
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci
  Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2, Richard Zhu,
	Richard Zhu

From: Richard Zhu <r65037@freescale.com>

- imx6sx pcie has its own standalone pcie power supply.
In order to turn on the imx6sx pcie power during
initialization. Add the pcie regulator and the gpc regmap
into the imx6sx pcie structure.
- imx6sx pcie has the new added reset mechanism, add the
reset operations into the initialization.
- disp_axi clock is required by pcie inbound axi port actually.
Add one more clock named pcie_inbound_axi for imx6sx pcie.
- register one PM call-back, enter/exit L2 state during
system suspend/resume.
  * use noirq pm_ops instead of the general pm_ops in
  dev_pm_ops, since cfg read/write may occurs after suspend
  and before resume.
  * do msi store/re-store in suspend/resume callbacks, since
  controller maybe turned off, and these msi cfg maybe lost
  in suspend.
  * assert per-reset in suspend, and de-assert it in resume.
- host init maybe failed, change the func type of host_init
defined in struct pci_host_ops from void to int.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
---
 drivers/pci/host/pci-dra7xx.c      |   4 +-
 drivers/pci/host/pci-exynos.c      |   4 +-
 drivers/pci/host/pci-imx6.c        | 265 ++++++++++++++++++++++++++++++-------
 drivers/pci/host/pcie-designware.c |   7 +-
 drivers/pci/host/pcie-designware.h |   2 +-
 drivers/pci/host/pcie-spear13xx.c  |   4 +-
 6 files changed, 232 insertions(+), 54 deletions(-)

diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 52b34fe..7b11968 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -141,13 +141,15 @@ static void dra7xx_pcie_enable_interrupts(struct pcie_port *pp)
 				   LEG_EP_INTERRUPTS);
 }
 
-static void dra7xx_pcie_host_init(struct pcie_port *pp)
+static int dra7xx_pcie_host_init(struct pcie_port *pp)
 {
 	dw_pcie_setup_rc(pp);
 	dra7xx_pcie_establish_link(pp);
 	if (IS_ENABLED(CONFIG_PCI_MSI))
 		dw_pcie_msi_init(pp);
 	dra7xx_pcie_enable_interrupts(pp);
+
+	return 0;
 }
 
 static struct pcie_host_ops dra7xx_pcie_host_ops = {
diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c
index c5d0ca3..606d0a9 100644
--- a/drivers/pci/host/pci-exynos.c
+++ b/drivers/pci/host/pci-exynos.c
@@ -494,10 +494,12 @@ static int exynos_pcie_link_up(struct pcie_port *pp)
 	return 0;
 }
 
-static void exynos_pcie_host_init(struct pcie_port *pp)
+static int exynos_pcie_host_init(struct pcie_port *pp)
 {
 	exynos_pcie_establish_link(pp);
 	exynos_pcie_enable_interrupts(pp);
+
+	return 0;
 }
 
 static struct pcie_host_ops exynos_pcie_host_ops = {
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index eac96fb..5d5abe1 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -22,6 +22,7 @@
 #include <linux/pci.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
 #include <linux/resource.h>
 #include <linux/signal.h>
 #include <linux/types.h>
@@ -35,9 +36,12 @@ struct imx6_pcie {
 	int			reset_gpio;
 	struct clk		*pcie_bus;
 	struct clk		*pcie_phy;
+	struct clk		*pcie_inbound_axi;
 	struct clk		*pcie;
 	struct pcie_port	pp;
 	struct regmap		*iomuxc_gpr;
+	struct regmap		*gpc_ips_reg;
+	struct regulator	*pcie_phy_regulator;
 	void __iomem		*mem_base;
 };
 
@@ -77,6 +81,18 @@ struct imx6_pcie {
 #define PHY_RX_OVRD_IN_LO_RX_DATA_EN (1 << 5)
 #define PHY_RX_OVRD_IN_LO_RX_PLL_EN (1 << 3)
 
+/* GPC PCIE PHY bit definitions */
+#define GPC_CNTR			0
+#define GPC_CNTR_PCIE_PHY_PUP_REQ	BIT(7)
+
+static inline bool is_imx6sx_pcie(struct imx6_pcie *imx6_pcie)
+{
+	struct pcie_port *pp = &imx6_pcie->pp;
+	struct device_node *np = pp->dev->of_node;
+
+	return of_device_is_compatible(np, "fsl,imx6sx-pcie");
+}
+
 static int pcie_phy_poll_ack(void __iomem *dbi_base, int exp_val)
 {
 	u32 val;
@@ -219,35 +235,46 @@ static int imx6_pcie_assert_core_reset(struct pcie_port *pp)
 	struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp);
 	u32 val, gpr1, gpr12;
 
-	/*
-	 * If the bootloader already enabled the link we need some special
-	 * handling to get the core back into a state where it is safe to
-	 * touch it for configuration.  As there is no dedicated reset signal
-	 * wired up for MX6QDL, we need to manually force LTSSM into "detect"
-	 * state before completely disabling LTSSM, which is a prerequisite
-	 * for core configuration.
-	 *
-	 * If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have a strong
-	 * indication that the bootloader activated the link.
-	 */
-	regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, &gpr1);
-	regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, &gpr12);
-
-	if ((gpr1 & IMX6Q_GPR1_PCIE_REF_CLK_EN) &&
-	    (gpr12 & IMX6Q_GPR12_PCIE_CTL_2)) {
-		val = readl(pp->dbi_base + PCIE_PL_PFLR);
-		val &= ~PCIE_PL_PFLR_LINK_STATE_MASK;
-		val |= PCIE_PL_PFLR_FORCE_LINK;
-		writel(val, pp->dbi_base + PCIE_PL_PFLR);
-
+	if (is_imx6sx_pcie(imx6_pcie)) {
 		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
-				IMX6Q_GPR12_PCIE_CTL_2, 0 << 10);
-	}
+				IMX6SX_GPR12_PCIE_TEST_PD,
+				IMX6SX_GPR12_PCIE_TEST_PD);
+		/* Force PCIe PHY reset */
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR5,
+				IMX6SX_GPR5_PCIE_BTNRST,
+				IMX6SX_GPR5_PCIE_BTNRST);
+	} else {
+		/*
+		 * If the bootloader already enabled the link we need some
+		 * special handling to get the core back into a state where
+		 * it is safe to touch it for configuration.  As there is no
+		 * dedicated reset signal to manually force LTSSM into "detect"
+		 * state before completely disabling LTSSM, which is a
+		 * prerequisite for core configuration.
+		 *
+		 * If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have
+		 * a strong indication that the bootloader activated the link.
+		 */
+		regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, &gpr1);
+		regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, &gpr12);
+
+		if ((gpr1 & IMX6Q_GPR1_PCIE_REF_CLK_EN) &&
+		    (gpr12 & IMX6Q_GPR12_PCIE_CTL_2)) {
+			val = readl(pp->dbi_base + PCIE_PL_PFLR);
+			val &= ~PCIE_PL_PFLR_LINK_STATE_MASK;
+			val |= PCIE_PL_PFLR_FORCE_LINK;
+			writel(val, pp->dbi_base + PCIE_PL_PFLR);
+
+			regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
+					IMX6Q_GPR12_PCIE_CTL_2, 0);
+		}
 
-	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
-			IMX6Q_GPR1_PCIE_TEST_PD, 1 << 18);
-	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
-			IMX6Q_GPR1_PCIE_REF_CLK_EN, 0 << 16);
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
+				IMX6Q_GPR1_PCIE_TEST_PD,
+				IMX6Q_GPR1_PCIE_TEST_PD);
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
+				IMX6Q_GPR1_PCIE_REF_CLK_EN, 0);
+	}
 
 	return 0;
 }
@@ -275,18 +302,30 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
 		goto err_pcie;
 	}
 
-	/* power up core phy and enable ref clock */
-	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
-			IMX6Q_GPR1_PCIE_TEST_PD, 0 << 18);
-	/*
-	 * the async reset input need ref clock to sync internally,
-	 * when the ref clock comes after reset, internal synced
-	 * reset time is too short , cannot meet the requirement.
-	 * add one ~10us delay here.
-	 */
-	udelay(10);
-	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
-			IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
+	if (is_imx6sx_pcie(imx6_pcie)) {
+		ret = clk_prepare_enable(imx6_pcie->pcie_inbound_axi);
+		if (ret) {
+			dev_err(pp->dev, "unable to enable pcie clock\n");
+			goto err_inbound_axi;
+		}
+
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
+				IMX6SX_GPR12_PCIE_TEST_PD, 0);
+	} else {
+		/* power up core phy and enable ref clock */
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
+				IMX6Q_GPR1_PCIE_TEST_PD, 0);
+		/*
+		 * the async reset input need ref clock to sync internally,
+		 * when the ref clock comes after reset, internal synced
+		 * reset time is too short , cannot meet the requirement.
+		 * add one ~10us delay here.
+		 */
+		udelay(10);
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
+				IMX6Q_GPR1_PCIE_REF_CLK_EN,
+				IMX6Q_GPR1_PCIE_REF_CLK_EN);
+	}
 
 	/* allow the clocks to stabilize */
 	usleep_range(200, 500);
@@ -297,8 +336,19 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
 		msleep(100);
 		gpio_set_value(imx6_pcie->reset_gpio, 1);
 	}
+
+	/*
+	 * Release the PCIe PHY reset here, that we have set in
+	 * imx6_pcie_assert_core_reset() now
+	 */
+	if (is_imx6sx_pcie(imx6_pcie))
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR5,
+				IMX6SX_GPR5_PCIE_BTNRST, 0);
+
 	return 0;
 
+err_inbound_axi:
+	clk_disable_unprepare(imx6_pcie->pcie);
 err_pcie:
 	clk_disable_unprepare(imx6_pcie->pcie_bus);
 err_pcie_bus:
@@ -308,9 +358,26 @@ err_pcie_phy:
 
 }
 
-static void imx6_pcie_init_phy(struct pcie_port *pp)
+static int imx6_pcie_init_phy(struct pcie_port *pp)
 {
 	struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp);
+	int ret;
+
+	/* Power up the separate domain available on i.MX6SX */
+	if (is_imx6sx_pcie(imx6_pcie)) {
+		regmap_update_bits(imx6_pcie->gpc_ips_reg, GPC_CNTR,
+				GPC_CNTR_PCIE_PHY_PUP_REQ,
+				GPC_CNTR_PCIE_PHY_PUP_REQ);
+		regulator_set_voltage(imx6_pcie->pcie_phy_regulator,
+				1100000, 1100000);
+		ret = regulator_enable(imx6_pcie->pcie_phy_regulator);
+		if (ret) {
+			dev_err(pp->dev, "failed to enable pcie regulator.\n");
+			return ret;
+		}
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
+				IMX6SX_GPR12_RX_EQ_MASK, IMX6SX_GPR12_RX_EQ_2);
+	}
 
 	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
 			IMX6Q_GPR12_PCIE_CTL_2, 0 << 10);
@@ -319,7 +386,7 @@ static void imx6_pcie_init_phy(struct pcie_port *pp)
 	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
 			IMX6Q_GPR12_DEVICE_TYPE, PCI_EXP_TYPE_ROOT_PORT << 12);
 	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
-			IMX6Q_GPR12_LOS_LEVEL, 9 << 4);
+			IMX6Q_GPR12_LOS_LEVEL, IMX6Q_GPR12_LOS_LEVEL_9);
 
 	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR8,
 			IMX6Q_GPR8_TX_DEEMPH_GEN1, 0 << 0);
@@ -331,6 +398,8 @@ static void imx6_pcie_init_phy(struct pcie_port *pp)
 			IMX6Q_GPR8_TX_SWING_FULL, 127 << 18);
 	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR8,
 			IMX6Q_GPR8_TX_SWING_LOW, 127 << 25);
+
+	return 0;
 }
 
 static int imx6_pcie_wait_for_link(struct pcie_port *pp)
@@ -377,7 +446,8 @@ static int imx6_pcie_start_link(struct pcie_port *pp)
 
 	/* Start LTSSM. */
 	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
-			IMX6Q_GPR12_PCIE_CTL_2, 1 << 10);
+			IMX6Q_GPR12_PCIE_CTL_2,
+			IMX6Q_GPR12_PCIE_CTL_2);
 
 	ret = imx6_pcie_wait_for_link(pp);
 	if (ret)
@@ -422,13 +492,19 @@ static int imx6_pcie_start_link(struct pcie_port *pp)
 	return ret;
 }
 
-static void imx6_pcie_host_init(struct pcie_port *pp)
+static int imx6_pcie_host_init(struct pcie_port *pp)
 {
+	int ret;
+
 	imx6_pcie_assert_core_reset(pp);
 
-	imx6_pcie_init_phy(pp);
+	ret = imx6_pcie_init_phy(pp);
+	if (ret < 0)
+		return ret;
 
-	imx6_pcie_deassert_core_reset(pp);
+	ret = imx6_pcie_deassert_core_reset(pp);
+	if (ret < 0)
+		return ret;
 
 	dw_pcie_setup_rc(pp);
 
@@ -436,6 +512,8 @@ static void imx6_pcie_host_init(struct pcie_port *pp)
 
 	if (IS_ENABLED(CONFIG_PCI_MSI))
 		dw_pcie_msi_init(pp);
+
+	return 0;
 }
 
 static void imx6_pcie_reset_phy(struct pcie_port *pp)
@@ -553,6 +631,76 @@ static int __init imx6_add_pcie_port(struct pcie_port *pp,
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int pci_imx_suspend_noirq(struct device *dev)
+{
+	struct imx6_pcie *imx6_pcie = dev_get_drvdata(dev);
+	struct pcie_port *pp = &imx6_pcie->pp;
+
+	if (is_imx6sx_pcie(imx6_pcie)) {
+		if (IS_ENABLED(CONFIG_PCI_MSI))
+			dw_pcie_msi_cfg_store(pp);
+
+		/* PM_TURN_OFF */
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
+				IMX6SX_GPR12_PCIE_PM_TURN_OFF,
+				IMX6SX_GPR12_PCIE_PM_TURN_OFF);
+		udelay(10);
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
+				IMX6SX_GPR12_PCIE_PM_TURN_OFF, 0);
+		clk_disable_unprepare(imx6_pcie->pcie);
+		clk_disable_unprepare(imx6_pcie->pcie_bus);
+		clk_disable_unprepare(imx6_pcie->pcie_phy);
+		clk_disable_unprepare(imx6_pcie->pcie_inbound_axi);
+
+		/* Assert per-reset to ep */
+		gpio_set_value(imx6_pcie->reset_gpio, 0);
+	}
+
+	return 0;
+}
+
+static int pci_imx_resume_noirq(struct device *dev)
+{
+	struct imx6_pcie *imx6_pcie = dev_get_drvdata(dev);
+	struct pcie_port *pp = &imx6_pcie->pp;
+
+	if (is_imx6sx_pcie(imx6_pcie)) {
+		clk_prepare_enable(imx6_pcie->pcie_inbound_axi);
+		clk_prepare_enable(imx6_pcie->pcie_bus);
+		clk_prepare_enable(imx6_pcie->pcie_phy);
+		clk_prepare_enable(imx6_pcie->pcie);
+
+		/* Reset iMX6SX PCIe */
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR5,
+				IMX6SX_GPR5_PCIE_PERST, IMX6SX_GPR5_PCIE_PERST);
+		regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR5,
+				IMX6SX_GPR5_PCIE_PERST, 0);
+		/*
+		 * controller maybe turn off, re-configure again
+		 */
+		dw_pcie_setup_rc(pp);
+
+		if (IS_ENABLED(CONFIG_PCI_MSI))
+			dw_pcie_msi_cfg_restore(pp);
+
+		/* De-assert per-reset to ep */
+		gpio_set_value(imx6_pcie->reset_gpio, 1);
+	}
+
+	return 0;
+}
+
+static const struct dev_pm_ops pci_imx_pm_ops = {
+	.suspend_noirq = pci_imx_suspend_noirq,
+	.resume_noirq = pci_imx_resume_noirq,
+	.freeze_noirq = pci_imx_suspend_noirq,
+	.thaw_noirq = pci_imx_resume_noirq,
+	.poweroff_noirq = pci_imx_suspend_noirq,
+	.restore_noirq = pci_imx_resume_noirq,
+};
+#endif
+
 static int __init imx6_pcie_probe(struct platform_device *pdev)
 {
 	struct imx6_pcie *imx6_pcie;
@@ -610,9 +758,28 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
 		return PTR_ERR(imx6_pcie->pcie);
 	}
 
-	/* Grab GPR config register range */
-	imx6_pcie->iomuxc_gpr =
-		 syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
+	if (is_imx6sx_pcie(imx6_pcie)) {
+		imx6_pcie->pcie_inbound_axi = devm_clk_get(&pdev->dev,
+				"pcie_inbound_axi");
+		if (IS_ERR(imx6_pcie->pcie_inbound_axi)) {
+			dev_err(&pdev->dev,
+				"pcie clock source missing or invalid\n");
+			return PTR_ERR(imx6_pcie->pcie_inbound_axi);
+		}
+
+		imx6_pcie->pcie_phy_regulator = devm_regulator_get(pp->dev,
+				"pcie-phy");
+
+		imx6_pcie->iomuxc_gpr =
+			 syscon_regmap_lookup_by_compatible
+			 ("fsl,imx6sx-iomuxc-gpr");
+		imx6_pcie->gpc_ips_reg =
+			 syscon_regmap_lookup_by_compatible("fsl,imx6sx-gpc");
+	} else {
+		imx6_pcie->iomuxc_gpr =
+			syscon_regmap_lookup_by_compatible
+			("fsl,imx6q-iomuxc-gpr");
+	}
 	if (IS_ERR(imx6_pcie->iomuxc_gpr)) {
 		dev_err(&pdev->dev, "unable to find iomuxc registers\n");
 		return PTR_ERR(imx6_pcie->iomuxc_gpr);
@@ -636,6 +803,7 @@ static void imx6_pcie_shutdown(struct platform_device *pdev)
 
 static const struct of_device_id imx6_pcie_of_match[] = {
 	{ .compatible = "fsl,imx6q-pcie", },
+	{ .compatible = "fsl,imx6sx-pcie", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, imx6_pcie_of_match);
@@ -645,6 +813,7 @@ static struct platform_driver imx6_pcie_driver = {
 		.name	= "imx6q-pcie",
 		.owner	= THIS_MODULE,
 		.of_match_table = imx6_pcie_of_match,
+		.pm = &pci_imx_pm_ops,
 	},
 	.shutdown = imx6_pcie_shutdown,
 };
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index e3cd54a..a4bac0a 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -601,8 +601,11 @@ int __init dw_pcie_host_init(struct pcie_port *pp)
 		}
 	}
 
-	if (pp->ops->host_init)
-		pp->ops->host_init(pp);
+	if (pp->ops->host_init) {
+		ret = pp->ops->host_init(pp);
+		if (ret < 0)
+			return ret;
+	}
 
 	dw_pcie_wr_own_conf(pp, PCI_BASE_ADDRESS_0, 4, 0);
 
diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h
index 1a59600..6061355 100644
--- a/drivers/pci/host/pcie-designware.h
+++ b/drivers/pci/host/pcie-designware.h
@@ -75,7 +75,7 @@ struct pcie_host_ops {
 	int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
 			unsigned int devfn, int where, int size, u32 val);
 	int (*link_up)(struct pcie_port *pp);
-	void (*host_init)(struct pcie_port *pp);
+	int (*host_init)(struct pcie_port *pp);
 	void (*msi_set_irq)(struct pcie_port *pp, int irq);
 	void (*msi_clear_irq)(struct pcie_port *pp, int irq);
 	u32 (*get_msi_data)(struct pcie_port *pp);
diff --git a/drivers/pci/host/pcie-spear13xx.c b/drivers/pci/host/pcie-spear13xx.c
index 6dea9e4..b8fd76b 100644
--- a/drivers/pci/host/pcie-spear13xx.c
+++ b/drivers/pci/host/pcie-spear13xx.c
@@ -258,10 +258,12 @@ static int spear13xx_pcie_link_up(struct pcie_port *pp)
 	return 0;
 }
 
-static void spear13xx_pcie_host_init(struct pcie_port *pp)
+static int spear13xx_pcie_host_init(struct pcie_port *pp)
 {
 	spear13xx_pcie_establish_link(pp);
 	spear13xx_pcie_enable_interrupts(pp);
+
+	return 0;
 }
 
 static struct pcie_host_ops spear13xx_pcie_host_ops = {
-- 
1.9.1


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

* [PATCH v8 6/9] ARM: imx6qdl: Enable pcie on imx6qdl sabreauto
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
                   ` (4 preceding siblings ...)
  2014-10-20  5:25 ` [PATCH v8 5/9] PCI: imx6: Add imx6sx pcie support Richard Zhu
@ 2014-10-20  5:25 ` Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 7/9] ARM: imx6: Update dts and binding for imx6sx pcie Richard Zhu
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci
  Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2, Richard Zhu,
	Richard Zhu

From: Richard Zhu <r65037@freescale.com>

- enable pcie on imx6qdl sabreauto boards.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index 009abd6..d6040a5 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -410,6 +410,10 @@
 	};
 };
 
+&pcie {
+	status = "okay";
+};
+
 &pwm3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_pwm3>;
-- 
1.9.1


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

* [PATCH v8 7/9] ARM: imx6: Update dts and binding for imx6sx pcie
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
                   ` (5 preceding siblings ...)
  2014-10-20  5:25 ` [PATCH v8 6/9] ARM: imx6qdl: Enable pcie on imx6qdl sabreauto Richard Zhu
@ 2014-10-20  5:25 ` Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 8/9] ARM: imx6sx: Add syscon into gpc dts Richard Zhu
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci
  Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2, Richard Zhu,
	Richard Zhu

From: Richard Zhu <r65037@freescale.com>

- imx6sx pcie phy has its own power regulator. Add the
pcie phy power suppy into im6sx pcie dts and binding.
- in order to align with imx6qdl's pcie dts, re-format
imx6sx pcie dts.
- in order to align with imx6qdl pcie dts format and
keep clean of imx6 pcie driver, keep the pcie phy clock
in imx6sx pcie dts, although it's the parent clk of the
pcie bus clock now, and would be enabled automatically
when pcie bus clock is enabled. secondly, it's
possible that the external osc maybe used as source
of the pcie_bus clk in board design in future.
- disp_axi clock is required by pcie inbound axi port.
Add one more clock named pcie_inbound_axi for imx6sx pcie.

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
---
 .../devicetree/bindings/pci/fsl,imx6q-pcie.txt     |  8 +++++-
 arch/arm/boot/dts/imx6sx.dtsi                      | 32 ++++++++++++----------
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
index 9455fd0..ad81179 100644
--- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
+++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
@@ -4,7 +4,7 @@ This PCIe host controller is based on the Synopsis Designware PCIe IP
 and thus inherits all the common properties defined in designware-pcie.txt.
 
 Required properties:
-- compatible: "fsl,imx6q-pcie"
+- compatible: "fsl,imx6q-pcie", "fsl,imx6sx-pcie"
 - reg: base addresse and length of the pcie controller
 - interrupts: A list of interrupt outputs of the controller. Must contain an
   entry for each entry in the interrupt-names property.
@@ -13,6 +13,12 @@ Required properties:
 - clock-names: Must include the following additional entries:
 	- "pcie_phy"
 
+Additional required properties for imx6sx-pcie:
+- clock names: Must include the following additional entries:
+	- "pcie_inbound_axi"
+- power supplies:
+	- pcie-phy-supply: regulator used to power the PCIe PHY
+
 Example:
 
 	pcie@0x01000000 {
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index f4b9da6..0dfeade 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -599,9 +599,9 @@
 					anatop-max-voltage = <1450000>;
 				};
 
-				reg_pcie: regulator-vddpcie@140 {
+				reg_pcie_phy: regulator-vddpcie-phy@140 {
 					compatible = "fsl,anatop-regulator";
-					regulator-name = "vddpcie";
+					regulator-name = "vddpcie-phy";
 					regulator-min-microvolt = <725000>;
 					regulator-max-microvolt = <1450000>;
 					anatop-reg-offset = <0x140>;
@@ -1184,24 +1184,28 @@
 
 		pcie: pcie@0x08000000 {
 			compatible = "fsl,imx6sx-pcie", "snps,dw-pcie";
-			reg = <0x08ffc000 0x4000>; /* DBI */
+			reg = <0x08ffc000 0x4000>, <0x08f00000 0x80000>;
+			reg-names = "dbi", "config";
 			#address-cells = <3>;
 			#size-cells = <2>;
 			device_type = "pci";
-				  /* configuration space */
-			ranges = <0x00000800 0 0x08f00000 0x08f00000 0 0x00080000
-				  /* downstream I/O */
-				  0x81000000 0 0          0x08f80000 0 0x00010000
-				  /* non-prefetchable memory */
-				  0x82000000 0 0x08000000 0x08000000 0 0x00f00000>;
+			ranges = <0x81000000 0 0          0x08f80000 0 0x00010000 /* downstream I/O */
+				  0x82000000 0 0x08000000 0x08000000 0 0x00f00000>; /* non-prefetchable memory */
 			num-lanes = <1>;
-			interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&clks IMX6SX_CLK_PCIE_REF_125M>,
-				 <&clks IMX6SX_CLK_PCIE_AXI>,
+			interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "msi";
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0x7>;
+			interrupt-map = <0 0 0 1 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+			                <0 0 0 2 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
+			                <0 0 0 3 &intc GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
+			                <0 0 0 4 &intc GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clks IMX6SX_CLK_PCIE_AXI>,
 				 <&clks IMX6SX_CLK_LVDS1_OUT>,
+				 <&clks IMX6SX_CLK_PCIE_REF_125M>,
 				 <&clks IMX6SX_CLK_DISPLAY_AXI>;
-			clock-names = "pcie_ref_125m", "pcie_axi",
-				      "lvds_gate", "display_axi";
+			clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_inbound_axi";
+			pcie-phy-supply = <&reg_pcie_phy>;
 			status = "disabled";
 		};
 	};
-- 
1.9.1


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

* [PATCH v8 8/9] ARM: imx6sx: Add syscon into gpc dts
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
                   ` (6 preceding siblings ...)
  2014-10-20  5:25 ` [PATCH v8 7/9] ARM: imx6: Update dts and binding for imx6sx pcie Richard Zhu
@ 2014-10-20  5:25 ` Richard Zhu
  2014-10-20  5:25 ` [PATCH v8 9/9] ARM: imx6sx: Enable pcie on imx6sx sdb board Richard Zhu
  2014-10-21  8:18 ` [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Lucas Stach
  9 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci
  Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2, Richard Zhu,
	Richard Zhu

From: Richard Zhu <r65037@freescale.com>

In order to manipulate gpc bits for imx6sx
pcie in driver, add syscon into gpc dts

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
---
 arch/arm/boot/dts/imx6sx.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index 0dfeade..88d7fd7 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -689,7 +689,8 @@
 			};
 
 			gpc: gpc@020dc000 {
-				compatible = "fsl,imx6sx-gpc", "fsl,imx6q-gpc";
+				compatible = "fsl,imx6sx-gpc",
+					     "fsl,imx6q-gpc", "syscon";
 				reg = <0x020dc000 0x4000>;
 				interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
 			};
-- 
1.9.1


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

* [PATCH v8 9/9] ARM: imx6sx: Enable pcie on imx6sx sdb board
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
                   ` (7 preceding siblings ...)
  2014-10-20  5:25 ` [PATCH v8 8/9] ARM: imx6sx: Add syscon into gpc dts Richard Zhu
@ 2014-10-20  5:25 ` Richard Zhu
  2014-10-21  8:18 ` [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Lucas Stach
  9 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2014-10-20  5:25 UTC (permalink / raw)
  To: linux-pci
  Cc: shawn.guo, festevam, l.stach, tharvey, m-karicheri2, Richard Zhu,
	Richard Zhu

From: Richard Zhu <r65037@freescale.com>

Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
---
 arch/arm/boot/dts/imx6sx-sdb.dts | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts b/arch/arm/boot/dts/imx6sx-sdb.dts
index a3980d9..e28214a 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dts
+++ b/arch/arm/boot/dts/imx6sx-sdb.dts
@@ -90,6 +90,19 @@
 			regulator-min-microvolt = <5000000>;
 			regulator-max-microvolt = <5000000>;
 		};
+
+		reg_pcie: regulator@4 {
+			compatible = "regulator-fixed";
+			reg = <3>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_pcie_reg>;
+			regulator-name = "MPCIE_3V3";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			gpio = <&gpio2 1 0>;
+			regulator-always-on;
+			enable-active-high;
+		};
 	};
 
 	sound {
@@ -251,6 +264,13 @@
 	};
 };
 
+&pcie {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pcie>;
+	reset-gpio = <&gpio2 0 0>;
+	status = "okay";
+};
+
 &ssi2 {
 	status = "okay";
 };
@@ -365,6 +385,18 @@
 			>;
 		};
 
+		pinctrl_pcie: pciegrp {
+			fsl,pins = <
+				MX6SX_PAD_ENET1_COL__GPIO2_IO_0 0x10b0
+			>;
+		};
+
+		pinctrl_pcie_reg: pciereggrp {
+			fsl,pins = <
+				MX6SX_PAD_ENET1_CRS__GPIO2_IO_1	0x10b0
+			>;
+		};
+
 		pinctrl_vcc_sd3: vccsd3grp {
 			fsl,pins = <
 				MX6SX_PAD_KEY_COL1__GPIO2_IO_11		0x17059
-- 
1.9.1


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

* Re: [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto.
  2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
                   ` (8 preceding siblings ...)
  2014-10-20  5:25 ` [PATCH v8 9/9] ARM: imx6sx: Enable pcie on imx6sx sdb board Richard Zhu
@ 2014-10-21  8:18 ` Lucas Stach
  2014-10-21  9:54   ` Hong-Xing.Zhu
  9 siblings, 1 reply; 18+ messages in thread
From: Lucas Stach @ 2014-10-21  8:18 UTC (permalink / raw)
  To: Richard Zhu; +Cc: linux-pci, shawn.guo, festevam, tharvey, m-karicheri2

Am Montag, den 20.10.2014, 13:25 +0800 schrieb Richard Zhu:
> Main changes since the v6(v7 is ignored):
> 1. Regarding to Lucas' suggestion, assert per-reset in suspend,
> and de-assert it in resume.
> 2. Use pp->ops->get_msi_data in dw_pcie_msi_cfg_restore()
> if there is one get_msi_data pp ops callback, refer to Muali's comment.
> 3. In order to avoid the compilation, squash imx6 changes with patch2-5
> of v6, since the prototype of the host_init is changed.

No, this isn't what I wanted. This is completely separate change and
needs to be in one patch.

But to move this patchset forward without keeping those endless loops
back and forth between us both let's turn the thing around: I will take
most of your patches (namely the ones adding imx6sx support) and rework
them so they look good to me. I'll send them to you so you can test them
on your hardware and after that send them to the list for inclusion.

I'll leave out the purely DTS changes, as those are separate hardware
enablement patches, that don't strictly need to be in this series.

Regards,
Lucas

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* RE: [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto.
  2014-10-21  8:18 ` [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Lucas Stach
@ 2014-10-21  9:54   ` Hong-Xing.Zhu
  2014-10-21 15:37     ` Bjorn Helgaas
  0 siblings, 1 reply; 18+ messages in thread
From: Hong-Xing.Zhu @ 2014-10-21  9:54 UTC (permalink / raw)
  To: Lucas Stach, Richard Zhu
  Cc: linux-pci, Shengchao Guo, festevam, tharvey, m-karicheri2

DQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IEx1Y2FzIFN0YWNoIFttYWls
dG86bC5zdGFjaEBwZW5ndXRyb25peC5kZV0NCj4gU2VudDogVHVlc2RheSwgT2N0b2JlciAyMSwg
MjAxNCA0OjE4IFBNDQo+IFRvOiBSaWNoYXJkIFpodQ0KPiBDYzogbGludXgtcGNpQHZnZXIua2Vy
bmVsLm9yZzsgR3VvIFNoYXduLVI2NTA3MzsgZmVzdGV2YW1AZ21haWwuY29tOw0KPiB0aGFydmV5
QGdhdGV3b3Jrcy5jb207IG0ta2FyaWNoZXJpMkB0aS5jb20NCj4gU3ViamVjdDogUmU6IFtQQVRD
SCB2OF1QQ0k6IGlteDY6IGVuYWJsZSBwY2llIG9uIGlteDZzeCBzZGIgYW5kIGlteDZxZGwNCj4g
c2FicmVhdXRvLg0KPiANCj4gQW0gTW9udGFnLCBkZW4gMjAuMTAuMjAxNCwgMTM6MjUgKzA4MDAg
c2NocmllYiBSaWNoYXJkIFpodToNCj4gPiBNYWluIGNoYW5nZXMgc2luY2UgdGhlIHY2KHY3IGlz
IGlnbm9yZWQpOg0KPiA+IDEuIFJlZ2FyZGluZyB0byBMdWNhcycgc3VnZ2VzdGlvbiwgYXNzZXJ0
IHBlci1yZXNldCBpbiBzdXNwZW5kLCBhbmQNCj4gPiBkZS1hc3NlcnQgaXQgaW4gcmVzdW1lLg0K
PiA+IDIuIFVzZSBwcC0+b3BzLT5nZXRfbXNpX2RhdGEgaW4gZHdfcGNpZV9tc2lfY2ZnX3Jlc3Rv
cmUoKSBpZiB0aGVyZSBpcw0KPiA+IG9uZSBnZXRfbXNpX2RhdGEgcHAgb3BzIGNhbGxiYWNrLCBy
ZWZlciB0byBNdWFsaSdzIGNvbW1lbnQuDQo+ID4gMy4gSW4gb3JkZXIgdG8gYXZvaWQgdGhlIGNv
bXBpbGF0aW9uLCBzcXVhc2ggaW14NiBjaGFuZ2VzIHdpdGgNCj4gPiBwYXRjaDItNSBvZiB2Niwg
c2luY2UgdGhlIHByb3RvdHlwZSBvZiB0aGUgaG9zdF9pbml0IGlzIGNoYW5nZWQuDQo+IA0KPiBO
bywgdGhpcyBpc24ndCB3aGF0IEkgd2FudGVkLiBUaGlzIGlzIGNvbXBsZXRlbHkgc2VwYXJhdGUg
Y2hhbmdlIGFuZCBuZWVkcyB0bw0KPiBiZSBpbiBvbmUgcGF0Y2guDQo+IA0KW1JpY2hhcmRdIERv
IHlvdSBtZWFuIHRoZSBmb2xsb3dpbmc/DQoqIGlteDZzeCBwY2llIHN1cHBvcnQgdG8gYmUgb25l
IHBhdGNoLg0KKiB0aGUgcHJvdG90eXBlIG9mIHRoZSBob3N0X2luaXQgY2hhbmdlcyBzaG91bGQg
YmUgc3F1YXNoZWQgaW50byBvbmUgc3RhbmRhbG9uZSBwYXRjaC4NCg0KPiBCdXQgdG8gbW92ZSB0
aGlzIHBhdGNoc2V0IGZvcndhcmQgd2l0aG91dCBrZWVwaW5nIHRob3NlIGVuZGxlc3MgbG9vcHMg
YmFjayBhbmQNCj4gZm9ydGggYmV0d2VlbiB1cyBib3RoIGxldCdzIHR1cm4gdGhlIHRoaW5nIGFy
b3VuZDogSSB3aWxsIHRha2UgbW9zdCBvZiB5b3VyDQo+IHBhdGNoZXMgKG5hbWVseSB0aGUgb25l
cyBhZGRpbmcgaW14NnN4IHN1cHBvcnQpIGFuZCByZXdvcmsgdGhlbSBzbyB0aGV5IGxvb2sNCj4g
Z29vZCB0byBtZS4gSSdsbCBzZW5kIHRoZW0gdG8geW91IHNvIHlvdSBjYW4gdGVzdCB0aGVtIG9u
IHlvdXIgaGFyZHdhcmUgYW5kDQo+IGFmdGVyIHRoYXQgc2VuZCB0aGVtIHRvIHRoZSBsaXN0IGZv
ciBpbmNsdXNpb24uDQo+IA0KPiBJJ2xsIGxlYXZlIG91dCB0aGUgcHVyZWx5IERUUyBjaGFuZ2Vz
LCBhcyB0aG9zZSBhcmUgc2VwYXJhdGUgaGFyZHdhcmUNCj4gZW5hYmxlbWVudCBwYXRjaGVzLCB0
aGF0IGRvbid0IHN0cmljdGx5IG5lZWQgdG8gYmUgaW4gdGhpcyBzZXJpZXMuDQo+IA0KPiBSZWdh
cmRzLA0KPiBMdWNhcw0KPiANCj4gLS0NCj4gUGVuZ3V0cm9uaXggZS5LLiAgICAgICAgICAgICB8
IEx1Y2FzIFN0YWNoICAgICAgICAgICAgICAgICB8DQo+IEluZHVzdHJpYWwgTGludXggU29sdXRp
b25zICAgfCBodHRwOi8vd3d3LnBlbmd1dHJvbml4LmRlLyAgfA0KDQoNCkJlc3QgUmVnYXJkcw0K
UmljaGFyZCBaaHUNCg0K

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

* Re: [PATCH v8 2/9] PCI: designware: Fix one potential assignment error of cfg start
  2014-10-20  5:25 ` [PATCH v8 2/9] PCI: designware: Fix one potential assignment error of cfg start Richard Zhu
@ 2014-10-21 10:27   ` Lucas Stach
  0 siblings, 0 replies; 18+ messages in thread
From: Lucas Stach @ 2014-10-21 10:27 UTC (permalink / raw)
  To: Richard Zhu
  Cc: linux-pci, shawn.guo, festevam, tharvey, m-karicheri2, Richard Zhu

Am Montag, den 20.10.2014, 13:25 +0800 schrieb Richard Zhu:
> From: Richard Zhu <r65037@freescale.com>
> 
> if va_cfg0_base/va_cfg1_base are initialized by
> designware core, the pp->cfg.start is not initialized
> properly, when IORESOURCE_MEM "config" is represented
> as cfg space resource.
> solution: assign cfg_res->start to pp->cfg.start.
> 
> Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
> ---
>  drivers/pci/host/pcie-designware.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
> index 8d1c809..e3cd54a 100644
> --- a/drivers/pci/host/pcie-designware.c
> +++ b/drivers/pci/host/pcie-designware.c
> @@ -472,6 +472,7 @@ int __init dw_pcie_host_init(struct pcie_port *pp)
>  	if (cfg_res) {
>  		pp->config.cfg0_size = resource_size(cfg_res)/2;
>  		pp->config.cfg1_size = resource_size(cfg_res)/2;
> +		pp->cfg.start = cfg_res->start;
>  		pp->cfg0_base = cfg_res->start;
>  		pp->cfg1_base = cfg_res->start + pp->config.cfg0_size;
>  

I think this patch should not be needed anymore. Please look at commit
ec98e9ab6f24 (PCI: designware: Fix configuration base address when using
'reg') in 3.18-rc1. I think it fixes the same bug, but in a different
way. Can you confirm that this works for you?

Regards,
Lucas
-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* Re: [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto.
  2014-10-21  9:54   ` Hong-Xing.Zhu
@ 2014-10-21 15:37     ` Bjorn Helgaas
  2014-10-22  2:34       ` Hong-Xing.Zhu
  0 siblings, 1 reply; 18+ messages in thread
From: Bjorn Helgaas @ 2014-10-21 15:37 UTC (permalink / raw)
  To: Hong-Xing.Zhu
  Cc: Lucas Stach, Richard Zhu, linux-pci, Shengchao Guo, festevam,
	tharvey, m-karicheri2

On Tue, Oct 21, 2014 at 3:54 AM, Hong-Xing.Zhu@freescale.com
<Hong-Xing.Zhu@freescale.com> wrote:
> ...
> Richard Zhu

Can you please straighten out this Hong-Xing.Zhu vs. Richard Zhu
thing?  It is really a hassle to deal with multiple names for one
person.

Bjorn

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

* RE: [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto.
  2014-10-21 15:37     ` Bjorn Helgaas
@ 2014-10-22  2:34       ` Hong-Xing.Zhu
  2014-10-22  2:48         ` Bjorn Helgaas
  0 siblings, 1 reply; 18+ messages in thread
From: Hong-Xing.Zhu @ 2014-10-22  2:34 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lucas Stach, Richard Zhu, linux-pci, Shengchao Guo, festevam,
	tharvey, m-karicheri2

SGkgQmpvcm46DQoNClRoZSBuYW1lIEhvbmctWGluZy5aaHUgd291bGQgYmUgZGlzY2FyZGVkLiBS
ZXF1ZXN0IGhhZCBiZWVuIGlzc3VlIHRvIElUIHRlYW0sDQogYnV0IHRpbWUgaXMgcmVxdWlyZWQg
Zm9yIElUIHRvIG1ha2UgaXQgZWZmZWN0aXZlIGluIGFib3V0IDQ4aG91cnMgYmVoaW5kLg0KU29y
cnkgdG8gYnJpbmcgYW55IGluY29udmVuaWVuY2VzIGJ5IHRoZSBkaWZmZXJlbnQgbmFtZXMuDQoN
CkJlc3QgUmVnYXJkcw0KUmljaGFyZCBaaHUNCg0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0t
LS0tDQo+IEZyb206IEJqb3JuIEhlbGdhYXMgW21haWx0bzpiaGVsZ2Fhc0Bnb29nbGUuY29tXQ0K
PiBTZW50OiBUdWVzZGF5LCBPY3RvYmVyIDIxLCAyMDE0IDExOjM4IFBNDQo+IFRvOiBaaHUgUmlj
aGFyZC1SNjUwMzcNCj4gQ2M6IEx1Y2FzIFN0YWNoOyBSaWNoYXJkIFpodTsgbGludXgtcGNpQHZn
ZXIua2VybmVsLm9yZzsgR3VvIFNoYXduLVI2NTA3MzsNCj4gZmVzdGV2YW1AZ21haWwuY29tOyB0
aGFydmV5QGdhdGV3b3Jrcy5jb207IG0ta2FyaWNoZXJpMkB0aS5jb20NCj4gU3ViamVjdDogUmU6
IFtQQVRDSCB2OF1QQ0k6IGlteDY6IGVuYWJsZSBwY2llIG9uIGlteDZzeCBzZGIgYW5kIGlteDZx
ZGwNCj4gc2FicmVhdXRvLg0KPiANCj4gT24gVHVlLCBPY3QgMjEsIDIwMTQgYXQgMzo1NCBBTSwg
SG9uZy1YaW5nLlpodUBmcmVlc2NhbGUuY29tIDxIb25nLQ0KPiBYaW5nLlpodUBmcmVlc2NhbGUu
Y29tPiB3cm90ZToNCj4gPiAuLi4NCj4gPiBSaWNoYXJkIFpodQ0KPiANCj4gQ2FuIHlvdSBwbGVh
c2Ugc3RyYWlnaHRlbiBvdXQgdGhpcyBIb25nLVhpbmcuWmh1IHZzLiBSaWNoYXJkIFpodSB0aGlu
Zz8gIEl0IGlzDQo+IHJlYWxseSBhIGhhc3NsZSB0byBkZWFsIHdpdGggbXVsdGlwbGUgbmFtZXMg
Zm9yIG9uZSBwZXJzb24uDQo+IA0KPiBCam9ybg0K

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

* Re: [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto.
  2014-10-22  2:34       ` Hong-Xing.Zhu
@ 2014-10-22  2:48         ` Bjorn Helgaas
  0 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2014-10-22  2:48 UTC (permalink / raw)
  To: Hong-Xing.Zhu
  Cc: Lucas Stach, Richard Zhu, linux-pci, Shengchao Guo, festevam,
	tharvey, m-karicheri2

On Tue, Oct 21, 2014 at 8:34 PM, Hong-Xing.Zhu@freescale.com
<Hong-Xing.Zhu@freescale.com> wrote:
> Hi Bjorn:
>
> The name Hong-Xing.Zhu would be discarded. Request had been issue to IT team,
>  but time is required for IT to make it effective in about 48hours behind.
> Sorry to bring any inconveniences by the different names.

Ah, the old IT problem.  I forgot about those :)  Thanks for getting it started.

Bjorn

>> -----Original Message-----
>> From: Bjorn Helgaas [mailto:bhelgaas@google.com]
>> Sent: Tuesday, October 21, 2014 11:38 PM
>> To: Zhu Richard-R65037
>> Cc: Lucas Stach; Richard Zhu; linux-pci@vger.kernel.org; Guo Shawn-R65073;
>> festevam@gmail.com; tharvey@gateworks.com; m-karicheri2@ti.com
>> Subject: Re: [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl
>> sabreauto.
>>
>> On Tue, Oct 21, 2014 at 3:54 AM, Hong-Xing.Zhu@freescale.com <Hong-
>> Xing.Zhu@freescale.com> wrote:
>> > ...
>> > Richard Zhu
>>
>> Can you please straighten out this Hong-Xing.Zhu vs. Richard Zhu thing?  It is
>> really a hassle to deal with multiple names for one person.
>>
>> Bjorn

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

* Re: [PATCH v8 5/9] PCI: imx6: Add imx6sx pcie support
  2014-10-20  5:25 ` [PATCH v8 5/9] PCI: imx6: Add imx6sx pcie support Richard Zhu
@ 2014-10-27 18:24   ` Murali Karicheri
  2014-10-31  2:43     ` Richard.Zhu
  0 siblings, 1 reply; 18+ messages in thread
From: Murali Karicheri @ 2014-10-27 18:24 UTC (permalink / raw)
  To: Richard Zhu; +Cc: linux-pci, shawn.guo, festevam, l.stach, tharvey, Richard Zhu


>   	dw_pcie_wr_own_conf(pp, PCI_BASE_ADDRESS_0, 4, 0);
>
> diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h
> index 1a59600..6061355 100644
> --- a/drivers/pci/host/pcie-designware.h
> +++ b/drivers/pci/host/pcie-designware.h
> @@ -75,7 +75,7 @@ struct pcie_host_ops {
>   	int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
>   			unsigned int devfn, int where, int size, u32 val);
>   	int (*link_up)(struct pcie_port *pp);
> -	void (*host_init)(struct pcie_port *pp);
> +	int (*host_init)(struct pcie_port *pp);
Richard,

Please update the drivers/pci/host/pci-keystine.c as well for 
host_init() as pci-keystone is already merged to v3.18rc1. Please update 
the driver if you are changing API for pcie-designware core.

Murali
>   	void (*msi_set_irq)(struct pcie_port *pp, int irq);
>   	void (*msi_clear_irq)(struct pcie_port *pp, int irq);
>   	u32 (*get_msi_data)(struct pcie_port *pp);
> diff --git a/drivers/pci/host/pcie-spear13xx.c b/drivers/pci/host/pcie-spear13xx.c
> index 6dea9e4..b8fd76b 100644
> --- a/drivers/pci/host/pcie-spear13xx.c
> +++ b/drivers/pci/host/pcie-spear13xx.c
> @@ -258,10 +258,12 @@ static int spear13xx_pcie_link_up(struct pcie_port *pp)
>   	return 0;
>   }
>
> -static void spear13xx_pcie_host_init(struct pcie_port *pp)
> +static int spear13xx_pcie_host_init(struct pcie_port *pp)
>   {
>   	spear13xx_pcie_establish_link(pp);
>   	spear13xx_pcie_enable_interrupts(pp);
> +
> +	return 0;
>   }
>
>   static struct pcie_host_ops spear13xx_pcie_host_ops = {

-
Murali Karicheri
Linux Kernel, Texas Instruments

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

* RE: [PATCH v8 5/9] PCI: imx6: Add imx6sx pcie support
  2014-10-27 18:24   ` Murali Karicheri
@ 2014-10-31  2:43     ` Richard.Zhu
  0 siblings, 0 replies; 18+ messages in thread
From: Richard.Zhu @ 2014-10-31  2:43 UTC (permalink / raw)
  To: Murali Karicheri; +Cc: linux-pci, Shengchao Guo, festevam, l.stach, tharvey


> -----Original Message-----
> From: Murali Karicheri [mailto:m-karicheri2@ti.com]
> Sent: Tuesday, October 28, 2014 2:24 AM
> To: Zhu Richard-R65037
> Cc: linux-pci@vger.kernel.org; Guo Shawn-R65073; festevam@gmail.com;
> l.stach@pengutronix.de; tharvey@gateworks.com; Zhu Richard-R65037
> Subject: Re: [PATCH v8 5/9] PCI: imx6: Add imx6sx pcie support
> 
> 
> >   	dw_pcie_wr_own_conf(pp, PCI_BASE_ADDRESS_0, 4, 0);
> >
> > diff --git a/drivers/pci/host/pcie-designware.h
> > b/drivers/pci/host/pcie-designware.h
> > index 1a59600..6061355 100644
> > --- a/drivers/pci/host/pcie-designware.h
> > +++ b/drivers/pci/host/pcie-designware.h
> > @@ -75,7 +75,7 @@ struct pcie_host_ops {
> >   	int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
> >   			unsigned int devfn, int where, int size, u32 val);
> >   	int (*link_up)(struct pcie_port *pp);
> > -	void (*host_init)(struct pcie_port *pp);
> > +	int (*host_init)(struct pcie_port *pp);
> Richard,
> 
> Please update the drivers/pci/host/pci-keystine.c as well for
> host_init() as pci-keystone is already merged to v3.18rc1. Please update the
> driver if you are changing API for pcie-designware core.
> 
> Murali
Got that, thanks for your notice.

Best Regards
Richard Zhu
> >   	void (*msi_set_irq)(struct pcie_port *pp, int irq);
> >   	void (*msi_clear_irq)(struct pcie_port *pp, int irq);
> >   	u32 (*get_msi_data)(struct pcie_port *pp); diff --git
> > a/drivers/pci/host/pcie-spear13xx.c
> > b/drivers/pci/host/pcie-spear13xx.c
> > index 6dea9e4..b8fd76b 100644
> > --- a/drivers/pci/host/pcie-spear13xx.c
> > +++ b/drivers/pci/host/pcie-spear13xx.c
> > @@ -258,10 +258,12 @@ static int spear13xx_pcie_link_up(struct pcie_port *pp)
> >   	return 0;
> >   }
> >
> > -static void spear13xx_pcie_host_init(struct pcie_port *pp)
> > +static int spear13xx_pcie_host_init(struct pcie_port *pp)
> >   {
> >   	spear13xx_pcie_establish_link(pp);
> >   	spear13xx_pcie_enable_interrupts(pp);
> > +
> > +	return 0;
> >   }
> >
> >   static struct pcie_host_ops spear13xx_pcie_host_ops = {
> 
> -
> Murali Karicheri
> Linux Kernel, Texas Instruments

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

end of thread, other threads:[~2014-10-31  2:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-20  5:25 [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Richard Zhu
2014-10-20  5:25 ` [PATCH v8 1/9] PCI: designware: Refine setup_rc and add msi data restore Richard Zhu
2014-10-20  5:25 ` [PATCH v8 2/9] PCI: designware: Fix one potential assignment error of cfg start Richard Zhu
2014-10-21 10:27   ` Lucas Stach
2014-10-20  5:25 ` [PATCH v8 3/9] ARM: imx6sx: Add imx6sx pcie related gpr bits definitions Richard Zhu
2014-10-20  5:25 ` [PATCH v8 4/9] PCI: imx6: Wait the clocks to stabilize after ref_en Richard Zhu
2014-10-20  5:25 ` [PATCH v8 5/9] PCI: imx6: Add imx6sx pcie support Richard Zhu
2014-10-27 18:24   ` Murali Karicheri
2014-10-31  2:43     ` Richard.Zhu
2014-10-20  5:25 ` [PATCH v8 6/9] ARM: imx6qdl: Enable pcie on imx6qdl sabreauto Richard Zhu
2014-10-20  5:25 ` [PATCH v8 7/9] ARM: imx6: Update dts and binding for imx6sx pcie Richard Zhu
2014-10-20  5:25 ` [PATCH v8 8/9] ARM: imx6sx: Add syscon into gpc dts Richard Zhu
2014-10-20  5:25 ` [PATCH v8 9/9] ARM: imx6sx: Enable pcie on imx6sx sdb board Richard Zhu
2014-10-21  8:18 ` [PATCH v8]PCI: imx6: enable pcie on imx6sx sdb and imx6qdl sabreauto Lucas Stach
2014-10-21  9:54   ` Hong-Xing.Zhu
2014-10-21 15:37     ` Bjorn Helgaas
2014-10-22  2:34       ` Hong-Xing.Zhu
2014-10-22  2:48         ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).