4 * ADM5120 PCI Host Controller driver
6 * Copyright (C) ADMtek Incorporated.
7 * Copyright (C) 2005 Jeroen Vreeken (pe1rxq@amsat.org)
8 * Copyright (C) 2007 Gabor Juhos <juhosg@freemail.hu>
9 * Copyright (C) 2007 OpenWrt.org
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the
23 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
27 #include <linux/types.h>
28 #include <linux/pci.h>
29 #include <linux/kernel.h>
30 #include <linux/init.h>
32 #include <asm/mach-adm5120/adm5120_info.h>
33 #include <asm/mach-adm5120/adm5120_defs.h>
34 #include <asm/mach-adm5120/adm5120_irq.h>
36 extern struct pci_ops adm5120_pci_ops
;
38 static struct resource pci_io_resource
= {
39 .name
= "ADM5120 PCI I/O",
40 .start
= ADM5120_PCIIO_BASE
,
41 .end
= ADM5120_PCICFG_ADDR
-1,
42 .flags
= IORESOURCE_IO
45 static struct resource pci_mem_resource
= {
46 .name
= "ADM5120 PCI MEM",
47 .start
= ADM5120_PCIMEM_BASE
,
48 .end
= ADM5120_PCIIO_BASE
-1,
49 .flags
= IORESOURCE_MEM
52 static struct pci_controller adm5120_controller
= {
53 .pci_ops
= &adm5120_pci_ops
,
54 .io_resource
= &pci_io_resource
,
55 .mem_resource
= &pci_mem_resource
,
58 static int __init
adm5120_pci_setup(void)
62 pci_bios
= adm5120_has_pci();
64 printk("adm5120: system has %sPCI BIOS\n", pci_bios
? "" : "no ");
68 /* Avoid ISA compat ranges. */
69 PCIBIOS_MIN_IO
= 0x00000000;
70 PCIBIOS_MIN_MEM
= 0x00000000;
72 /* Set I/O resource limits. */
73 ioport_resource
.end
= 0x1fffffff;
74 iomem_resource
.end
= 0xffffffff;
76 register_pci_controller(&adm5120_controller
);
80 arch_initcall(adm5120_pci_setup
);