Lines Matching +full:ats +full:- +full:supported

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
52 device_t *ivhd_devs; /* IVHD or AMD-Vi device list. */
77 if (ivrs->Header.Length == 0) {
82 end = (ACPI_IVRS_HEADER *)((char *)ivrs + ivrs->Header.Length);
85 if ((uint8_t *)ivrs_hdr + ivrs_hdr->Length > (uint8_t *)end) {
86 printf("AMD-Vi:IVHD/IVMD is corrupted, length : %d\n",
87 ivrs_hdr->Length);
91 switch (ivrs_hdr->Type) {
108 printf("AMD-Vi:Not IVHD/IVMD type(%d)", ivrs_hdr->Type);
112 ivrs_hdr->Length);
131 /* Count the number of AMD-Vi devices in the system. */
138 if (ivrs_is_ivhd(ivrs_he->Type))
155 if (ivrs_is_ivhd(ivrs_hdr->Type)) {
156 if (fi->i == 0) {
157 fi->ptr = ivrs_hdr;
160 fi->i--;
181 uint32_t end_id, uint8_t cfg, bool ats)
185 KASSERT(softc->dev_cfg_cap >= softc->dev_cfg_cnt,
187 if (softc->dev_cfg_cap == softc->dev_cfg_cnt) {
188 if (softc->dev_cfg_cap == 0)
189 softc->dev_cfg_cap = 1;
191 softc->dev_cfg_cap <<= 2;
192 softc->dev_cfg = realloc(softc->dev_cfg,
193 sizeof(*softc->dev_cfg) * softc->dev_cfg_cap, M_DEVBUF,
197 dev_cfg = &softc->dev_cfg[softc->dev_cfg_cnt++];
198 dev_cfg->start_id = start_id;
199 dev_cfg->end_id = end_id;
200 dev_cfg->data = cfg;
201 dev_cfg->enable_ats = ats;
212 int range_start_id = -1, range_end_id = -1, i;
217 switch (ivhd->Header.Type) {
228 device_printf(softc->dev,
229 "unknown type: 0x%x\n", ivhd->Header.Type);
230 return (-1);
233 end = (uint8_t *)ivhd + ivhd->Header.Length;
237 switch (de->Type) {
239 all_data = de->DataSetting;
240 for (i = 0; i < softc->dev_cfg_cnt; i++)
241 softc->dev_cfg[i].data |= all_data;
248 if (de->Type == ACPI_IVRS_TYPE_EXT_SELECT) {
254 ivhd_dev_add_entry(softc, de->Id, de->Id,
255 de->DataSetting | all_data, enable_ats);
261 if (range_start_id != -1) {
262 device_printf(softc->dev,
263 "Unexpected start-of-range device entry\n");
266 range_start_id = de->Id;
267 range_data = de->DataSetting;
268 if (de->Type == ACPI_IVRS_TYPE_EXT_START) {
277 if (range_start_id == -1) {
278 device_printf(softc->dev,
279 "Unexpected end-of-range device entry\n");
282 range_end_id = de->Id;
284 device_printf(softc->dev,
290 range_start_id = range_end_id = -1;
302 if ((de->Type < 5) ||
303 (de->Type >= ACPI_IVRS_TYPE_PAD8))
304 device_printf(softc->dev,
305 "Unknown dev entry:0x%x\n", de->Type);
308 if (de->Type < 0x40)
310 else if (de->Type < 0x80)
313 printf("Variable size IVHD type 0x%x not supported\n",
314 de->Type);
325 if (old->DeviceId == new->DeviceId) {
329 if (old->Type == IVRS_TYPE_HARDWARE_LEGACY &&
330 ((new->Type == IVRS_TYPE_HARDWARE_EFR) ||
331 (new->Type == IVRS_TYPE_HARDWARE_MIXED)))
338 if (old->Type == IVRS_TYPE_HARDWARE_EFR &&
339 new->Type == IVRS_TYPE_HARDWARE_MIXED)
362 if (ivrs->Header.Length == 0) {
366 ivrs_ivinfo = ivrs->Info;
367 printf("AMD-Vi: IVRS Info VAsize = %d PAsize = %d GVAsize = %d"
384 * Scan for presence of legacy and non-legacy device type
391 if (ivhd_is_newer(&ivhd_hdrs[j]->Header, &ivhd->Header))
407 * the Host-PCI bridge and the root PCI bus.
419 printf("AMD-Vi: can't find ivhd%d\n", i);
447 switch (ivhd->Header.Type) {
449 device_set_desc(dev, "AMD-Vi/IOMMU ivhd with EFR");
453 device_set_desc(dev, "AMD-Vi/IOMMU ivhd in mixed format");
458 device_set_desc(dev, "AMD-Vi/IOMMU ivhd");
470 * been moved to EFR for non-legacy device.
534 /* Fewer features or attributes are reported in non-legacy type. */
614 dev = softc->dev;
616 ivhd_print_flag(dev, softc->ivhd_type, softc->ivhd_flag);
617 ivhd_print_feature(dev, softc->ivhd_type, softc->ivhd_feature);
618 ivhd_print_ext_feature(dev, softc->ext_feature);
626 device_printf(softc->dev, "supported paging level:%d, will use only: %d\n",
649 softc->dev = dev;
652 softc->pci_dev = pci_find_dbsf(ivhd->PciSegmentGroup,
653 PCI_RID2BUS(ivhd->Header.DeviceId),
654 PCI_RID2SLOT(ivhd->Header.DeviceId),
655 PCI_RID2FUNC(ivhd->Header.DeviceId));
657 softc->ivhd_type = ivhd->Header.Type;
658 softc->pci_seg = ivhd->PciSegmentGroup;
659 softc->pci_rid = ivhd->Header.DeviceId;
660 softc->ivhd_flag = ivhd->Header.Flags;
665 softc->ivhd_feature = ivhd->FeatureReporting;
669 softc->cap_off = ivhd->CapabilityOffset;
673 softc->event_msix = ivhd->Info & 0x1F;
675 switch (ivhd->Header.Type) {
679 softc->ext_feature = ivhd_efr->EfrRegisterImage;
683 softc->ctrl = (struct amdvi_ctrl *) PHYS_TO_DMAP(ivhd->BaseAddress);
705 free(softc->dev_cfg, M_DEVBUF);
717 free(softc->dev_cfg, M_DEVBUF);
757 * Load this module at the end after PCI re-probing to configure interrupt.