Lines Matching refs:bdf
62 #define IS_ROOT_PORT(pcie, bdf) \ argument
63 ((PCI_BUS(bdf) == pcie->first_busno) ? true : false)
93 pci_dev_t bdf, int offset) in intel_fpga_pcie_hide_rc_bar() argument
95 if (IS_ROOT_PORT(pcie, bdf) && PCI_DEV(bdf) == 0 && in intel_fpga_pcie_hide_rc_bar()
96 PCI_FUNC(bdf) == 0 && offset == PCI_BASE_ADDRESS_0) in intel_fpga_pcie_hide_rc_bar()
120 pci_dev_t bdf) in intel_fpga_pcie_addr_valid() argument
123 if (!IS_ROOT_PORT(pcie, bdf) && !intel_fpga_pcie_link_up(pcie)) in intel_fpga_pcie_addr_valid()
127 if (IS_ROOT_PORT(pcie, bdf) && PCI_DEV(bdf) > 0) in intel_fpga_pcie_addr_valid()
130 if ((PCI_BUS(bdf) == pcie->first_busno + 1) && PCI_DEV(bdf) > 0) in intel_fpga_pcie_addr_valid()
195 static int tlp_cfg_dword_read(struct intel_fpga_pcie *pcie, pci_dev_t bdf, in tlp_cfg_dword_read() argument
199 u8 busno = PCI_BUS(bdf); in tlp_cfg_dword_read()
203 headers[2] = TLP_CFG_DW2(busno, PCI_DEV(bdf), PCI_FUNC(bdf), offset); in tlp_cfg_dword_read()
210 static int tlp_cfg_dword_write(struct intel_fpga_pcie *pcie, pci_dev_t bdf, in tlp_cfg_dword_write() argument
214 u8 busno = PCI_BUS(bdf); in tlp_cfg_dword_write()
218 headers[2] = TLP_CFG_DW2(busno, PCI_DEV(bdf), PCI_FUNC(bdf), offset); in tlp_cfg_dword_write()
225 int intel_fpga_rp_conf_addr(struct udevice *bus, pci_dev_t bdf, in intel_fpga_rp_conf_addr() argument
235 static int intel_fpga_pcie_rp_rd_conf(struct udevice *bus, pci_dev_t bdf, in intel_fpga_pcie_rp_rd_conf() argument
240 bdf, offset, valuep, size); in intel_fpga_pcie_rp_rd_conf()
243 static int intel_fpga_pcie_rp_wr_conf(struct udevice *bus, pci_dev_t bdf, in intel_fpga_pcie_rp_wr_conf() argument
251 bdf, offset, value, size); in intel_fpga_pcie_rp_wr_conf()
276 pci_dev_t bdf, uint offset, in _pcie_intel_fpga_read_config() argument
284 if (IS_ROOT_PORT(pcie, bdf)) in _pcie_intel_fpga_read_config()
285 return intel_fpga_pcie_rp_rd_conf(pcie->bus, bdf, in _pcie_intel_fpga_read_config()
289 ret = tlp_cfg_dword_read(pcie, bdf, offset & ~DWORD_MASK, in _pcie_intel_fpga_read_config()
302 pci_dev_t bdf, uint offset, in _pcie_intel_fpga_write_config() argument
309 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in _pcie_intel_fpga_write_config()
314 if (IS_ROOT_PORT(pcie, bdf)) in _pcie_intel_fpga_write_config()
315 return intel_fpga_pcie_rp_wr_conf(pcie->bus, bdf, offset, in _pcie_intel_fpga_write_config()
321 return tlp_cfg_dword_write(pcie, bdf, offset & ~DWORD_MASK, in _pcie_intel_fpga_write_config()
325 static int pcie_intel_fpga_read_config(struct udevice *bus, pci_dev_t bdf, in pcie_intel_fpga_read_config() argument
332 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in pcie_intel_fpga_read_config()
334 if (intel_fpga_pcie_hide_rc_bar(pcie, bdf, offset)) { in pcie_intel_fpga_read_config()
339 if (!intel_fpga_pcie_addr_valid(pcie, bdf)) { in pcie_intel_fpga_read_config()
344 return _pcie_intel_fpga_read_config(pcie, bdf, offset, valuep, size); in pcie_intel_fpga_read_config()
347 static int pcie_intel_fpga_write_config(struct udevice *bus, pci_dev_t bdf, in pcie_intel_fpga_write_config() argument
353 if (intel_fpga_pcie_hide_rc_bar(pcie, bdf, offset)) in pcie_intel_fpga_write_config()
356 if (!intel_fpga_pcie_addr_valid(pcie, bdf)) in pcie_intel_fpga_write_config()
359 return _pcie_intel_fpga_write_config(pcie, bdf, offset, value, in pcie_intel_fpga_write_config()