Skip to content

Commit

Permalink
MIPS: Loongson64: Switch to generic PCI driver
Browse files Browse the repository at this point in the history
We can now enable generic PCI driver in Kconfig, and remove legacy
PCI driver code.

Radeon vbios quirk is moved to the platform folder to fit the
new structure.

Signed-off-by: Jiaxun Yang <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
  • Loading branch information
FlyGoat authored and tsbogend committed May 27, 2020
1 parent d8242e6 commit 6423e59
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 189 deletions.
1 change: 1 addition & 0 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ config MACH_LOONGSON64
select IRQ_MIPS_CPU
select NR_CPUS_DEFAULT_64
select USE_GENERIC_EARLY_PRINTK_8250
select PCI_DRIVERS_GENERIC
select SYS_HAS_CPU_LOONGSON64
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_SMP
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/loongson64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ obj-$(CONFIG_MACH_LOONGSON64) += cop2-ex.o platform.o dma.o \
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_NUMA) += numa.o
obj-$(CONFIG_RS780_HPET) += hpet.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_SUSPEND) += pm.o
obj-$(CONFIG_PCI_QUIRKS) += vbios_quirk.o
obj-$(CONFIG_CPU_LOONGSON3_CPUCFG_EMULATION) += cpucfg-emul.o
29 changes: 29 additions & 0 deletions arch/mips/loongson64/vbios_quirk.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-2.0+

#include <linux/pci.h>
#include <loongson.h>

static void pci_fixup_radeon(struct pci_dev *pdev)
{
struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];

if (res->start)
return;

if (!loongson_sysconf.vgabios_addr)
return;

pci_disable_rom(pdev);
if (res->parent)
release_resource(res);

res->start = virt_to_phys((void *) loongson_sysconf.vgabios_addr);
res->end = res->start + 256*1024 - 1;
res->flags = IORESOURCE_MEM | IORESOURCE_ROM_SHADOW |
IORESOURCE_PCI_FIXED;

dev_info(&pdev->dev, "BAR %d: assigned %pR for Radeon ROM\n",
PCI_ROM_RESOURCE, res);
}
DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, 0x9615,
PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_radeon);
1 change: 0 additions & 1 deletion arch/mips/pci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ obj-$(CONFIG_ATH79) += fixup-ath79.o
obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o
obj-$(CONFIG_LEMOTE_FULOONG2E) += fixup-fuloong2e.o ops-loongson2.o
obj-$(CONFIG_LEMOTE_MACH2F) += fixup-lemote2f.o ops-loongson2.o
obj-$(CONFIG_MACH_LOONGSON64) += fixup-loongson3.o ops-loongson3.o
obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o pci-malta.o
obj-$(CONFIG_SGI_IP27) += pci-ip27.o
obj-$(CONFIG_SGI_IP32) += fixup-ip32.o ops-mace.o pci-ip32.o
Expand Down
71 changes: 0 additions & 71 deletions arch/mips/pci/fixup-loongson3.c

This file was deleted.

116 changes: 0 additions & 116 deletions arch/mips/pci/ops-loongson3.c

This file was deleted.

0 comments on commit 6423e59

Please sign in to comment.