Lines Matching +full:data +full:- +full:bits
3 * SPDX-License-Identifier: Apache-2.0
86 struct vtd_ictl_data *data = dev->data; in vtd_flush_irte_from_cache() local
88 if (!data->pwc) { in vtd_flush_irte_from_cache()
89 cache_data_flush_range(&data->irte[irte_idx], in vtd_flush_irte_from_cache()
96 struct vtd_ictl_data *data = dev->data; in vtd_qi_init() local
100 data->qi_tail = 0; in vtd_qi_init()
102 value = VTD_IQA_REG_GEN_CONTENT((uintptr_t)data->qi, in vtd_qi_init()
111 struct vtd_ictl_data *data = dev->data; in vtd_qi_tail_inc() local
113 data->qi_tail += sizeof(struct qi_descriptor); in vtd_qi_tail_inc()
114 data->qi_tail %= (QI_NUM * sizeof(struct qi_descriptor)); in vtd_qi_tail_inc()
120 struct vtd_ictl_data *data = dev->data; in vtd_qi_send() local
126 desc = (struct qi_descriptor *)((uintptr_t)data->qi + data->qi_tail); in vtd_qi_send()
128 desc->low = descriptor->low; in vtd_qi_send()
129 desc->high = descriptor->high; in vtd_qi_send()
142 desc->low = wait_desc.desc.low; in vtd_qi_send()
143 desc->high = wait_desc.desc.high; in vtd_qi_send()
147 vtd_write_reg64(dev, VTD_IQT_REG, data->qi_tail); in vtd_qi_send()
154 * is not initialized yet since VT-D init comes first. in vtd_qi_send()
158 return -ETIME; in vtd_qi_send()
163 return -EIO; in vtd_qi_send()
248 struct vtd_ictl_data *data = dev->data; in fault_event_isr() local
260 while (f_idx < data->fault_record_num) { in fault_event_isr()
263 /* Reading fault's 64 lowest bits */ in fault_event_isr()
264 fault_l = vtd_read_reg64(dev, data->fault_record_reg + in fault_event_isr()
266 /* Reading fault's 64 highest bits */ in fault_event_isr()
267 fault_h = vtd_read_reg64(dev, data->fault_record_reg + in fault_event_isr()
275 vtd_write_reg64(dev, data->fault_record_reg + in fault_event_isr()
277 vtd_write_reg64(dev, data->fault_record_reg + in fault_event_isr()
288 struct vtd_ictl_data *data = dev->data; in vtd_fault_event_init() local
293 data->fault_record_num = VTD_CAP_NFR(value) + 1; in vtd_fault_event_init()
294 data->fault_record_reg = DEVICE_MMIO_GET(dev) + in vtd_fault_event_init()
298 * by-passing remapping by using x86 functions directly. in vtd_fault_event_init()
300 data->fault_irq = arch_irq_allocate(); in vtd_fault_event_init()
301 data->fault_vector = z_x86_allocate_vector(0, -1); in vtd_fault_event_init()
303 vtd_write_reg32(dev, VTD_FEDATA_REG, data->fault_vector); in vtd_fault_event_init()
305 pcie_msi_map(data->fault_irq, NULL, 0)); in vtd_fault_event_init()
308 z_x86_irq_connect_on_vector(data->fault_irq, data->fault_vector, in vtd_fault_event_init()
323 struct vtd_ictl_data *data = dev->data; in vtd_ictl_allocate_entries() local
326 if ((data->irte_num_used + n_entries) > IRTE_NUM) { in vtd_ictl_allocate_entries()
327 return -EBUSY; in vtd_ictl_allocate_entries()
330 irte_idx_start = data->irte_num_used; in vtd_ictl_allocate_entries()
331 data->irte_num_used += n_entries; in vtd_ictl_allocate_entries()
342 return VTD_MSI_MAP(vector->arch.irte, shv); in vtd_ictl_remap_msi()
351 struct vtd_ictl_data *data = dev->data; in vtd_ictl_remap() local
355 irte.bits.vector = vector; in vtd_ictl_remap()
359 irte.bits.dst_id = x86_read_loapic(LOAPIC_LDR); in vtd_ictl_remap()
362 irte.bits.dst_id = 0xFF << 8; in vtd_ictl_remap()
367 irte.bits.src_validation_type = 1; in vtd_ictl_remap()
368 irte.bits.src_id = src_id; in vtd_ictl_remap()
377 irte.bits.trigger_mode = (flags & IOAPIC_TRIGGER_MASK) >> 15; in vtd_ictl_remap()
378 irte.bits.delivery_mode = delivery_mode >> 8; in vtd_ictl_remap()
379 irte.bits.redirection_hint = 1; in vtd_ictl_remap()
380 irte.bits.dst_mode = 1; /* Always logical */ in vtd_ictl_remap()
381 irte.bits.present = 1; in vtd_ictl_remap()
383 data->irte[irte_idx].parts.low = irte.parts.low; in vtd_ictl_remap()
384 data->irte[irte_idx].parts.high = irte.parts.high; in vtd_ictl_remap()
397 struct vtd_ictl_data *data = dev->data; in vtd_ictl_set_irte_vector() local
399 data->vectors[irte_idx] = vector; in vtd_ictl_set_irte_vector()
407 struct vtd_ictl_data *data = dev->data; in vtd_ictl_get_irte_by_vector() local
411 if (data->vectors[irte_idx] == vector) { in vtd_ictl_get_irte_by_vector()
416 return -EINVAL; in vtd_ictl_get_irte_by_vector()
422 struct vtd_ictl_data *data = dev->data; in vtd_ictl_get_irte_vector() local
424 return data->vectors[irte_idx]; in vtd_ictl_get_irte_vector()
431 struct vtd_ictl_data *data = dev->data; in vtd_ictl_set_irte_irq() local
433 data->irqs[irte_idx] = irq; in vtd_ictl_set_irte_irq()
441 struct vtd_ictl_data *data = dev->data; in vtd_ictl_get_irte_by_irq() local
445 if (data->irqs[irte_idx] == irq) { in vtd_ictl_get_irte_by_irq()
450 return -EINVAL; in vtd_ictl_get_irte_by_irq()
456 struct vtd_ictl_data *data = dev->data; in vtd_ictl_set_irte_msi() local
458 data->msi[irte_idx] = msi; in vtd_ictl_set_irte_msi()
464 struct vtd_ictl_data *data = dev->data; in vtd_ictl_irte_is_msi() local
466 return data->msi[irte_idx]; in vtd_ictl_irte_is_msi()
471 struct vtd_ictl_data *data = dev->data; in vtd_ictl_init() local
481 data->pwc = true; in vtd_ictl_init()
490 ret = -EIO; in vtd_ictl_init()
498 value = VTD_IRTA_REG_GEN_CONTENT((uintptr_t)data->irte, in vtd_ictl_init()
505 ret = -EIO; in vtd_ictl_init()
517 printk("Intel VT-D up and running (status 0x%x)\n", in vtd_ictl_init()
540 .irqs = { -EINVAL },
541 .vectors = { -EINVAL },