Lines Matching refs:bdf
68 #define IS_ROOT_PORT(pcie, bdf) \ argument
69 ((PCI_BUS(bdf) == pcie->first_busno) ? true : false)
96 pci_dev_t bdf, int offset) in intel_fpga_pcie_hide_rc_bar() argument
98 if (IS_ROOT_PORT(pcie, bdf) && PCI_DEV(bdf) == 0 && in intel_fpga_pcie_hide_rc_bar()
99 PCI_FUNC(bdf) == 0 && offset == PCI_BASE_ADDRESS_0) in intel_fpga_pcie_hide_rc_bar()
123 pci_dev_t bdf) in intel_fpga_pcie_addr_valid() argument
126 if (!IS_ROOT_PORT(pcie, bdf) && !intel_fpga_pcie_link_up(pcie)) in intel_fpga_pcie_addr_valid()
130 if (IS_ROOT_PORT(pcie, bdf) && PCI_DEV(bdf) > 0) in intel_fpga_pcie_addr_valid()
133 if ((PCI_BUS(bdf) == pcie->first_busno + 1) && PCI_DEV(bdf) > 0) in intel_fpga_pcie_addr_valid()
200 static int tlp_cfg_dword_read(struct intel_fpga_pcie *pcie, pci_dev_t bdf, in tlp_cfg_dword_read() argument
204 u8 busno = PCI_BUS(bdf); in tlp_cfg_dword_read()
208 headers[2] = TLP_CFG_DW2(busno, PCI_DEV(bdf), PCI_FUNC(bdf), offset); in tlp_cfg_dword_read()
215 static int tlp_cfg_dword_write(struct intel_fpga_pcie *pcie, pci_dev_t bdf, in tlp_cfg_dword_write() argument
219 u8 busno = PCI_BUS(bdf); in tlp_cfg_dword_write()
223 headers[2] = TLP_CFG_DW2(busno, PCI_DEV(bdf), PCI_FUNC(bdf), offset); in tlp_cfg_dword_write()
230 int intel_fpga_rp_conf_addr(const struct udevice *bus, pci_dev_t bdf, in intel_fpga_rp_conf_addr() argument
240 static int intel_fpga_pcie_rp_rd_conf(struct udevice *bus, pci_dev_t bdf, in intel_fpga_pcie_rp_rd_conf() argument
245 bdf, offset, valuep, size); in intel_fpga_pcie_rp_rd_conf()
248 static int intel_fpga_pcie_rp_wr_conf(struct udevice *bus, pci_dev_t bdf, in intel_fpga_pcie_rp_wr_conf() argument
256 bdf, offset, value, size); in intel_fpga_pcie_rp_wr_conf()
281 pci_dev_t bdf, uint offset, in _pcie_intel_fpga_read_config() argument
289 if (IS_ROOT_PORT(pcie, bdf)) in _pcie_intel_fpga_read_config()
290 return intel_fpga_pcie_rp_rd_conf(pcie->bus, bdf, in _pcie_intel_fpga_read_config()
294 ret = tlp_cfg_dword_read(pcie, bdf, offset & ~DWORD_MASK, in _pcie_intel_fpga_read_config()
307 pci_dev_t bdf, uint offset, in _pcie_intel_fpga_write_config() argument
314 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in _pcie_intel_fpga_write_config()
319 if (IS_ROOT_PORT(pcie, bdf)) in _pcie_intel_fpga_write_config()
320 return intel_fpga_pcie_rp_wr_conf(pcie->bus, bdf, offset, in _pcie_intel_fpga_write_config()
326 return tlp_cfg_dword_write(pcie, bdf, offset & ~DWORD_MASK, in _pcie_intel_fpga_write_config()
330 static int pcie_intel_fpga_read_config(const struct udevice *bus, pci_dev_t bdf, in pcie_intel_fpga_read_config() argument
337 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in pcie_intel_fpga_read_config()
339 if (intel_fpga_pcie_hide_rc_bar(pcie, bdf, offset)) { in pcie_intel_fpga_read_config()
344 if (!intel_fpga_pcie_addr_valid(pcie, bdf)) { in pcie_intel_fpga_read_config()
349 return _pcie_intel_fpga_read_config(pcie, bdf, offset, valuep, size); in pcie_intel_fpga_read_config()
352 static int pcie_intel_fpga_write_config(struct udevice *bus, pci_dev_t bdf, in pcie_intel_fpga_write_config() argument
358 if (intel_fpga_pcie_hide_rc_bar(pcie, bdf, offset)) in pcie_intel_fpga_write_config()
361 if (!intel_fpga_pcie_addr_valid(pcie, bdf)) in pcie_intel_fpga_write_config()
364 return _pcie_intel_fpga_write_config(pcie, bdf, offset, value, in pcie_intel_fpga_write_config()