diff options
Diffstat (limited to 'arch/mips/loongson/common/pci.c')
| -rw-r--r-- | arch/mips/loongson/common/pci.c | 40 | 
1 files changed, 22 insertions, 18 deletions
diff --git a/arch/mips/loongson/common/pci.c b/arch/mips/loongson/common/pci.c index 31d8c5ecd16..003ab4e618b 100644 --- a/arch/mips/loongson/common/pci.c +++ b/arch/mips/loongson/common/pci.c @@ -2,36 +2,37 @@   * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology   * Author: Fuxin Zhang, zhangfx@lemote.com   * - *  This program is free software; you can redistribute  it and/or modify it - *  under  the terms of  the GNU General  Public License as published by the - *  Free Software Foundation;  either version 2 of the  License, or (at your + *  This program is free software; you can redistribute	 it and/or modify it + *  under  the terms of	 the GNU General  Public License as published by the + *  Free Software Foundation;  either version 2 of the	License, or (at your   *  option) any later version.   */  #include <linux/pci.h>  #include <pci.h>  #include <loongson.h> +#include <boot_param.h>  static struct resource loongson_pci_mem_resource = { -	.name   = "pci memory space", -	.start  = LOONGSON_PCI_MEM_START, -	.end    = LOONGSON_PCI_MEM_END, -	.flags  = IORESOURCE_MEM, +	.name	= "pci memory space", +	.start	= LOONGSON_PCI_MEM_START, +	.end	= LOONGSON_PCI_MEM_END, +	.flags	= IORESOURCE_MEM,  };  static struct resource loongson_pci_io_resource = { -	.name   = "pci io space", -	.start  = LOONGSON_PCI_IO_START, -	.end    = IO_SPACE_LIMIT, -	.flags  = IORESOURCE_IO, +	.name	= "pci io space", +	.start	= LOONGSON_PCI_IO_START, +	.end	= IO_SPACE_LIMIT, +	.flags	= IORESOURCE_IO,  };  static struct pci_controller  loongson_pci_controller = { -	.pci_ops        = &loongson_pci_ops, -	.io_resource    = &loongson_pci_io_resource, -	.mem_resource   = &loongson_pci_mem_resource, -	.mem_offset     = 0x00000000UL, -	.io_offset      = 0x00000000UL, +	.pci_ops	= &loongson_pci_ops, +	.io_resource	= &loongson_pci_io_resource, +	.mem_resource	= &loongson_pci_mem_resource, +	.mem_offset	= 0x00000000UL, +	.io_offset	= 0x00000000UL,  };  static void __init setup_pcimap(void) @@ -42,7 +43,7 @@ static void __init setup_pcimap(void)  	 * we set pcimap_lo[0,1,2] to map it to pci space[0M,64M], [320M,448M]  	 *  	 * pcimap: PCI_MAP2  PCI_Mem_Lo2 PCI_Mem_Lo1 PCI_Mem_Lo0 -	 * 	     [<2G]   [384M,448M] [320M,384M] [0M,64M] +	 *	     [<2G]   [384M,448M] [320M,384M] [0M,64M]  	 */  	LOONGSON_PCIMAP = LOONGSON_PCIMAP_PCIMAP_2 |  		LOONGSON_PCIMAP_WIN(2, LOONGSON_PCILO2_BASE) | @@ -82,7 +83,10 @@ static int __init pcibios_init(void)  	setup_pcimap();  	loongson_pci_controller.io_map_base = mips_io_port_base; - +#ifdef CONFIG_LEFI_FIRMWARE_INTERFACE +	loongson_pci_mem_resource.start = loongson_sysconf.pci_mem_start_addr; +	loongson_pci_mem_resource.end = loongson_sysconf.pci_mem_end_addr; +#endif  	register_pci_controller(&loongson_pci_controller);  	return 0;  | 
