This source file includes following definitions.
- print_fixup_info
- pcibios_map_irq
- pci_fixup_radeon
- pcibios_plat_dev_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 #include <linux/pci.h>
27 #include <boot_param.h>
28
29 static void print_fixup_info(const struct pci_dev *pdev)
30 {
31 dev_info(&pdev->dev, "Device %x:%x, irq %d\n",
32 pdev->vendor, pdev->device, pdev->irq);
33 }
34
35 int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
36 {
37 print_fixup_info(dev);
38 return dev->irq;
39 }
40
41 static void pci_fixup_radeon(struct pci_dev *pdev)
42 {
43 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
44
45 if (res->start)
46 return;
47
48 if (!loongson_sysconf.vgabios_addr)
49 return;
50
51 pci_disable_rom(pdev);
52 if (res->parent)
53 release_resource(res);
54
55 res->start = virt_to_phys((void *) loongson_sysconf.vgabios_addr);
56 res->end = res->start + 256*1024 - 1;
57 res->flags = IORESOURCE_MEM | IORESOURCE_ROM_SHADOW |
58 IORESOURCE_PCI_FIXED;
59
60 dev_info(&pdev->dev, "BAR %d: assigned %pR for Radeon ROM\n",
61 PCI_ROM_RESOURCE, res);
62 }
63
64 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, PCI_ANY_ID,
65 PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_radeon);
66
67
68 int pcibios_plat_dev_init(struct pci_dev *dev)
69 {
70 return 0;
71 }