2019-05-27 06:55:01 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2007-06-06 06:52:38 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
|
|
|
|
* Author: Fuxin Zhang, zhangfx@lemote.com
|
|
|
|
*/
|
|
|
|
#include <linux/pci.h>
|
|
|
|
|
2009-07-02 15:23:03 +00:00
|
|
|
#include <pci.h>
|
|
|
|
#include <loongson.h>
|
2014-03-21 10:44:02 +00:00
|
|
|
#include <boot_param.h>
|
2007-06-06 06:52:38 +00:00
|
|
|
|
2009-07-02 15:26:45 +00:00
|
|
|
static struct resource loongson_pci_mem_resource = {
|
2013-01-22 11:59:30 +00:00
|
|
|
.name = "pci memory space",
|
|
|
|
.start = LOONGSON_PCI_MEM_START,
|
|
|
|
.end = LOONGSON_PCI_MEM_END,
|
|
|
|
.flags = IORESOURCE_MEM,
|
2007-06-06 06:52:38 +00:00
|
|
|
};
|
|
|
|
|
2009-07-02 15:26:45 +00:00
|
|
|
static struct resource loongson_pci_io_resource = {
|
2013-01-22 11:59:30 +00:00
|
|
|
.name = "pci io space",
|
|
|
|
.start = LOONGSON_PCI_IO_START,
|
|
|
|
.end = IO_SPACE_LIMIT,
|
|
|
|
.flags = IORESOURCE_IO,
|
2007-06-06 06:52:38 +00:00
|
|
|
};
|
|
|
|
|
2009-07-02 15:26:45 +00:00
|
|
|
static struct pci_controller loongson_pci_controller = {
|
2013-01-22 11:59:30 +00:00
|
|
|
.pci_ops = &loongson_pci_ops,
|
|
|
|
.io_resource = &loongson_pci_io_resource,
|
|
|
|
.mem_resource = &loongson_pci_mem_resource,
|
|
|
|
.mem_offset = 0x00000000UL,
|
|
|
|
.io_offset = 0x00000000UL,
|
2007-06-06 06:52:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-03-29 02:54:10 +00:00
|
|
|
extern int sbx00_acpi_init(void);
|
|
|
|
|
2007-06-06 06:52:38 +00:00
|
|
|
static int __init pcibios_init(void)
|
|
|
|
{
|
2008-10-27 23:33:24 +00:00
|
|
|
|
2009-07-02 15:26:45 +00:00
|
|
|
loongson_pci_controller.io_map_base = mips_io_port_base;
|
2014-03-21 10:44:02 +00:00
|
|
|
loongson_pci_mem_resource.start = loongson_sysconf.pci_mem_start_addr;
|
|
|
|
loongson_pci_mem_resource.end = loongson_sysconf.pci_mem_end_addr;
|
2019-10-20 15:01:35 +00:00
|
|
|
|
2009-07-02 15:26:45 +00:00
|
|
|
register_pci_controller(&loongson_pci_controller);
|
2007-06-06 06:52:38 +00:00
|
|
|
|
2015-03-29 02:54:10 +00:00
|
|
|
sbx00_acpi_init();
|
|
|
|
|
2007-06-06 06:52:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
arch_initcall(pcibios_init);
|