Merge tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[linux/fpc-iii.git] / arch / mips / loongson64 / vbios_quirk.c
blob9a29e94d3db1d072b795bd3f512d4aa5a1adf61f
1 // SPDX-License-Identifier: GPL-2.0+
3 #include <linux/pci.h>
4 #include <loongson.h>
6 static void pci_fixup_radeon(struct pci_dev *pdev)
8 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
10 if (res->start)
11 return;
13 if (!loongson_sysconf.vgabios_addr)
14 return;
16 pci_disable_rom(pdev);
17 if (res->parent)
18 release_resource(res);
20 res->start = virt_to_phys((void *) loongson_sysconf.vgabios_addr);
21 res->end = res->start + 256*1024 - 1;
22 res->flags = IORESOURCE_MEM | IORESOURCE_ROM_SHADOW |
23 IORESOURCE_PCI_FIXED;
25 dev_info(&pdev->dev, "BAR %d: assigned %pR for Radeon ROM\n",
26 PCI_ROM_RESOURCE, res);
28 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, 0x9615,
29 PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_radeon);