All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] PCI: layerscape: Add Support for ls2085a and ls2080a EP mode
@ 2019-11-22  7:33 Xiaowei Bao
  2019-11-22  7:33 ` [U-Boot] [PATCH 2/3] PCI: layerscape: Add the configuration for PF1 and VFs Xiaowei Bao
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Xiaowei Bao @ 2019-11-22  7:33 UTC (permalink / raw)
  To: u-boot

Due to the ls2085a and ls2080a use difference way to set the BAR size,
so add the BAR size init code here.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
depends on: http://patchwork.ozlabs.org/project/uboot/list/?series=108172&state=*
---
 drivers/pci/pcie_layerscape.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/pcie_layerscape.c b/drivers/pci/pcie_layerscape.c
index 05e6b62..845efda 100644
--- a/drivers/pci/pcie_layerscape.c
+++ b/drivers/pci/pcie_layerscape.c
@@ -467,18 +467,25 @@ static void ls_pcie_setup_ep(struct ls_pcie *pcie)
 			 */
 			writel(0, pcie->dbi + PCIE_MISC_CONTROL_1_OFF);
 
+			bar_base = pcie->dbi +
+				   PCIE_MASK_OFFSET(pcie->cfg2_flag, pf);
+
 			if (pcie->cfg2_flag) {
-				for (vf = 0; vf <= PCIE_VF_NUM; vf++) {
+				ctrl_writel(pcie,
+					    PCIE_LCTRL0_VAL(pf, 0),
+					    PCIE_PF_VF_CTRL);
+				ls_pcie_ep_setup_bars(bar_base);
+
+				for (vf = 1; vf <= PCIE_VF_NUM; vf++) {
 					ctrl_writel(pcie,
 						    PCIE_LCTRL0_VAL(pf, vf),
 						    PCIE_PF_VF_CTRL);
+					ls_pcie_ep_setup_vf_bars(bar_base);
 				}
+			} else {
+				ls_pcie_ep_setup_bars(bar_base);
+				ls_pcie_ep_setup_vf_bars(bar_base);
 			}
-			bar_base = pcie->dbi +
-				   PCIE_MASK_OFFSET(pcie->cfg2_flag, pf);
-			ls_pcie_ep_setup_bars(bar_base);
-			ls_pcie_ep_setup_vf_bars(bar_base);
-
 			ls_pcie_ep_setup_atu(pcie, pf);
 		}
 
-- 
2.9.5

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

end of thread, other threads:[~2019-12-23 10:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22  7:33 [U-Boot] [PATCH 1/3] PCI: layerscape: Add Support for ls2085a and ls2080a EP mode Xiaowei Bao
2019-11-22  7:33 ` [U-Boot] [PATCH 2/3] PCI: layerscape: Add the configuration for PF1 and VFs Xiaowei Bao
2019-11-22  7:33 ` [U-Boot] [PATCH 3/3] PCI: layerscape: Add the PCIe EP mode support for lx2160a-v2 Xiaowei Bao
2019-12-23 10:43 ` [U-Boot] [PATCH 1/3] PCI: layerscape: Add Support for ls2085a and ls2080a EP mode Priyanka Jain
2019-12-23 10:48   ` Xiaowei Bao

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.