Lines Matching +full:cfg +full:- +full:space
2 * Copyright(c) 2011-2016 Intel Corporation. All rights reserved.
45 /* bitmap for writable bits (RW or RW1C bits, but cannot co-exist in one
46 * byte) byte by byte in standard pci configuration space. (not the full
53 [PCI_BASE_ADDRESS_0 ... PCI_CARDBUS_CIS - 1] = 0xff,
59 * vgpu_pci_cfg_mem_write - write virtual cfg space memory
65 * Use this function to write virtual cfg space memory.
66 * For standard cfg space, only RW bits can be changed,
93 /* For other configuration space directly copy as it is. */ in vgpu_pci_cfg_mem_write()
95 memcpy(cfg_base + off + i, src + i, bytes - i); in vgpu_pci_cfg_mem_write()
97 if (off == vgpu->cfg_space.pmcsr_off && vgpu->cfg_space.pmcsr_off) { in vgpu_pci_cfg_mem_write()
101 vgpu->d3_entered = true; in vgpu_pci_cfg_mem_write()
102 gvt_dbg_core("vgpu-%d power status changed to %d\n", in vgpu_pci_cfg_mem_write()
103 vgpu->id, pwr); in vgpu_pci_cfg_mem_write()
108 * intel_vgpu_emulate_cfg_read - emulate vGPU configuration space read
120 struct drm_i915_private *i915 = vgpu->gvt->gt->i915; in intel_vgpu_emulate_cfg_read()
122 if (drm_WARN_ON(&i915->drm, bytes > 4)) in intel_vgpu_emulate_cfg_read()
123 return -EINVAL; in intel_vgpu_emulate_cfg_read()
125 if (drm_WARN_ON(&i915->drm, in intel_vgpu_emulate_cfg_read()
126 offset + bytes > vgpu->gvt->device_info.cfg_space_size)) in intel_vgpu_emulate_cfg_read()
127 return -EINVAL; in intel_vgpu_emulate_cfg_read()
135 if (map != vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_APERTURE].tracked) in map_aperture()
136 vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_APERTURE].tracked = map; in map_aperture()
141 if (trap != vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_GTTMMIO].tracked) in trap_gttmmio()
142 vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_GTTMMIO].tracked = trap; in trap_gttmmio()
189 struct intel_vgpu_pci_bar *bars = vgpu->cfg_space.bar; in emulate_pci_bar_write()
192 * Power-up software can determine how much address in emulate_pci_bar_write()
193 * space the device requires by writing a value of in emulate_pci_bar_write()
195 * back. The device will return 0's in all don't-care in emulate_pci_bar_write()
202 size = ~(bars[INTEL_GVT_PCI_BAR_GTTMMIO].size -1); in emulate_pci_bar_write()
213 size = ~(bars[INTEL_GVT_PCI_BAR_APERTURE].size -1); in emulate_pci_bar_write()
228 * re-configured the BAR in emulate_pci_bar_write()
247 * intel_vgpu_emulate_cfg_write - emulate vGPU configuration space write
259 struct drm_i915_private *i915 = vgpu->gvt->gt->i915; in intel_vgpu_emulate_cfg_write()
262 if (drm_WARN_ON(&i915->drm, bytes > 4)) in intel_vgpu_emulate_cfg_write()
263 return -EINVAL; in intel_vgpu_emulate_cfg_write()
265 if (drm_WARN_ON(&i915->drm, in intel_vgpu_emulate_cfg_write()
266 offset + bytes > vgpu->gvt->device_info.cfg_space_size)) in intel_vgpu_emulate_cfg_write()
267 return -EINVAL; in intel_vgpu_emulate_cfg_write()
271 if (drm_WARN_ON(&i915->drm, bytes > 2)) in intel_vgpu_emulate_cfg_write()
272 return -EINVAL; in intel_vgpu_emulate_cfg_write()
278 if (drm_WARN_ON(&i915->drm, !IS_ALIGNED(offset, 4))) in intel_vgpu_emulate_cfg_write()
279 return -EINVAL; in intel_vgpu_emulate_cfg_write()
283 if (drm_WARN_ON(&i915->drm, !IS_ALIGNED(offset, 4))) in intel_vgpu_emulate_cfg_write()
284 return -EINVAL; in intel_vgpu_emulate_cfg_write()
288 if (drm_WARN_ON(&i915->drm, !IS_ALIGNED(offset, 4))) in intel_vgpu_emulate_cfg_write()
289 return -EINVAL; in intel_vgpu_emulate_cfg_write()
296 if (drm_WARN_ON(&i915->drm, !IS_ALIGNED(offset, 4))) in intel_vgpu_emulate_cfg_write()
297 return -EINVAL; in intel_vgpu_emulate_cfg_write()
313 * intel_vgpu_init_cfg_space - init vGPU configuration space when create vGPU
322 struct intel_gvt *gvt = vgpu->gvt; in intel_vgpu_init_cfg_space()
323 struct pci_dev *pdev = to_pci_dev(gvt->gt->i915->drm.dev); in intel_vgpu_init_cfg_space()
324 const struct intel_gvt_device_info *info = &gvt->device_info; in intel_vgpu_init_cfg_space()
328 memcpy(vgpu_cfg_space(vgpu), gvt->firmware.cfg_space, in intel_vgpu_init_cfg_space()
329 info->cfg_space_size); in intel_vgpu_init_cfg_space()
356 vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_GTTMMIO].size = in intel_vgpu_init_cfg_space()
358 vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_APERTURE].size = in intel_vgpu_init_cfg_space()
364 vgpu->cfg_space.pmcsr_off = 0; in intel_vgpu_init_cfg_space()
369 vgpu->cfg_space.pmcsr_off = next + PCI_PM_CTRL; in intel_vgpu_init_cfg_space()
378 * intel_vgpu_reset_cfg_space - reset vGPU configuration space
396 * owned by any VM, so we simply restore entire cfg in intel_vgpu_reset_cfg_space()
397 * space to default value. in intel_vgpu_reset_cfg_space()