]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ARM: convert PCI defines to variables
authorRob Herring <rob.herring@calxeda.com>
Wed, 29 Jun 2011 02:16:13 +0000 (21:16 -0500)
committerRob Herring <rob.herring@calxeda.com>
Tue, 12 Jul 2011 16:19:29 +0000 (11:19 -0500)
Convert PCIBIOS_MIN_IO and PCIBIOS_MIN_MEM to variables to allow
multi-platform builds. This also removes the requirement for a platform to
have a mach/hardware.h.

The default values for i/o and mem are 0x1000 and 0x01000000, respectively.
Per Arnd Bergmann, other values are likely to be incorrect, but this commit
does not try to address that issue.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
35 files changed:
arch/arm/include/asm/pci.h
arch/arm/mach-cns3xxx/include/mach/hardware.h [deleted file]
arch/arm/mach-cns3xxx/pcie.c
arch/arm/mach-dove/include/mach/hardware.h
arch/arm/mach-footbridge/dc21285.c
arch/arm/mach-footbridge/include/mach/hardware.h
arch/arm/mach-integrator/include/mach/hardware.h
arch/arm/mach-integrator/pci_v3.c
arch/arm/mach-iop13xx/include/mach/hardware.h
arch/arm/mach-iop13xx/pci.c
arch/arm/mach-iop32x/include/mach/hardware.h
arch/arm/mach-iop33x/include/mach/hardware.h
arch/arm/mach-ixp2000/include/mach/hardware.h
arch/arm/mach-ixp2000/pci.c
arch/arm/mach-ixp23xx/include/mach/hardware.h
arch/arm/mach-ixp23xx/pci.c
arch/arm/mach-ixp4xx/common-pci.c
arch/arm/mach-ixp4xx/include/mach/hardware.h
arch/arm/mach-kirkwood/include/mach/hardware.h
arch/arm/mach-ks8695/include/mach/hardware.h
arch/arm/mach-ks8695/pci.c
arch/arm/mach-mv78xx0/include/mach/hardware.h
arch/arm/mach-orion5x/include/mach/hardware.h
arch/arm/mach-pxa/cm-x2xx-pci.c
arch/arm/mach-pxa/include/mach/hardware.h
arch/arm/mach-sa1100/include/mach/hardware.h
arch/arm/mach-sa1100/pci-nanoengine.c
arch/arm/mach-shark/include/mach/hardware.h
arch/arm/mach-shark/pci.c
arch/arm/mach-tegra/include/mach/hardware.h [deleted file]
arch/arm/mach-tegra/pcie.c
arch/arm/mach-versatile/include/mach/hardware.h
arch/arm/mach-versatile/pci.c
arch/arm/mm/iomap.c
arch/arm/plat-iop/pci.c

index cb77e66c969f3263af9c73db14b52df4b5d2598c..2b1f245db0c670200b557bc62ac613969eda818d 100644 (file)
@@ -6,7 +6,11 @@
 #include <asm-generic/pci-bridge.h>
 
 #include <asm/mach/pci.h> /* for pci_sys_data */
-#include <mach/hardware.h> /* for PCIBIOS_MIN_* */
+
+extern unsigned long pcibios_min_io;
+#define PCIBIOS_MIN_IO pcibios_min_io
+extern unsigned long pcibios_min_mem;
+#define PCIBIOS_MIN_MEM pcibios_min_mem
 
 static inline int pcibios_assign_all_busses(void)
 {
diff --git a/arch/arm/mach-cns3xxx/include/mach/hardware.h b/arch/arm/mach-cns3xxx/include/mach/hardware.h
deleted file mode 100644 (file)
index 82a0d4e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This file contains the hardware definitions of the Cavium Networks boards.
- *
- * Copyright 2003 ARM Limited.
- * Copyright 2008 Cavium Networks
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, Version 2, as
- * published by the Free Software Foundation.
- */
-
-#ifndef __MACH_HARDWARE_H
-#define __MACH_HARDWARE_H
-
-#include <asm/sizes.h>
-
-/* macro to get at IO space when running virtually */
-#define PCIBIOS_MIN_IO         0x00000000
-#define PCIBIOS_MIN_MEM                0x00000000
-
-#endif
index 78defd71a8295423775d9316670491cb0031b2ca..a4ec080908b8f60f9181672b41380278264ca696 100644 (file)
@@ -369,6 +369,9 @@ static int __init cns3xxx_pcie_init(void)
 {
        int i;
 
+       pcibios_min_io = 0;
+       pcibios_min_mem = 0;
+
        hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS, 0,
                        "imprecise external abort");
 
index f619fb92eae671b549086039765a5cf16dc6619d..94c5a2cf5481595e916b6087d4a3589d8d8b8747 100644 (file)
@@ -11,8 +11,6 @@
 
 #include "dove.h"
 
-#define PCIBIOS_MIN_IO                 0x1000
-#define PCIBIOS_MIN_MEM                        0x01000000
 #define PCIMEM_BASE                    DOVE_PCIE0_MEM_PHYS_BASE
 
 
index 3ffa54841ec55c9d1c2c900a1f469a796114c037..a8dfa00e45966c51003b03b0bb2fa23d424c9094 100644 (file)
@@ -295,6 +295,8 @@ void __init dc21285_preinit(void)
        unsigned int mem_size, mem_mask;
        int cfn_mode;
 
+       pcibios_min_mem = 0x81000000;
+
        mem_size = (unsigned int)high_memory - PAGE_OFFSET;
        for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)
                if (mem_mask >= mem_size)
index 082e6ce23579dbded1a1caba4bca304d905fa23e..15d54981674c4dd642580b5caa5d4b2d0fe39936 100644 (file)
@@ -100,7 +100,4 @@ extern unsigned int nw_gpio_read(void);
 extern void nw_cpld_modify(unsigned int mask, unsigned int set);
 #endif
 
-#define PCIBIOS_MIN_IO         0x1000
-#define PCIBIOS_MIN_MEM        0x81000000
-
 #endif
index 37323eabc1d35a7f594a775bf106ded7c48248b0..0ce52121dabe2bdb008adb659e13ea4a156ed0ec 100644 (file)
@@ -34,9 +34,6 @@
 
 #define PCIMEM_BASE            PCI_MEMORY_VADDR
 
-#define PCIBIOS_MIN_IO         0x6000
-#define PCIBIOS_MIN_MEM        0x00100000
-
 /* macro to get at IO space when running virtually */
 #ifdef CONFIG_MMU
 #define IO_ADDRESS(x)  (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)
index 6467d99fa2ee4a0c674d9071dad669cb5caa7b32..11b86e5b71c29546c013b575e56f5217e8f7147a 100644 (file)
@@ -502,6 +502,9 @@ void __init pci_v3_preinit(void)
        unsigned int temp;
        int ret;
 
+       pcibios_min_io = 0x6000;
+       pcibios_min_mem = 0x00100000;
+
        /*
         * Hook in our fault handler for PCI errors
         */
index ba81e504d714e1d577fd42ad851179872105fdc4..786fa266fab3b40d80d39fd64e6b80b0014dbdf9 100644 (file)
@@ -3,15 +3,10 @@
 #include <asm/types.h>
 
 #ifndef __ASSEMBLY__
-extern unsigned long iop13xx_pcibios_min_io;
-extern unsigned long iop13xx_pcibios_min_mem;
 extern u16 iop13xx_dev_id(void);
 extern void iop13xx_set_atu_mmr_bases(void);
 #endif
 
-#define PCIBIOS_MIN_IO      (iop13xx_pcibios_min_io)
-#define PCIBIOS_MIN_MEM     (iop13xx_pcibios_min_mem)
-
 /*
  * Generic chipset bits
  *
index ba3dae352a2de22a781777c928a264129204e63b..0690b1d7fd3e9f1b803f7449c9e6b1886ddfde0f 100644 (file)
@@ -39,8 +39,6 @@ u32 iop13xx_atue_mem_base;
 u32 iop13xx_atux_mem_base;
 size_t iop13xx_atue_mem_size;
 size_t iop13xx_atux_mem_size;
-unsigned long iop13xx_pcibios_min_io = 0;
-unsigned long iop13xx_pcibios_min_mem = 0;
 
 EXPORT_SYMBOL(iop13xx_atue_mem_base);
 EXPORT_SYMBOL(iop13xx_atux_mem_base);
@@ -971,7 +969,8 @@ void __init iop13xx_pci_init(void)
        __raw_writel(__raw_readl(IOP13XX_XBG_BECSR) & 3, IOP13XX_XBG_BECSR);
 
        /* Setup the Min Address for PCI memory... */
-       iop13xx_pcibios_min_mem = IOP13XX_PCIX_LOWER_MEM_BA;
+       pcibios_min_io = 0;
+       pcibios_min_mem = IOP13XX_PCIX_LOWER_MEM_BA;
 
        /* if Linux is given control of an ATU
         * clear out its prior configuration,
index e68bf9779c8ec08d6b4b68c627960f4ecee7d33d..48cb1b20ba9122a2d46dd24357c14591fee42ff3 100644 (file)
@@ -18,8 +18,6 @@
  * but when we read them, we convert them to virtual addresses. See
  * arch/arm/plat-iop/pci.c.
  */
-#define PCIBIOS_MIN_IO         0x00000000
-#define PCIBIOS_MIN_MEM                0x00000000
 
 #ifndef __ASSEMBLY__
 void iop32x_init_irq(void);
index 215065b1101787a1158f149110fe007407098764..839285315e4e3b24d67280897fc81de24349a4fb 100644 (file)
@@ -18,8 +18,6 @@
  * but when we read them, we convert them to virtual addresses.  See
  * arch/arm/mach-iop3xx/iop3xx-pci.c
  */
-#define PCIBIOS_MIN_IO         0x00000000
-#define PCIBIOS_MIN_MEM                0x00000000
 
 #ifndef __ASSEMBLY__
 void iop33x_init_irq(void);
index 6c92008aff453c2078713052262edbadf4380db8..cdaf1db84003ea7c037ed3eac8141d78327a281a 100644 (file)
 #ifndef __ASM_ARCH_HARDWARE_H__
 #define __ASM_ARCH_HARDWARE_H__
 
-/*
- * This needs to be platform-specific?
- */
-#define PCIBIOS_MIN_IO          0x00000000
-#define PCIBIOS_MIN_MEM         0x00000000
-
 #include "ixp2000-regs.h"      /* Chipset Registers */
 
 /*
index 8888ed9429f89e2654c3d717736b4403fd823148..f5098b306fd39693df59f974e17648a8e0cc8a02 100644 (file)
@@ -198,6 +198,9 @@ ixp2000_pci_preinit(void)
 {
        pci_set_flags(0);
 
+       pcibios_min_io = 0;
+       pcibios_min_mem = 0;
+
 #ifndef CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO
        /*
         * Configure the PCI unit to properly byteswap I/O transactions,
index b8bb781e54f0167f35bba884286120d970825334..60e55fa10238442a60c541cf033439e4e558bea2 100644 (file)
@@ -15,8 +15,6 @@
 #define __ASM_ARCH_HARDWARE_H
 
 /* PCI IO info */
-#define PCIBIOS_MIN_IO         0x00000000
-#define PCIBIOS_MIN_MEM                0xe0000000
 
 #include "ixp23xx.h"
 
index 72d145a2019a915927274b57ff819d59b1011df9..e6be5711c700963f7997e47bbb491cdcb8548d6e 100644 (file)
@@ -227,6 +227,9 @@ static void __init ixp23xx_pci_common_init(void)
 
 void __init ixp23xx_pci_preinit(void)
 {
+       pcibios_min_io = 0;
+       pcibios_min_mem = 0xe0000000;
+
        pci_set_flags(0);
 
        ixp23xx_pci_common_init();
index e9a589395723dafd59e01f9c6d3458a1b1689b4c..3e81000b3e92ecfca4d9442d3c317a72505531a7 100644 (file)
@@ -346,6 +346,11 @@ void __init ixp4xx_pci_preinit(void)
 {
        unsigned long cpuid = read_cpuid_id();
 
+#ifdef CONFIG_IXP4XX_INDIRECT_PCI
+       pcibios_min_mem = 0x10000000; /* 1 GB of indirect PCI MMIO space */
+#else
+       pcibios_min_mem = 0x48000000; /* 64 MB of PCI MMIO space */
+#endif
        /*
         * Determine which PCI read method to use.
         * Rev 0 IXP425 requires workaround.
index 163e506764de3f0a58ae53303ccee574ad1ef585..c30e7e923a73a2337b9a68de6eeea2cf1a39b0a0 100644 (file)
 #ifndef __ASM_ARCH_HARDWARE_H__
 #define __ASM_ARCH_HARDWARE_H__
 
-#define PCIBIOS_MIN_IO         0x00001000
 #ifdef CONFIG_IXP4XX_INDIRECT_PCI
-#define PCIBIOS_MIN_MEM                0x10000000 /* 1 GB of indirect PCI MMIO space */
 #define PCIBIOS_MAX_MEM                0x4FFFFFFF
 #else
-#define PCIBIOS_MIN_MEM                0x48000000 /* 64 MB of PCI MMIO space */
 #define PCIBIOS_MAX_MEM                0x4BFFFFFF
 #endif
 
index 31b81fefad5901fd60d50f70c7bc5b4edd9cd362..470899b6a3f547d1623126b75ff8562ab02634f7 100644 (file)
@@ -11,7 +11,6 @@
 
 #include "kirkwood.h"
 
-#define PCIBIOS_MIN_MEM                        0x01000000
 #define PCIMEM_BASE                    KIRKWOOD_PCIE_MEM_PHYS_BASE /* mem base for VGA */
 
 
index a46be88d896526e02a17f47fad1cdd939d820626..5e0c388143da4a61e1b4ebf228a86da3164f3d8e 100644 (file)
 #define KS8695_PCIIO_PA                0x80000000
 #define KS8695_PCIIO_SIZE      SZ_64K
 
-
-/*
- * PCI support
- */
-#define PCIBIOS_MIN_IO         0
-#define PCIBIOS_MIN_MEM                0
-
 #endif
index 5fcd082a17f9bff9b0d8a0818b199ebffd5833d2..c7c9a188d10552ed19fafba4cdc523fba066f7da 100644 (file)
@@ -317,6 +317,9 @@ void __init ks8695_init_pci(struct ks8695_pci_cfg *cfg)
                return;
        }
 
+       pcibios_min_io = 0;
+       pcibios_min_mem = 0;
+
        printk(KERN_INFO "PCI: Initialising\n");
        ks8695_show_pciregs();
 
index c76b93f1c1644ccac344e0f10902809cd7be3f51..29e37ed5f7f5e17f212c5073f2f0bb59807ee4f2 100644 (file)
@@ -11,8 +11,6 @@
 
 #include "mv78xx0.h"
 
-#define PCIBIOS_MIN_IO                 0x00001000
-#define PCIBIOS_MIN_MEM                        0x01000000
 #define PCIMEM_BASE                    MV78XX0_PCIE_MEM_PHYS_BASE /* mem base for VGA */
 
 
index a42b74389a446ec3957090cd3fe2bf55ae135f94..b6d55bc3b2f8df553f27e14d65c92411eacda145 100644 (file)
@@ -11,8 +11,6 @@
 
 #include "orion5x.h"
 
-#define PCIBIOS_MIN_IO         0x00001000
-#define PCIBIOS_MIN_MEM                0x01000000
 #define PCIMEM_BASE            ORION5X_PCIE_MEM_PHYS_BASE
 
 
index 1afc0fb7d6d5764436e761800e8bba0051951103..4eb7660a279d3f5d04407b44c09808dca90ac2b4 100644 (file)
@@ -125,6 +125,9 @@ static void cmx2xx_pci_preinit(void)
 {
        pr_info("Initializing CM-X2XX PCI subsystem\n");
 
+       pcibios_min_io = 0;
+       pcibios_min_mem = 0;
+
        __raw_writel(0x800, IT8152_PCI_CFG_ADDR);
        if (__raw_readl(IT8152_PCI_CFG_DATA) == 0x81521283) {
                pr_info("PCI Bridge found.\n");
index b4ea3926a3f26a044880cd2aa49695ce94a5b01c..de63ca3016b4545f3eaca0f9bf75ed73ec040df6 100644 (file)
@@ -337,8 +337,6 @@ extern unsigned long get_clock_tick_rate(void);
 #endif
 
 #if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
-#define PCIBIOS_MIN_IO         0
-#define PCIBIOS_MIN_MEM                0
 #define ARCH_HAS_DMA_SET_COHERENT_MASK
 #endif
 
index 5946af276dc7d7bcb12671bc516de9364891c343..99f5856d8de424ce006d09c090cf0810f649e811 100644 (file)
@@ -76,11 +76,4 @@ static inline unsigned long get_clock_tick_rate(void)
 #include "SA-1101.h"
 #endif
 
-#if defined(CONFIG_ARCH_SA1100) && defined(CONFIG_PCI)
-#define PCIBIOS_MIN_IO         0
-#define PCIBIOS_MIN_MEM                0
-#define HAVE_ARCH_PCI_SET_DMA_MASK     1
-#endif
-
-
 #endif  /* _ASM_ARCH_HARDWARE_H */
index fba7a913f12b6c8d034b554bcb453e414de5b0c4..5fc074fe3eeee535f0d3909a9036ad190752d20c 100644 (file)
@@ -252,6 +252,9 @@ int __init pci_nanoengine_setup(int nr, struct pci_sys_data *sys)
 {
        int ret = 0;
 
+       pcibios_min_io = 0;
+       pcibios_min_mem = 0;
+
        if (nr == 0) {
                sys->mem_offset = NANO_PCI_MEM_RW_PHYS;
                sys->io_offset = 0x400;
index 24639ce5d308235d1d4e3f990516889158bd3ecf..4342931a1502fcd2b2cbe8c8dcb8bfa42bca4986 100644 (file)
@@ -12,8 +12,6 @@
 
 #define UNCACHEABLE_ADDR        0xdf010000
 
-#define PCIBIOS_MIN_IO          0x6000
-#define PCIBIOS_MIN_MEM         0x50000000
 #define PCIMEM_BASE            0xe8000000
 
 #endif
index 89d175ce74d2c3626b838770d250c802f937d4b5..4aea637a2ddb66a71e441e7cda78eb4d70616486 100644 (file)
@@ -37,8 +37,14 @@ static struct hw_pci shark_pci __initdata = {
 
 static int __init shark_pci_init(void)
 {
-       if (machine_is_shark())
-               pci_common_init(&shark_pci);
+       if (!machine_is_shark())
+               return;
+
+       pcibios_min_io = 0x6000;
+       pcibios_min_mem = 0x50000000;
+
+       pci_common_init(&shark_pci);
+
        return 0;
 }
 
diff --git a/arch/arm/mach-tegra/include/mach/hardware.h b/arch/arm/mach-tegra/include/mach/hardware.h
deleted file mode 100644 (file)
index 84c2658..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * arch/arm/mach-tegra/include/mach/hardware.h
- *
- * Copyright (C) 2010 Google, Inc.
- *
- * Author:
- *     Colin Cross <ccross@google.com>
- *     Erik Gilling <konkers@google.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef __MACH_TEGRA_HARDWARE_H
-#define __MACH_TEGRA_HARDWARE_H
-
-#define PCIBIOS_MIN_IO                 0x1000
-#define PCIBIOS_MIN_MEM                        0
-
-#endif
index 2941212b853c8942f377c2cc84953f879d947785..031cd0a7d71d7a22cd6cfb00e321d060ac192b98 100644 (file)
@@ -912,6 +912,8 @@ int __init tegra_pcie_init(bool init_port0, bool init_port1)
        if (!(init_port0 || init_port1))
                return -ENODEV;
 
+       pcibios_min_mem = 0;
+
        err = tegra_pcie_get_resources();
        if (err)
                return err;
index 8f60e9481fbbfa6601b2fdabdfbaf0bfbf4914e1..4d4973dd8fba88f5542c6898390f940ae9f8399e 100644 (file)
 #define VERSATILE_PCI_VIRT_BASE                (void __iomem *)0xe8000000ul
 #define VERSATILE_PCI_CFG_VIRT_BASE    (void __iomem *)0xe9000000ul
 
-/* CIK guesswork */
-#define PCIBIOS_MIN_IO                 0x44000000
-#define PCIBIOS_MIN_MEM                        0x50000000
-
 /* macro to get at IO space when running virtually */
 #define IO_ADDRESS(x)          (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
 
index 13c7e5f90a82eb1d4f52883e784eea8d08257546..7848a177b1f0eb27ccf031e817168599a58f6d16 100644 (file)
@@ -311,6 +311,9 @@ struct pci_bus * __init pci_versatile_scan_bus(int nr, struct pci_sys_data *sys)
 
 void __init pci_versatile_preinit(void)
 {
+       pcibios_min_io = 0x44000000;
+       pcibios_min_mem = 0x50000000;
+
        __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0);
        __raw_writel(VERSATILE_PCI_MEM_BASE1 >> 28, PCI_IMAP1);
        __raw_writel(VERSATILE_PCI_MEM_BASE2 >> 28, PCI_IMAP2);
index ad41414c02803b83af94b061967cd841e94e4016..3d46cf466c4c10b989a5816fc4a394370b97307e 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/io.h>
-#include <asm/pci.h>
 
 #ifdef __io
 void __iomem *ioport_map(unsigned long port, unsigned int nr)
@@ -24,6 +23,12 @@ EXPORT_SYMBOL(ioport_unmap);
 #endif
 
 #ifdef CONFIG_PCI
+unsigned long pcibios_min_io = 0x1000;
+EXPORT_SYMBOL(pcibios_min_io);
+
+unsigned long pcibios_min_mem = 0x01000000;
+EXPORT_SYMBOL(pcibios_min_mem);
+
 unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC;
 EXPORT_SYMBOL(pci_flags);
 
index 43f2b158237c71c99cc51f0e3d99066a05ee65cb..845549cbbb2766fc5ef3f79e9409c78c35730a92 100644 (file)
@@ -374,6 +374,9 @@ void __init iop3xx_pci_preinit_cond(void)
 
 void __init iop3xx_pci_preinit(void)
 {
+       pcibios_min_io = 0;
+       pcibios_min_mem = 0;
+
        iop3xx_atu_disable();
        iop3xx_atu_setup();
        iop3xx_atu_debug();