hv: vpci: modify Interrupt Line Register as writable

According to PCIe Spec, for a RW register bits, If the optional feature
that is associated with the bits is not implemented, the bits are permitted
to be hardwired to 0b. However Zephyr would use INTx Line Register as writable
even this PCI device has no INTx, so emulate INTx Line Register as writable.

Tracked-On: #6330
Signed-off-by: Fei Li <fei1.li@intel.com>
This commit is contained in:
Fei Li 2021-07-23 08:59:35 +08:00 committed by wenlingz
parent 481e9fba9d
commit bc5c3a0bb7

View File

@ -482,6 +482,17 @@ static void write_cfg_header(struct pci_vdev *vdev,
pci_vdev_write_vcfg(vdev, offset, bytes, val); pci_vdev_write_vcfg(vdev, offset, bytes, val);
} }
} }
/* According to PCIe Spec, for a RW register bits, If the optional feature
* that is associated with the bits is not implemented, the bits are permitted
* to be hardwired to 0b. However Zephyr would use INTx Line Register as writable
* even this PCI device has no INTx, so emulate INTx Line Register as writable.
*/
if (offset == PCIR_INTERRUPT_LINE) {
val &= 0xfU;
pci_vdev_write_vcfg(vdev, offset, bytes, val);
}
} }
} }