PCI: mobiveil: Initialize Primary/Secondary/Subordinate bus numbers
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Fri, 5 Jul 2019 09:56:38 +0000 (17:56 +0800)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 8 Jul 2019 11:28:44 +0000 (12:28 +0100)
The reset value of Primary, Secondary and Subordinate bus numbers is
zero which is a broken setup.

Program a sensible default value for Primary/Secondary/Subordinate
bus numbers.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Minghuan Lian <Minghuan.Lian@nxp.com>
Reviewed-by: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>
drivers/pci/controller/pcie-mobiveil.c

index cdf15cc..8f56130 100644 (file)
@@ -561,6 +561,12 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie)
        u32 value, pab_ctrl, type = 0;
        struct resource_entry *win;
 
+       /* setup bus numbers */
+       value = csr_readl(pcie, PCI_PRIMARY_BUS);
+       value &= 0xff000000;
+       value |= 0x00ff0100;
+       csr_writel(pcie, value, PCI_PRIMARY_BUS);
+
        /*
         * program Bus Master Enable Bit in Command Register in PAB Config
         * Space