|
@@ -216,17 +216,19 @@ struct efi_pci_device * efipci_create ( struct efi_driver *efidrv,
|
216
|
216
|
*/
|
217
|
217
|
EFI_STATUS efipci_enable ( struct efi_pci_device *efipci ) {
|
218
|
218
|
EFI_PCI_IO_PROTOCOL *pci_io = efipci->pci_io;
|
219
|
|
- EFI_STATUS efirc;
|
220
|
219
|
|
221
|
|
- /* Enable device */
|
222
|
|
- if ( ( efirc = pci_io->Attributes ( pci_io,
|
223
|
|
- EfiPciIoAttributeOperationSet,
|
224
|
|
- EFI_PCI_DEVICE_ENABLE,
|
225
|
|
- NULL ) ) != 0 ) {
|
226
|
|
- DBGC ( efipci, "EFIPCI " PCI_FMT " could not be enabled: %s\n",
|
227
|
|
- PCI_ARGS ( &efipci->pci ), efi_strerror ( efirc ) );
|
228
|
|
- return efirc;
|
229
|
|
- }
|
|
220
|
+ /* Try to enable I/O cycles, memory cycles, and bus mastering.
|
|
221
|
+ * Some platforms will 'helpfully' report errors if these bits
|
|
222
|
+ * can't be enabled (for example, if the card doesn't actually
|
|
223
|
+ * support I/O cycles). Work around any such platforms by
|
|
224
|
+ * enabling bits individually and simply ignoring any errors.
|
|
225
|
+ */
|
|
226
|
+ pci_io->Attributes ( pci_io, EfiPciIoAttributeOperationEnable,
|
|
227
|
+ EFI_PCI_IO_ATTRIBUTE_IO, NULL );
|
|
228
|
+ pci_io->Attributes ( pci_io, EfiPciIoAttributeOperationEnable,
|
|
229
|
+ EFI_PCI_IO_ATTRIBUTE_MEMORY, NULL );
|
|
230
|
+ pci_io->Attributes ( pci_io, EfiPciIoAttributeOperationEnable,
|
|
231
|
+ EFI_PCI_IO_ATTRIBUTE_BUS_MASTER, NULL );
|
230
|
232
|
|
231
|
233
|
return 0;
|
232
|
234
|
}
|