hvmloader: enable bus mastering of PCI device
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 11 Dec 2008 13:26:02 +0000 (13:26 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 11 Dec 2008 13:26:02 +0000 (13:26 +0000)
Without this, init routine in some PCI option ROM doesn't work well.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
tools/firmware/hvmloader/hvmloader.c

index bff548f9f25a294096f4e0e468f8622114fddf20..9723306f8e261bf7dea40393160877c689579269 100644 (file)
@@ -269,6 +269,11 @@ static void pci_setup(void)
             printf("pci dev %02x:%x INT%c->IRQ%u\n",
                    devfn>>3, devfn&7, 'A'+pin-1, isa_irq);
         }
+
+        /* Enable bus mastering. */
+        cmd = pci_readw(devfn, PCI_COMMAND);
+        cmd |= PCI_COMMAND_MASTER;
+        pci_writew(devfn, PCI_COMMAND, cmd);
     }
 
     /* Assign iomem and ioport resources in descending order of size. */