1
2
3
4
5
6#include <linux/pci.h>
7#include <linux/init.h>
8
9#include <asm/machvec.h>
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27static void pci_fixup_video(struct pci_dev *pdev)
28{
29 struct pci_dev *bridge;
30 struct pci_bus *bus;
31 u16 config;
32
33 if ((strcmp(ia64_platform_name, "dig") != 0)
34 && (strcmp(ia64_platform_name, "hpzx1") != 0))
35 return;
36
37
38 if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
39 return;
40
41
42 bus = pdev->bus;
43 while (bus) {
44 bridge = bus->self;
45
46
47
48
49
50
51
52
53 if (bridge
54 &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE)
55 ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) {
56 pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
57 &config);
58 if (!(config & PCI_BRIDGE_CTL_VGA))
59 return;
60 }
61 bus = bus->parent;
62 }
63 pci_read_config_word(pdev, PCI_COMMAND, &config);
64 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
65 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
66 dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
67 }
68}
69DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
70