Lines Matching full:devid
106 u16 devid; member
124 u16 devid; member
144 u16 devid; member
294 PCI_BUS_NUM(iommu->devid), PCI_SLOT(iommu->devid), in get_global_efr()
295 PCI_FUNC(iommu->devid)); in get_global_efr()
577 if (dev->devid > last_devid) in find_last_devid_from_ivhd()
578 last_devid = dev->devid; in find_last_devid_from_ivhd()
994 u16 devid, u8 bit) in __set_dev_entry_bit() argument
999 dev_table[devid].data[i] |= (1UL << _bit); in __set_dev_entry_bit()
1002 static void set_dev_entry_bit(struct amd_iommu *iommu, u16 devid, u8 bit) in set_dev_entry_bit() argument
1006 return __set_dev_entry_bit(dev_table, devid, bit); in set_dev_entry_bit()
1010 u16 devid, u8 bit) in __get_dev_entry_bit() argument
1015 return (dev_table[devid].data[i] & (1UL << _bit)) >> _bit; in __get_dev_entry_bit()
1018 static int get_dev_entry_bit(struct amd_iommu *iommu, u16 devid, u8 bit) in get_dev_entry_bit() argument
1022 return __get_dev_entry_bit(dev_table, devid, bit); in get_dev_entry_bit()
1030 u32 lo, hi, devid, old_devtb_size; in __copy_device_table() local
1076 for (devid = 0; devid <= pci_seg->last_bdf; ++devid) { in __copy_device_table()
1077 pci_seg->old_dev_tbl_cpy[devid] = old_devtb[devid]; in __copy_device_table()
1078 dom_id = old_devtb[devid].data[1] & DEV_DOMID_MASK; in __copy_device_table()
1079 dte_v = old_devtb[devid].data[0] & DTE_FLAG_V; in __copy_device_table()
1082 pci_seg->old_dev_tbl_cpy[devid].data[0] = old_devtb[devid].data[0]; in __copy_device_table()
1083 pci_seg->old_dev_tbl_cpy[devid].data[1] = old_devtb[devid].data[1]; in __copy_device_table()
1086 if (old_devtb[devid].data[0] & DTE_FLAG_GV) { in __copy_device_table()
1089 pci_seg->old_dev_tbl_cpy[devid].data[1] &= ~tmp; in __copy_device_table()
1092 pci_seg->old_dev_tbl_cpy[devid].data[0] &= ~tmp; in __copy_device_table()
1096 irq_v = old_devtb[devid].data[2] & DTE_IRQ_REMAP_ENABLE; in __copy_device_table()
1097 int_ctl = old_devtb[devid].data[2] & DTE_IRQ_REMAP_INTCTL_MASK; in __copy_device_table()
1098 int_tab_len = old_devtb[devid].data[2] & DTE_INTTABLEN_MASK; in __copy_device_table()
1102 pr_err("Wrong old irq remapping flag: %#x\n", devid); in __copy_device_table()
1107 pci_seg->old_dev_tbl_cpy[devid].data[2] = old_devtb[devid].data[2]; in __copy_device_table()
1142 void amd_iommu_apply_erratum_63(struct amd_iommu *iommu, u16 devid) in amd_iommu_apply_erratum_63() argument
1146 sysmgt = get_dev_entry_bit(iommu, devid, DEV_ENTRY_SYSMGT1) | in amd_iommu_apply_erratum_63()
1147 (get_dev_entry_bit(iommu, devid, DEV_ENTRY_SYSMGT2) << 1); in amd_iommu_apply_erratum_63()
1150 set_dev_entry_bit(iommu, devid, DEV_ENTRY_IW); in amd_iommu_apply_erratum_63()
1158 u16 devid, u32 flags, u32 ext_flags) in set_dev_entry_from_acpi() argument
1161 set_dev_entry_bit(iommu, devid, DEV_ENTRY_INIT_PASS); in set_dev_entry_from_acpi()
1163 set_dev_entry_bit(iommu, devid, DEV_ENTRY_EINT_PASS); in set_dev_entry_from_acpi()
1165 set_dev_entry_bit(iommu, devid, DEV_ENTRY_NMI_PASS); in set_dev_entry_from_acpi()
1167 set_dev_entry_bit(iommu, devid, DEV_ENTRY_SYSMGT1); in set_dev_entry_from_acpi()
1169 set_dev_entry_bit(iommu, devid, DEV_ENTRY_SYSMGT2); in set_dev_entry_from_acpi()
1171 set_dev_entry_bit(iommu, devid, DEV_ENTRY_LINT0_PASS); in set_dev_entry_from_acpi()
1173 set_dev_entry_bit(iommu, devid, DEV_ENTRY_LINT1_PASS); in set_dev_entry_from_acpi()
1175 amd_iommu_apply_erratum_63(iommu, devid); in set_dev_entry_from_acpi()
1177 amd_iommu_set_rlookup_table(iommu, devid); in set_dev_entry_from_acpi()
1180 int __init add_special_device(u8 type, u8 id, u32 *devid, bool cmd_line) in add_special_device() argument
1199 *devid = entry->devid; in add_special_device()
1209 entry->devid = *devid; in add_special_device()
1217 static int __init add_acpi_hid_device(u8 *hid, u8 *uid, u32 *devid, in add_acpi_hid_device() argument
1231 *devid = entry->devid; in add_acpi_hid_device()
1241 entry->devid = *devid; in add_acpi_hid_device()
1243 entry->root_devid = (entry->devid & (~0x7)); in add_acpi_hid_device()
1260 &early_ioapic_map[i].devid, in add_early_maps()
1269 &early_hpet_map[i].devid, in add_early_maps()
1278 &early_acpihid_map[i].devid, in add_early_maps()
1296 u16 devid = 0, devid_start = 0, devid_to = 0, seg_id; in init_iommu_from_acpi() local
1344 DUMP_printk(" DEV_SELECT\t\t\t devid: %04x:%02x:%02x.%x " in init_iommu_from_acpi()
1346 seg_id, PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1347 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1348 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1351 devid = e->devid; in init_iommu_from_acpi()
1352 set_dev_entry_from_acpi(iommu, devid, e->flags, 0); in init_iommu_from_acpi()
1357 "devid: %04x:%02x:%02x.%x flags: %02x\n", in init_iommu_from_acpi()
1358 seg_id, PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1359 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1360 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1363 devid_start = e->devid; in init_iommu_from_acpi()
1370 DUMP_printk(" DEV_ALIAS\t\t\t devid: %04x:%02x:%02x.%x " in init_iommu_from_acpi()
1372 seg_id, PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1373 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1374 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1380 devid = e->devid; in init_iommu_from_acpi()
1382 set_dev_entry_from_acpi(iommu, devid , e->flags, 0); in init_iommu_from_acpi()
1384 pci_seg->alias_table[devid] = devid_to; in init_iommu_from_acpi()
1389 "devid: %04x:%02x:%02x.%x flags: %02x " in init_iommu_from_acpi()
1391 seg_id, PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1392 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1393 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1399 devid_start = e->devid; in init_iommu_from_acpi()
1407 DUMP_printk(" DEV_EXT_SELECT\t\t devid: %04x:%02x:%02x.%x " in init_iommu_from_acpi()
1409 seg_id, PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1410 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1411 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1414 devid = e->devid; in init_iommu_from_acpi()
1415 set_dev_entry_from_acpi(iommu, devid, e->flags, in init_iommu_from_acpi()
1420 DUMP_printk(" DEV_EXT_SELECT_RANGE\t devid: " in init_iommu_from_acpi()
1422 seg_id, PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1423 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1424 PCI_FUNC(e->devid), in init_iommu_from_acpi()
1427 devid_start = e->devid; in init_iommu_from_acpi()
1434 DUMP_printk(" DEV_RANGE_END\t\t devid: %04x:%02x:%02x.%x\n", in init_iommu_from_acpi()
1435 seg_id, PCI_BUS_NUM(e->devid), in init_iommu_from_acpi()
1436 PCI_SLOT(e->devid), in init_iommu_from_acpi()
1437 PCI_FUNC(e->devid)); in init_iommu_from_acpi()
1439 devid = e->devid; in init_iommu_from_acpi()
1440 for (dev_i = devid_start; dev_i <= devid; ++dev_i) { in init_iommu_from_acpi()
1453 u32 devid; in init_iommu_from_acpi() local
1457 devid = PCI_SEG_DEVID_TO_SBDF(seg_id, (e->ext >> 8)); in init_iommu_from_acpi()
1469 seg_id, PCI_BUS_NUM(devid), in init_iommu_from_acpi()
1470 PCI_SLOT(devid), in init_iommu_from_acpi()
1471 PCI_FUNC(devid)); in init_iommu_from_acpi()
1473 ret = add_special_device(type, handle, &devid, false); in init_iommu_from_acpi()
1478 * add_special_device might update the devid in case a in init_iommu_from_acpi()
1482 set_dev_entry_from_acpi(iommu, devid, e->flags, 0); in init_iommu_from_acpi()
1487 u32 devid; in init_iommu_from_acpi() local
1530 devid = PCI_SEG_DEVID_TO_SBDF(seg_id, e->devid); in init_iommu_from_acpi()
1533 PCI_BUS_NUM(devid), in init_iommu_from_acpi()
1534 PCI_SLOT(devid), in init_iommu_from_acpi()
1535 PCI_FUNC(devid)); in init_iommu_from_acpi()
1539 ret = add_acpi_hid_device(hid, uid, &devid, false); in init_iommu_from_acpi()
1544 * add_special_device might update the devid in case a in init_iommu_from_acpi()
1548 set_dev_entry_from_acpi(iommu, devid, e->flags, 0); in init_iommu_from_acpi()
1742 iommu->devid = h->devid; in init_iommu_one()
1836 iommu->pci_seg->rlookup_table[iommu->devid] = NULL; in init_iommu_one_late()
1853 u16 devid = ivhd->devid; in get_highest_supported_ivhd_type() local
1859 if (ivhd->devid == devid) in get_highest_supported_ivhd_type()
1888 h->pci_seg, PCI_BUS_NUM(h->devid), in init_iommu_all()
1889 PCI_SLOT(h->devid), PCI_FUNC(h->devid), in init_iommu_all()
2014 PCI_BUS_NUM(iommu->devid), in iommu_init_pci()
2015 iommu->devid & 0xff); in iommu_init_pci()
2485 e->devid_start = e->devid_end = m->devid; in init_unity_map_range()
2494 e->devid_start = m->devid; in init_unity_map_range()
2551 u32 devid; in init_device_table_dma() local
2557 for (devid = 0; devid <= pci_seg->last_bdf; ++devid) { in init_device_table_dma()
2558 __set_dev_entry_bit(dev_table, devid, DEV_ENTRY_VALID); in init_device_table_dma()
2560 __set_dev_entry_bit(dev_table, devid, DEV_ENTRY_TRANSLATION); in init_device_table_dma()
2566 u32 devid; in uninit_device_table_dma() local
2572 for (devid = 0; devid <= pci_seg->last_bdf; ++devid) { in uninit_device_table_dma()
2573 dev_table[devid].data[0] = 0ULL; in uninit_device_table_dma()
2574 dev_table[devid].data[1] = 0ULL; in uninit_device_table_dma()
2581 u32 devid; in init_device_table() local
2587 for (devid = 0; devid <= pci_seg->last_bdf; ++devid) in init_device_table()
2589 devid, DEV_ENTRY_IRQ_TBL_EN); in init_device_table()
2902 int devid, id = mpc_ioapic_id(idx); in check_ioapic_information() local
2904 devid = get_ioapic_devid(id); in check_ioapic_information()
2905 if (devid < 0) { in check_ioapic_information()
2909 } else if (devid == IOAPIC_SB_DEVID) { in check_ioapic_information()
3406 u32 devid; in parse_ivrs_ioapic() local
3423 devid = IVRS_GET_SBDF_ID(seg, bus, dev, fn); in parse_ivrs_ioapic()
3428 early_ioapic_map[i].devid = devid; in parse_ivrs_ioapic()
3438 u32 devid; in parse_ivrs_hpet() local
3455 devid = IVRS_GET_SBDF_ID(seg, bus, dev, fn); in parse_ivrs_hpet()
3460 early_hpet_map[i].devid = devid; in parse_ivrs_hpet()
3494 early_acpihid_map[i].devid = IVRS_GET_SBDF_ID(seg, bus, dev, fn); in parse_ivrs_acpihid()