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....@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

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to