]> asedeno.scripts.mit.edu Git - linux.git/blob - arch/mips/loongson64/pci.c
ARM: bcm2835_defconfig: Explicitly restore CONFIG_DEBUG_FS
[linux.git] / arch / mips / loongson64 / pci.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
4  * Author: Fuxin Zhang, zhangfx@lemote.com
5  */
6 #include <linux/pci.h>
7
8 #include <pci.h>
9 #include <loongson.h>
10 #include <boot_param.h>
11
12 static struct resource loongson_pci_mem_resource = {
13         .name   = "pci memory space",
14         .start  = LOONGSON_PCI_MEM_START,
15         .end    = LOONGSON_PCI_MEM_END,
16         .flags  = IORESOURCE_MEM,
17 };
18
19 static struct resource loongson_pci_io_resource = {
20         .name   = "pci io space",
21         .start  = LOONGSON_PCI_IO_START,
22         .end    = IO_SPACE_LIMIT,
23         .flags  = IORESOURCE_IO,
24 };
25
26 static struct pci_controller  loongson_pci_controller = {
27         .pci_ops        = &loongson_pci_ops,
28         .io_resource    = &loongson_pci_io_resource,
29         .mem_resource   = &loongson_pci_mem_resource,
30         .mem_offset     = 0x00000000UL,
31         .io_offset      = 0x00000000UL,
32 };
33
34
35 extern int sbx00_acpi_init(void);
36
37 static int __init pcibios_init(void)
38 {
39
40         loongson_pci_controller.io_map_base = mips_io_port_base;
41         loongson_pci_mem_resource.start = loongson_sysconf.pci_mem_start_addr;
42         loongson_pci_mem_resource.end = loongson_sysconf.pci_mem_end_addr;
43
44         register_pci_controller(&loongson_pci_controller);
45
46         sbx00_acpi_init();
47
48         return 0;
49 }
50
51 arch_initcall(pcibios_init);