Home
last modified time | relevance | path

Searched full:bdf (Results 1 – 25 of 56) sorted by relevance

123

/openbmc/u-boot/drivers/pci/
H A Dpcie_intel_fpga.c62 #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
[all …]
H A Dpcie_ecam_generic.c27 * @bdf: Identifies the PCIe device to access
33 * controller device @pcie and the bus, device & function numbers in @bdf. If
38 static int pci_generic_ecam_conf_address(struct udevice *bus, pci_dev_t bdf, in pci_generic_ecam_conf_address() argument
45 addr += PCI_BUS(bdf) << 20; in pci_generic_ecam_conf_address()
46 addr += PCI_DEV(bdf) << 15; in pci_generic_ecam_conf_address()
47 addr += PCI_FUNC(bdf) << 12; in pci_generic_ecam_conf_address()
57 * @bdf: Identifies the PCIe device to access
63 * space of the device identified by the bus, device & function numbers in @bdf
66 static int pci_generic_ecam_read_config(struct udevice *bus, pci_dev_t bdf, in pci_generic_ecam_read_config() argument
71 bdf, offset, valuep, size); in pci_generic_ecam_read_config()
[all …]
H A Dpcie_xilinx.c44 * @bdf: Identifies the PCIe device to access
50 * controller device @pcie and the bus, device & function numbers in @bdf. If
57 static int pcie_xilinx_config_address(struct udevice *udev, pci_dev_t bdf, in pcie_xilinx_config_address() argument
61 unsigned int bus = PCI_BUS(bdf); in pcie_xilinx_config_address()
62 unsigned int dev = PCI_DEV(bdf); in pcie_xilinx_config_address()
63 unsigned int func = PCI_FUNC(bdf); in pcie_xilinx_config_address()
89 * @bdf: Identifies the PCIe device to access
95 * space of the device identified by the bus, device & function numbers in @bdf
100 static int pcie_xilinx_read_config(struct udevice *bus, pci_dev_t bdf, in pcie_xilinx_read_config() argument
105 bdf, offset, valuep, size); in pcie_xilinx_read_config()
[all …]
H A Dpci-uclass.c93 static void pci_dev_find_ofnode(struct udevice *bus, phys_addr_t bdf, in pci_dev_find_ofnode() argument
106 if (PCI_MASK_BUS(addr.phys_hi) != PCI_MASK_BUS(bdf)) in pci_dev_find_ofnode()
134 int dm_pci_bus_find_bdf(pci_dev_t bdf, struct udevice **devp) in dm_pci_bus_find_bdf() argument
139 ret = pci_get_bus(PCI_BUS(bdf), &bus); in dm_pci_bus_find_bdf()
142 return pci_bus_find_devfn(bus, PCI_MASK_BUS(bdf), devp); in dm_pci_bus_find_bdf()
259 int pci_bus_write_config(struct udevice *bus, pci_dev_t bdf, int offset, in pci_bus_write_config() argument
267 return ops->write_config(bus, bdf, offset, value, size); in pci_bus_write_config()
270 int pci_bus_clrset_config32(struct udevice *bus, pci_dev_t bdf, int offset, in pci_bus_clrset_config32() argument
276 ret = pci_bus_read_config(bus, bdf, offset, &val, PCI_SIZE_32); in pci_bus_clrset_config32()
282 return pci_bus_write_config(bus, bdf, offset, val, PCI_SIZE_32); in pci_bus_clrset_config32()
[all …]
H A Dpci_gt64120.c44 unsigned char access_type, pci_dev_t bdf, in gt_config_access() argument
47 unsigned int bus = PCI_BUS(bdf); in gt_config_access()
48 unsigned int dev = PCI_DEV(bdf); in gt_config_access()
49 unsigned int devfn = PCI_DEV(bdf) << 3 | PCI_FUNC(bdf); in gt_config_access()
61 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), where, *data); in gt_config_access()
110 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), where, *data); in gt_config_access()
H A Dpci_common.c287 pci_dev_t bdf; in pci_hose_find_devices() local
290 for (bdf = PCI_BDF(busnum, 0, 0); in pci_hose_find_devices()
291 bdf < PCI_BDF(busnum + 1, 0, 0); in pci_hose_find_devices()
292 bdf += PCI_BDF(0, 0, 1)) { in pci_hose_find_devices()
293 if (pci_skip_dev(hose, bdf)) in pci_hose_find_devices()
296 if (!PCI_FUNC(bdf)) { in pci_hose_find_devices()
297 pci_read_config_byte(bdf, PCI_HEADER_TYPE, in pci_hose_find_devices()
305 pci_read_config_word(bdf, PCI_VENDOR_ID, &vendor); in pci_hose_find_devices()
306 pci_read_config_word(bdf, PCI_DEVICE_ID, &device); in pci_hose_find_devices()
312 return bdf; in pci_hose_find_devices()
[all …]
H A Dpcie_aspeed.c92 static void aspeed_pcie_cfg_read(struct pcie_aspeed *pcie, pci_dev_t bdf, in aspeed_pcie_cfg_read() argument
108 if (PCI_BUS(bdf) == 0) in aspeed_pcie_cfg_read()
113 bdf_offset = (PCI_BUS(bdf) << 24) | in aspeed_pcie_cfg_read()
114 (PCI_DEV(bdf) << 19) | in aspeed_pcie_cfg_read()
115 (PCI_FUNC(bdf) << 16) | in aspeed_pcie_cfg_read()
193 static void aspeed_pcie_cfg_write(struct pcie_aspeed *pcie, pci_dev_t bdf, in aspeed_pcie_cfg_write() argument
240 if (PCI_BUS(bdf) == 0) in aspeed_pcie_cfg_write()
245 bdf_offset = (PCI_BUS(bdf) << 24) | in aspeed_pcie_cfg_write()
246 (PCI_DEV(bdf) << 19) | in aspeed_pcie_cfg_write()
247 (PCI_FUNC(bdf) << 16) | in aspeed_pcie_cfg_write()
[all …]
H A Dpci-rcar-gen2.c110 static u32 get_bus_address(struct udevice *dev, pci_dev_t bdf, u32 offset) in get_bus_address() argument
114 return priv->cfg_base + (PCI_DEV(bdf) >> 1) * 0x100 + (offset & ~3); in get_bus_address()
117 static u32 setup_bus_address(struct udevice *dev, pci_dev_t bdf, u32 offset) in setup_bus_address() argument
122 reg = PCI_DEV(bdf) ? RCAR_AHBPCI_WIN1_DEVICE : RCAR_AHBPCI_WIN1_HOST; in setup_bus_address()
126 return get_bus_address(dev, bdf, offset); in setup_bus_address()
129 static int rcar_gen2_pci_read_config(struct udevice *dev, pci_dev_t bdf, in rcar_gen2_pci_read_config() argument
136 ret = rcar_gen2_pci_addr_valid(bdf, offset); in rcar_gen2_pci_read_config()
142 addr = get_bus_address(dev, bdf, offset); in rcar_gen2_pci_read_config()
149 static int rcar_gen2_pci_write_config(struct udevice *dev, pci_dev_t bdf, in rcar_gen2_pci_write_config() argument
156 ret = rcar_gen2_pci_addr_valid(bdf, offset); in rcar_gen2_pci_write_config()
[all …]
H A Dpci-aardvark.c163 * @bdf: The PCI device to access
168 static int pcie_advk_addr_valid(pci_dev_t bdf, int first_busno) in pcie_advk_addr_valid() argument
175 if ((PCI_BUS(bdf) == first_busno) && (PCI_DEV(bdf) > 0)) in pcie_advk_addr_valid()
289 * @bdf: Identifies the PCIe device to access
295 * space of the device identified by the bus, device & function numbers in @bdf
300 static int pcie_advk_read_config(struct udevice *bus, pci_dev_t bdf, in pcie_advk_read_config() argument
309 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in pcie_advk_read_config()
311 if (!pcie_advk_addr_valid(bdf, pcie->first_busno)) { in pcie_advk_read_config()
324 if (PCI_BUS(bdf) == pcie->first_busno) in pcie_advk_read_config()
331 reg = PCIE_BDF(bdf) | PCIE_CONF_REG(offset); in pcie_advk_read_config()
[all …]
H A Dpci_msc01.c28 unsigned char access_type, pci_dev_t bdf, in msc01_config_access() argument
34 unsigned int bus = PCI_BUS(bdf); in msc01_config_access()
35 unsigned int dev = PCI_DEV(bdf); in msc01_config_access()
36 unsigned int devfn = PCI_DEV(bdf) << 3 | PCI_FUNC(bdf); in msc01_config_access()
H A Dpci_mvebu.c139 static int mvebu_pcie_read_config(struct udevice *bus, pci_dev_t bdf, in mvebu_pcie_read_config() argument
150 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in mvebu_pcie_read_config()
153 if (PCI_BUS(bdf) == local_bus && PCI_DEV(bdf) != local_dev) { in mvebu_pcie_read_config()
154 if (local_dev == 0 && PCI_DEV(bdf) != 1) { in mvebu_pcie_read_config()
162 } else if (local_dev != 0 && PCI_DEV(bdf) != 0) { in mvebu_pcie_read_config()
174 reg = PCIE_CONF_ADDR(bdf, offset); in mvebu_pcie_read_config()
183 static int mvebu_pcie_write_config(struct udevice *bus, pci_dev_t bdf, in mvebu_pcie_write_config() argument
193 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in mvebu_pcie_write_config()
197 if (PCI_BUS(bdf) == local_bus && PCI_DEV(bdf) != local_dev) { in mvebu_pcie_write_config()
198 if (local_dev == 0 && PCI_DEV(bdf) != 1) { in mvebu_pcie_write_config()
[all …]
H A Dpcie_layerscape.c224 static int ls_pcie_addr_valid(struct ls_pcie *pcie, pci_dev_t bdf) in ls_pcie_addr_valid() argument
234 if (PCI_BUS(bdf) < bus->seq) in ls_pcie_addr_valid()
237 if ((PCI_BUS(bdf) > bus->seq) && (!ls_pcie_link_up(pcie))) in ls_pcie_addr_valid()
240 if (PCI_BUS(bdf) <= (bus->seq + 1) && (PCI_DEV(bdf) > 0)) in ls_pcie_addr_valid()
246 int ls_pcie_conf_address(struct udevice *bus, pci_dev_t bdf, in ls_pcie_conf_address() argument
252 if (ls_pcie_addr_valid(pcie, bdf)) in ls_pcie_conf_address()
255 if (PCI_BUS(bdf) == bus->seq) { in ls_pcie_conf_address()
260 busdev = PCIE_ATU_BUS(PCI_BUS(bdf) - bus->seq) | in ls_pcie_conf_address()
261 PCIE_ATU_DEV(PCI_DEV(bdf)) | in ls_pcie_conf_address()
262 PCIE_ATU_FUNC(PCI_FUNC(bdf)); in ls_pcie_conf_address()
[all …]
H A Dpcie_dw_mvebu.c232 * @bdf: Identifies the PCIe device to access
238 * space of the device identified by the bus, device & function numbers in @bdf
243 static int pcie_dw_mvebu_read_config(struct udevice *bus, pci_dev_t bdf, in pcie_dw_mvebu_read_config() argument
252 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in pcie_dw_mvebu_read_config()
254 if (!pcie_dw_addr_valid(bdf, pcie->first_busno)) { in pcie_dw_mvebu_read_config()
260 va_address = set_cfg_address(pcie, bdf, offset); in pcie_dw_mvebu_read_config()
278 * @bdf: Identifies the PCIe device to access
285 * numbers in @bdf on the PCI bus @bus.
289 static int pcie_dw_mvebu_write_config(struct udevice *bus, pci_dev_t bdf, in pcie_dw_mvebu_write_config() argument
298 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in pcie_dw_mvebu_write_config()
[all …]
/openbmc/u-boot/board/imgtec/malta/
H A Dmalta.c168 pci_dev_t bdf; in pci_init_board() local
191 bdf = pci_find_device(PCI_VENDOR_ID_INTEL, in pci_init_board()
193 if (bdf == -1) in pci_init_board()
197 pci_write_config_byte(bdf, PCI_CFG_PIIX4_PIRQRCA, 10); in pci_init_board()
198 pci_write_config_byte(bdf, PCI_CFG_PIIX4_PIRQRCB, 10); in pci_init_board()
199 pci_write_config_byte(bdf, PCI_CFG_PIIX4_PIRQRCC, 11); in pci_init_board()
200 pci_write_config_byte(bdf, PCI_CFG_PIIX4_PIRQRCD, 11); in pci_init_board()
203 pci_read_config_dword(bdf, PCI_CFG_PIIX4_GENCFG, &val32); in pci_init_board()
205 pci_write_config_dword(bdf, PCI_CFG_PIIX4_GENCFG, val32); in pci_init_board()
208 pci_read_config_byte(bdf, PCI_CFG_PIIX4_SERIRQC, &val8); in pci_init_board()
[all …]
/openbmc/u-boot/arch/x86/cpu/
H A Dpci.c19 int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset, in pci_x86_read_config() argument
22 outl(bdf | (offset & 0xfc) | PCI_CFG_EN, PCI_REG_ADDR); in pci_x86_read_config()
38 int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset, in pci_x86_write_config() argument
41 outl(bdf | (offset & 0xfc) | PCI_CFG_EN, PCI_REG_ADDR); in pci_x86_write_config()
59 pci_dev_t bdf; in pci_assign_irqs() local
65 bdf = PCI_BDF(bus, device, func); in pci_assign_irqs()
66 pci_read_config16(bdf, PCI_VENDOR_ID, &vendor); in pci_assign_irqs()
70 pci_read_config8(bdf, PCI_INTERRUPT_PIN, &pin); in pci_assign_irqs()
83 pci_write_config8(bdf, PCI_INTERRUPT_LINE, line); in pci_assign_irqs()
H A Dirq.c161 /* extract the bdf from fdt_pci_addr */ in create_pirq_routing_table()
162 priv->bdf = dm_pci_get_bdf(dev->parent); in create_pirq_routing_table()
258 rt->rtr_bus = PCI_BUS(priv->bdf); in create_pirq_routing_table()
259 rt->rtr_devfn = (PCI_DEV(priv->bdf) << 3) | PCI_FUNC(priv->bdf); in create_pirq_routing_table()
270 pr.bdf = fdt_addr_to_cpu(cell[0]); in create_pirq_routing_table()
275 i, PCI_BUS(pr.bdf), PCI_DEV(pr.bdf), in create_pirq_routing_table()
276 PCI_FUNC(pr.bdf), 'A' + pr.pin - 1, in create_pirq_routing_table()
280 PCI_BUS(pr.bdf), PCI_DEV(pr.bdf)); in create_pirq_routing_table()
283 PCI_BUS(pr.bdf), PCI_DEV(pr.bdf)); in create_pirq_routing_table()
304 fill_irq_info(priv, slot, PCI_BUS(pr.bdf), PCI_DEV(pr.bdf), in create_pirq_routing_table()
/openbmc/u-boot/board/armltd/integrator/
H A Dpci.c88 static unsigned long v3_open_config_window(pci_dev_t bdf, int offset) in v3_open_config_window() argument
91 unsigned int busnr = PCI_BUS(bdf); in v3_open_config_window()
92 unsigned int devfn = PCI_FUNC(bdf); in v3_open_config_window()
109 int slot = PCI_DEV(bdf); in v3_open_config_window()
121 address = PCI_FUNC(bdf) << 8; in v3_open_config_window()
187 static int pci_integrator_read_byte(struct pci_controller *hose, pci_dev_t bdf, in pci_integrator_read_byte() argument
192 addr = v3_open_config_window(bdf, offset); in pci_integrator_read_byte()
199 pci_dev_t bdf, int offset, in pci_integrator_read__word() argument
204 addr = v3_open_config_window(bdf, offset); in pci_integrator_read__word()
211 pci_dev_t bdf, int offset, in pci_integrator_read_dword() argument
[all …]
/openbmc/u-boot/arch/x86/lib/
H A Dbios_interrupts.c111 pci_dev_t bdf; in int1a_handler() local
135 bdf = -1; in int1a_handler()
140 bdf = dm_pci_get_bdf(dev); in int1a_handler()
147 busdevfn = (PCI_BUS(bdf) << 8) | PCI_DEV(bdf) << 3 | in int1a_handler()
148 PCI_FUNC(bdf); in int1a_handler()
167 bdf = PCI_BDF(bus, devfn >> 3, devfn & 7); in int1a_handler()
169 ret = dm_pci_bus_find_bdf(bdf, &dev); in int1a_handler()
171 debug("%s: Device %x not found\n", __func__, bdf); in int1a_handler()
/openbmc/u-boot/arch/x86/include/asm/
H A Dirq.h16 * configuraiton registers on the legacy bridge, normally PCI BDF(0, 31, 0).
53 u32 bdf; member
60 int bdf; member
H A Dpci.h20 int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset,
23 int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
/openbmc/phosphor-dbus-interfaces/yaml/xyz/openbmc_project/Inventory/Item/
H A DPCIeFunction.interface.yaml9 Indicates the Bus number in the BDF byte.
13 Indicates the Device number in the BDF byte.
17 Indicates the Function number in the BDF byte.
/openbmc/u-boot/cmd/
H A Dpci.c487 static int pci_cfg_display(pci_dev_t bdf, ulong addr, enum pci_size_t size, in pci_cfg_display()
513 val = pci_read_config(bdf, addr, size); in pci_cfg_display()
530 static int pci_cfg_write (pci_dev_t bdf, ulong addr, ulong size, ulong value) in pci_cfg_write() argument
533 pci_write_config_dword(bdf, addr, value); in pci_cfg_write()
537 pci_write_config_word(bdf, addr, val); in pci_cfg_write()
541 pci_write_config_byte(bdf, addr, val); in pci_cfg_write()
551 static int pci_cfg_modify(pci_dev_t bdf, ulong addr, ulong size, ulong value, in pci_cfg_modify()
567 val = pci_read_config(bdf, addr, size); in pci_cfg_modify()
598 pci_cfg_write(bdf, addr, size, i); in pci_cfg_modify()
668 pci_dev_t bdf = 0; in do_pci() local
[all …]
/openbmc/u-boot/board/theadorable/
H A Dtheadorable.c224 pci_dev_t bdf; in board_late_init() local
233 bdf = pci_find_device(PCI_VENDOR_ID_PLX, 0x8619, 0); in board_late_init()
234 if (bdf == -1) { in board_late_init()
284 pci_dev_t bdf; in do_pcie_test() local
300 bdf = pci_find_device(ven_id, dev_id, 0); in do_pcie_test()
301 if (bdf == -1) { in do_pcie_test()
/openbmc/u-boot/drivers/bios_emulator/
H A Datibios.c242 pci_dev_t bdf; in PCI_doBIOSPOST() local
252 bdf = dm_pci_get_bdf(pcidev); in PCI_doBIOSPOST()
253 regs.x.ax = (int)PCI_BUS(bdf) << 8 | in PCI_doBIOSPOST()
254 (int)PCI_DEV(bdf) << 3 | (int)PCI_FUNC(bdf); in PCI_doBIOSPOST()
494 pci_dev_t bdf; in PCI_postController() local
524 bdf = dm_pci_get_bdf(pcidev); in PCI_postController()
525 vga_info->function = PCI_FUNC(bdf); in PCI_postController()
526 vga_info->device = PCI_DEV(bdf); in PCI_postController()
527 vga_info->bus = PCI_BUS(bdf); in PCI_postController()
558 pci_dev_t bdf = dm_pci_get_bdf(pcidev); in biosemu_setup() local
[all …]
/openbmc/qemu/hw/acpi/
H A Dviot.c33 /* PCI BDF start */ in build_pci_host_range()
35 /* PCI BDF end */ in build_pci_host_range()
125 /* PCI BDF number */ in build_viot()

123