nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0017-EHCI-and-OHCI-PCI-bus-master.patch

f96e0b
From 6054ac4ca1ce5f3e4589bfead3c9c05af89f9ace Mon Sep 17 00:00:00 2001
f96e0b
From: starous <starous@pracovna>
f96e0b
Date: Sun, 22 Jul 2012 21:09:30 +0200
f96e0b
Subject: [PATCH 017/482] EHCI and OHCI PCI bus master
f96e0b
f96e0b
---
f96e0b
 ChangeLog                | 5 +++++
f96e0b
 grub-core/bus/usb/ehci.c | 5 +++++
f96e0b
 grub-core/bus/usb/ohci.c | 5 +++++
f96e0b
 3 files changed, 15 insertions(+)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index 0db6239..01d4f92 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,3 +1,8 @@
f96e0b
+2012-07-22  Ales Nesrsta  <starous@volny.cz>
f96e0b
+
f96e0b
+	* grub-core/bus/usb/ehci.c: PCI iter. - added PCI bus master setting.
f96e0b
+	* grub-core/bus/usb/ohci.c: PCI iter. - added PCI bus master setting.
f96e0b
+
f96e0b
 2012-07-22  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
 	* util/grub-mkconfig_lib.in (grub_quote): Remove extra layer of escape.
f96e0b
diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c
f96e0b
index b700519..d99a4be 100644
f96e0b
--- a/grub-core/bus/usb/ehci.c
f96e0b
+++ b/grub-core/bus/usb/ehci.c
f96e0b
@@ -533,6 +533,11 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
f96e0b
 			"EHCI grub_ehci_pci_iter: registers above 4G are not supported\n");
f96e0b
 	  return 0;
f96e0b
 	}
f96e0b
+
f96e0b
+      /* Set bus master - needed for coreboot, VMware, broken BIOSes etc. */
f96e0b
+      addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
f96e0b
+      grub_pci_write_word(addr,
f96e0b
+          GRUB_PCI_COMMAND_BUS_MASTER | grub_pci_read_word(addr));
f96e0b
       
f96e0b
       grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: 32-bit EHCI OK\n");
f96e0b
     }
f96e0b
diff --git a/grub-core/bus/usb/ohci.c b/grub-core/bus/usb/ohci.c
f96e0b
index 23cf631..6fabb4b 100644
f96e0b
--- a/grub-core/bus/usb/ohci.c
f96e0b
+++ b/grub-core/bus/usb/ohci.c
f96e0b
@@ -270,6 +270,11 @@ grub_ohci_pci_iter (grub_pci_device_t dev,
f96e0b
 	return 0;
f96e0b
 #endif
f96e0b
 
f96e0b
+      /* Set bus master - needed for coreboot, VMware, broken BIOSes etc. */
f96e0b
+      addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
f96e0b
+      grub_pci_write_word(addr,
f96e0b
+          GRUB_PCI_COMMAND_BUS_MASTER | grub_pci_read_word(addr));
f96e0b
+
f96e0b
       grub_dprintf ("ohci", "class=0x%02x 0x%02x interface 0x%02x\n",
f96e0b
 		    class, subclass, interf);
f96e0b
     }
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b