Skip to contentSkip to conversation

pci: layerscape: Only set EP CFG READY bit

PATCH New Pankaj Bansal 3 participants 3 messages Oct 14, 2019 – Nov 11, 2019 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci: layerscape: Only set EP CFG READY bit

As part of EP setup, we want to set the config ready bit of controller, so that RC can read the config space of EP.
Now, when we set the config ready bit we are inadvertently clearing the LTSSM_EN bit in same register, which restarts the link tarining between RC and EP.
Therefore, just set the desired CFG_READY bit (bit 0), while leaving the other bits unchanged.

---
 drivers/pci/pcie_layerscape.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/pci/pcie_layerscape.c +5 -1
index d8a7b7c865..bb2ec7c2ce 100644
@@ -407,7 +407,11 @@ static void ls_pcie_ep_setup_bars(void *bar_base)
 
 static void ls_pcie_ep_enable_cfg(struct ls_pcie *pcie)
 {
-	ctrl_writel(pcie, PCIE_CONFIG_READY, PCIE_PF_CONFIG);
+	u32 config;
+
+	config = ctrl_readl(pcie,  PCIE_PF_CONFIG);
+	config |= PCIE_CONFIG_READY;
+	ctrl_writel(pcie, config, PCIE_PF_CONFIG);
 }
 
 static void ls_pcie_setup_ep(struct ls_pcie *pcie)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 pci: layerscape: Only set EP CFG READY bit

Quoted 41 lines

-----Original Message-----
From: Pankaj Bansal
Sent: 2019年10月14日 19:43
To: Priyanka Jain <[email protected]>; Xiaowei Bao <[email protected]>; Tom Rini <[email protected]>; Z.q. Hou <[email protected]>
Cc: u-boot at lists.denx.de; Pankaj Bansal <[email protected]>
Subject: [PATCH] pci: layerscape: Only set EP CFG READY bit

As part of EP setup, we want to set the config ready bit of controller, so that RC can read the config space of EP.
Now, when we set the config ready bit we are inadvertently clearing the LTSSM_EN bit in same register, which restarts the link tarining between RC and EP.
Therefore, just set the desired CFG_READY bit (bit 0), while leaving the other bits unchanged.

---
 drivers/pci/pcie_layerscape.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/pci/pcie_layerscape.c +5 -2
index d8a7b7c865..bb2ec7c2ce 100644
@@ -407,7 +407,11 @@ static void ls_pcie_ep_setup_bars(void *bar_base)
 
 static void ls_pcie_ep_enable_cfg(struct ls_pcie *pcie)  {
-	ctrl_writel(pcie, PCIE_CONFIG_READY, PCIE_PF_CONFIG);
+	u32 config;
+
+	config = ctrl_readl(pcie,  PCIE_PF_CONFIG);
+	config |= PCIE_CONFIG_READY;
+	ctrl_writel(pcie, config, PCIE_PF_CONFIG);
 }
 
 static void ls_pcie_setup_ep(struct ls_pcie *pcie)
--
Quoted 1 line

2.17.1

#2 lore raw

PATCH 1/1 pci: layerscape: Only set EP CFG READY bit

In reply to Pankaj Bansal
Quoted 41 lines

-----Original Message-----
From: Pankaj Bansal <[email protected]>
Sent: Monday, October 14, 2019 5:13 PM
To: Priyanka Jain <[email protected]>; Xiaowei Bao <[email protected]>; Tom Rini <[email protected]>; Z.q. Hou <[email protected]>
Cc: u-boot at lists.denx.de; Pankaj Bansal <[email protected]>
Subject: [PATCH] pci: layerscape: Only set EP CFG READY bit

As part of EP setup, we want to set the config ready bit of controller, so that RC can read the config space of EP.
Now, when we set the config ready bit we are inadvertently clearing the LTSSM_EN bit in same register, which restarts the link tarining between RC and EP.
Therefore, just set the desired CFG_READY bit (bit 0), while leaving the other bits unchanged.

---
drivers/pci/pcie_layerscape.c | 6 +++++-

1 file changed, 5 insertions(+), 1 deletion(-)
drivers/pci/pcie_layerscape.c index renamed from drivers/pci/pcie_layerscape.c +0 -0

d8a7b7c865..bb2ec7c2ce 100644

drivers/pci/pcie_layerscape.c +5 -2
@@ -407,7 +407,11 @@ static void ls_pcie_ep_setup_bars(void *bar_base)
 
 static void ls_pcie_ep_enable_cfg(struct ls_pcie *pcie)  {
-	ctrl_writel(pcie, PCIE_CONFIG_READY, PCIE_PF_CONFIG);
+	u32 config;
+
+	config = ctrl_readl(pcie,  PCIE_PF_CONFIG);
+	config |= PCIE_CONFIG_READY;
+	ctrl_writel(pcie, config, PCIE_PF_CONFIG);
 }
 
 static void ls_pcie_setup_ep(struct ls_pcie *pcie)
--
Quoted 1 line

2.17.1

Some updates in description. Applied to fsl-qoriq master, awaiting upstream.

Thanks
priyankajain