u32 ecam_value;
};
+static bool nwl_pcie_link_up(struct nwl_pcie *pcie)
+{
+ if (readl(pcie->pcireg_base + PS_LINKUP_OFFSET) & PCIE_PHY_LINKUP_BIT)
+ return true;
+ return false;
+}
+
static int nwl_pcie_config_address(const struct udevice *bus,
pci_dev_t bdf, uint offset,
void **paddress)
struct nwl_pcie *pcie = dev_get_priv(bus);
void *addr;
+ if (PCI_BUS(bdf) != dev_seq(bus) && !nwl_pcie_link_up(pcie))
+ return -EIO;
+
addr = pcie->ecam_base;
addr += PCIE_ECAM_OFFSET(PCI_BUS(bdf) - dev_seq(bus),
PCI_DEV(bdf), PCI_FUNC(bdf), offset);
writel(val, pcie->breg_base + off);
}
-static bool nwl_pcie_link_up(struct nwl_pcie *pcie)
-{
- if (readl(pcie->pcireg_base + PS_LINKUP_OFFSET) & PCIE_PHY_LINKUP_BIT)
- return true;
- return false;
-}
-
static bool nwl_phy_link_up(struct nwl_pcie *pcie)
{
if (readl(pcie->pcireg_base + PS_LINKUP_OFFSET) & PHY_RDY_LINKUP_BIT)