i945: Reset IGD on boot

This is mostly necessary for reboot, but it doesn't hurt the boot process.
On reboot explicitely reset the integrated graphics, otherwise the VGABIOS
might not be able to reinitialize it properly, and you either have a still
of the last pre-reboot image, garbage or an empty screen, but no text-mode.

Change-Id: Ic3d6932fbaf720d88daaac7e4b09c3c0b9f0b0e2
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1178
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
This commit is contained in:
Patrick Georgi 2012-07-06 11:31:39 +02:00 committed by Peter Stuge
parent 3397ceff7b
commit 6444bd4547
1 changed files with 10 additions and 0 deletions

View File

@ -18,15 +18,25 @@
*/ */
#include <console/console.h> #include <console/console.h>
#include <delay.h>
#include <device/device.h> #include <device/device.h>
#include <device/pci.h> #include <device/pci.h>
#include <device/pci_ids.h> #include <device/pci_ids.h>
#include <pc80/mc146818rtc.h> #include <pc80/mc146818rtc.h>
#define GDRST 0xc0
static void gma_func0_init(struct device *dev) static void gma_func0_init(struct device *dev)
{ {
u32 reg32; u32 reg32;
/* Unconditionally reset graphics */
pci_write_config8(dev, GDRST, 1);
udelay(50);
pci_write_config8(dev, GDRST, 0);
/* wait for device to finish */
while (pci_read_config8(dev, GDRST) & 1) { };
/* IGD needs to be Bus Master */ /* IGD needs to be Bus Master */
reg32 = pci_read_config32(dev, PCI_COMMAND); reg32 = pci_read_config32(dev, PCI_COMMAND);
pci_write_config32(dev, PCI_COMMAND, reg32 | PCI_COMMAND_MASTER); pci_write_config32(dev, PCI_COMMAND, reg32 | PCI_COMMAND_MASTER);