/openbmc/u-boot/drivers/pci/ |
H A D | pcie_intel_fpga.c | 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 [all …]
|
H A D | pcie_aspeed.c | 92 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 D | pci-uclass.c | 93 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 D | pci_common.c | 287 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 D | pci_gt64120.c | 44 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 D | pcie_ecam_generic.c | 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() 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() 86 static int pci_generic_ecam_write_config(struct udevice *bus, pci_dev_t bdf, in pci_generic_ecam_write_config() argument 91 bdf, offset, value, size); in pci_generic_ecam_write_config()
|
H A D | pcie_xilinx.c | 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() 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() 122 static int pcie_xilinx_write_config(struct udevice *bus, pci_dev_t bdf, in pcie_xilinx_write_config() argument 127 bdf, offset, value, size); in pcie_xilinx_write_config()
|
H A D | pci-aardvark.c | 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() 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() 397 static int pcie_advk_write_config(struct udevice *bus, pci_dev_t bdf, in pcie_advk_write_config() argument 405 PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf)); in pcie_advk_write_config() 409 if (!pcie_advk_addr_valid(bdf, pcie->first_busno)) { in pcie_advk_write_config() [all …]
|
H A D | pci_mvebu.c | 139 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 D | pci-rcar-gen2.c | 110 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 D | pcie_dw_mvebu.c | 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() 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() 301 if (!pcie_dw_addr_valid(bdf, pcie->first_busno)) { in pcie_dw_mvebu_write_config() 306 va_address = set_cfg_address(pcie, bdf, offset); in pcie_dw_mvebu_write_config()
|
H A D | pcie_layerscape.c | 224 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 D | pci_msc01.c | 28 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()
|
/openbmc/u-boot/board/imgtec/malta/ |
H A D | malta.c | 168 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 D | pci.c | 19 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 D | irq.c | 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 D | pci.c | 88 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/linux/Documentation/ABI/testing/ |
H A D | debugfs-hisi-zip | 1 What: /sys/kernel/debug/hisi_zip/<bdf>/comp_core[01]/regs 7 What: /sys/kernel/debug/hisi_zip/<bdf>/decomp_core[0-5]/regs 13 What: /sys/kernel/debug/hisi_zip/<bdf>/clear_enable 22 What: /sys/kernel/debug/hisi_zip/<bdf>/current_qm 29 What: /sys/kernel/debug/hisi_zip/<bdf>/alg_qos 32 Description: The <bdf> is related the function for PF and VF. 34 supports to write <bdf> value to alg_qos in the host. Such as 35 "echo <bdf> value > alg_qos". The qos value is 1~1000, means 39 What: /sys/kernel/debug/hisi_zip/<bdf>/qm/regs 46 What: /sys/kernel/debug/hisi_zip/<bdf>/qm/current_q [all …]
|
H A D | debugfs-hisi-hpre | 1 What: /sys/kernel/debug/hisi_hpre/<bdf>/cluster[0-3]/regs 7 What: /sys/kernel/debug/hisi_hpre/<bdf>/cluster[0-3]/cluster_ctrl 14 What: /sys/kernel/debug/hisi_hpre/<bdf>/rdclr_en 23 What: /sys/kernel/debug/hisi_hpre/<bdf>/current_qm 30 What: /sys/kernel/debug/hisi_hpre/<bdf>/alg_qos 33 Description: The <bdf> is related the function for PF and VF. 35 supports to write <bdf> value to alg_qos in the host. Such as 36 "echo <bdf> value > alg_qos". The qos value is 1~1000, means 40 What: /sys/kernel/debug/hisi_hpre/<bdf>/regs 46 What: /sys/kernel/debug/hisi_hpre/<bdf>/qm/regs [all …]
|
H A D | debugfs-hisi-sec | 1 What: /sys/kernel/debug/hisi_sec2/<bdf>/clear_enable 9 What: /sys/kernel/debug/hisi_sec2/<bdf>/current_qm 17 What: /sys/kernel/debug/hisi_sec2/<bdf>/alg_qos 20 Description: The <bdf> is related the function for PF and VF. 22 supports to write <bdf> value to alg_qos in the host. Such as 23 "echo <bdf> value > alg_qos". The qos value is 1~1000, means 27 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/qm_regs 34 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/current_q 41 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/clear_enable 49 What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/err_irq [all …]
|
/openbmc/u-boot/arch/x86/lib/ |
H A D | bios_interrupts.c | 111 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/linux/drivers/perf/hisilicon/ |
H A D | hns3_pmu.c | 318 #define GET_PCI_DEVFN(bdf) ((bdf) & 0xff) argument 336 HNS3_PMU_FILTER_ATTR(bdf, config1, 8, 23); 490 u16 bdf = hns3_pmu->bdf_min; in bdf_min_show() local 492 return sysfs_emit(buf, "%02x:%02x.%x\n", PCI_BUS_NUM(bdf), in bdf_min_show() 493 PCI_SLOT(bdf), PCI_FUNC(bdf)); in bdf_min_show() 501 u16 bdf = hns3_pmu->bdf_max; in bdf_max_show() local 503 return sysfs_emit(buf, "%02x:%02x.%x\n", PCI_BUS_NUM(bdf), in bdf_max_show() 504 PCI_SLOT(bdf), PCI_FUNC(bdf)); in bdf_max_show() 667 HNS3_PMU_FORMAT_ATTR(bdf, "config1:8-23"), 824 static bool hns3_pmu_valid_bdf(struct hns3_pmu *hns3_pmu, u16 bdf) in hns3_pmu_valid_bdf() argument [all …]
|
/openbmc/u-boot/drivers/bios_emulator/ |
H A D | atibios.c | 242 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/u-boot/board/theadorable/ |
H A D | theadorable.c | 224 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/linux/drivers/crypto/intel/qat/qat_common/ |
H A D | adf_dev_mgr.c | 15 u32 bdf; member 34 static struct vf_id_map *adf_find_vf(u32 bdf) in adf_find_vf() argument 42 if (ptr->bdf == bdf) in adf_find_vf() 76 if (map->bdf != -1) { in adf_clean_vf_map() 81 if (vf && map->bdf == -1) in adf_clean_vf_map() 180 map->bdf = ~0; in adf_devmgr_add_dev() 220 map->bdf = adf_get_vf_num(accel_dev); in adf_devmgr_add_dev() 362 if (ptr->bdf != ~0 && !ptr->attached) in adf_get_num_dettached_vfs()
|