From patchwork Wed Jun 29 16:46:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 929702 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5TGqTVR014551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 29 Jun 2011 16:52:50 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QbxyO-0008Rf-MB; Wed, 29 Jun 2011 16:51:00 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QbxxU-0001yF-42; Wed, 29 Jun 2011 16:49:48 +0000 Received: from mail-yw0-f49.google.com ([209.85.213.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qbxve-0001Vf-0J for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2011 16:47:59 +0000 Received: by ywf9 with SMTP id 9so651318ywf.36 for ; Wed, 29 Jun 2011 09:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=hnFJPb+dPEOVt0E2lpDj4tebXzR0y/wOuWVBGS4MdNg=; b=SVBqK3gmGMxYxojjAPXuFDcRlcvtiKMuqpFbtDyOyH41qMfJE8Fkk6TafgXgTid8wR 82lQ0B84ILHdwz5ttLp5t4HdJK3Jw7lvtaEqYqMZXNKB6OMQnBPUQjVRem57IlZk0GFF jRUJhJoeiw/8Xjuk3t5vY7EtX6xgWTsGCmBec= Received: by 10.90.62.22 with SMTP id k22mr920230aga.95.1309366071570; Wed, 29 Jun 2011 09:47:51 -0700 (PDT) Received: from rob-laptop.i.smooth-stone.com ([173.226.190.126]) by mx.google.com with ESMTPS id g36sm1209509anq.36.2011.06.29.09.47.49 (version=SSLv3 cipher=OTHER); Wed, 29 Jun 2011 09:47:50 -0700 (PDT) From: Rob Herring To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] ARM: pci: make pcibios_assign_all_busses use pci_has_flag Date: Wed, 29 Jun 2011 11:46:57 -0500 Message-Id: <1309366019-24379-5-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1309366019-24379-1-git-send-email-robherring2@gmail.com> References: <1309366019-24379-1-git-send-email-robherring2@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110629_124754_617004_8ECC7B3F X-CRM114-Status: GOOD ( 19.00 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) 0.1 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL Cc: Michal Simek , Rob Herring , nico@fluxnic.net X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 29 Jun 2011 16:52:50 +0000 (UTC) From: Rob Herring Convert pcibios_assign_all_busses from a define to inline so platforms can control this setting. Signed-off-by: Rob Herring Acked-by: Nicolas Pitre --- arch/arm/include/asm/pci.h | 6 ++++++ arch/arm/mach-bcmring/include/mach/hardware.h | 2 -- arch/arm/mach-cns3xxx/include/mach/hardware.h | 1 - arch/arm/mach-dove/include/mach/hardware.h | 2 -- arch/arm/mach-ep93xx/include/mach/hardware.h | 2 -- arch/arm/mach-footbridge/include/mach/hardware.h | 2 -- arch/arm/mach-integrator/include/mach/hardware.h | 2 -- arch/arm/mach-iop13xx/include/mach/hardware.h | 2 -- arch/arm/mach-iop32x/include/mach/hardware.h | 1 - arch/arm/mach-iop33x/include/mach/hardware.h | 1 - arch/arm/mach-ixp2000/include/mach/hardware.h | 2 -- arch/arm/mach-ixp2000/pci.c | 2 ++ arch/arm/mach-ixp23xx/include/mach/hardware.h | 2 -- arch/arm/mach-ixp23xx/pci.c | 2 ++ arch/arm/mach-ixp4xx/include/mach/hardware.h | 2 -- arch/arm/mach-kirkwood/include/mach/hardware.h | 3 --- arch/arm/mach-ks8695/include/mach/hardware.h | 2 -- arch/arm/mach-mv78xx0/include/mach/hardware.h | 2 -- arch/arm/mach-orion5x/include/mach/hardware.h | 2 -- arch/arm/mach-pxa/include/mach/hardware.h | 1 - arch/arm/mach-sa1100/include/mach/hardware.h | 1 - arch/arm/mach-shark/include/mach/hardware.h | 2 -- arch/arm/mach-tegra/include/mach/hardware.h | 1 - arch/arm/mach-versatile/include/mach/hardware.h | 2 -- arch/arm/mm/iomap.c | 4 ++++ 25 files changed, 14 insertions(+), 37 deletions(-) diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h index 92e2a83..cb77e66 100644 --- a/arch/arm/include/asm/pci.h +++ b/arch/arm/include/asm/pci.h @@ -3,10 +3,16 @@ #ifdef __KERNEL__ #include +#include #include /* for pci_sys_data */ #include /* for PCIBIOS_MIN_* */ +static inline int pcibios_assign_all_busses(void) +{ + return pci_has_flag(PCI_REASSIGN_ALL_RSRC); +} + #ifdef CONFIG_PCI_DOMAINS static inline int pci_domain_nr(struct pci_bus *bus) { diff --git a/arch/arm/mach-bcmring/include/mach/hardware.h b/arch/arm/mach-bcmring/include/mach/hardware.h index 8bf3564..ed78aab 100644 --- a/arch/arm/mach-bcmring/include/mach/hardware.h +++ b/arch/arm/mach-bcmring/include/mach/hardware.h @@ -36,8 +36,6 @@ #define RAM_SIZE (CFG_GLOBAL_RAM_SIZE-CFG_GLOBAL_RAM_SIZE_RESERVED) #define RAM_BASE PAGE_OFFSET -#define pcibios_assign_all_busses() 1 - /* Macros to make managing spinlocks a bit more controlled in terms of naming. */ /* See reg_gpio.h, reg_irq.h, arch.c, gpio.c for example usage. */ #if defined(__KERNEL__) diff --git a/arch/arm/mach-cns3xxx/include/mach/hardware.h b/arch/arm/mach-cns3xxx/include/mach/hardware.h index 57e0983..82a0d4e 100644 --- a/arch/arm/mach-cns3xxx/include/mach/hardware.h +++ b/arch/arm/mach-cns3xxx/include/mach/hardware.h @@ -17,6 +17,5 @@ /* macro to get at IO space when running virtually */ #define PCIBIOS_MIN_IO 0x00000000 #define PCIBIOS_MIN_MEM 0x00000000 -#define pcibios_assign_all_busses() 1 #endif diff --git a/arch/arm/mach-dove/include/mach/hardware.h b/arch/arm/mach-dove/include/mach/hardware.h index 32b0826..f619fb9 100644 --- a/arch/arm/mach-dove/include/mach/hardware.h +++ b/arch/arm/mach-dove/include/mach/hardware.h @@ -11,8 +11,6 @@ #include "dove.h" -#define pcibios_assign_all_busses() 1 - #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x01000000 #define PCIMEM_BASE DOVE_PCIE0_MEM_PHYS_BASE diff --git a/arch/arm/mach-ep93xx/include/mach/hardware.h b/arch/arm/mach-ep93xx/include/mach/hardware.h index 5a3ce02..4df8428 100644 --- a/arch/arm/mach-ep93xx/include/mach/hardware.h +++ b/arch/arm/mach-ep93xx/include/mach/hardware.h @@ -8,8 +8,6 @@ #include #include -#define pcibios_assign_all_busses() 0 - /* * The EP93xx has two external crystal oscillators. To generate the * required high-frequency clocks, the processor uses two phase-locked- diff --git a/arch/arm/mach-footbridge/include/mach/hardware.h b/arch/arm/mach-footbridge/include/mach/hardware.h index b6fdf23..082e6ce 100644 --- a/arch/arm/mach-footbridge/include/mach/hardware.h +++ b/arch/arm/mach-footbridge/include/mach/hardware.h @@ -100,8 +100,6 @@ extern unsigned int nw_gpio_read(void); extern void nw_cpld_modify(unsigned int mask, unsigned int set); #endif -#define pcibios_assign_all_busses() 1 - #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x81000000 diff --git a/arch/arm/mach-integrator/include/mach/hardware.h b/arch/arm/mach-integrator/include/mach/hardware.h index 57f51ba..37323ea 100644 --- a/arch/arm/mach-integrator/include/mach/hardware.h +++ b/arch/arm/mach-integrator/include/mach/hardware.h @@ -34,8 +34,6 @@ #define PCIMEM_BASE PCI_MEMORY_VADDR -#define pcibios_assign_all_busses() 1 - #define PCIBIOS_MIN_IO 0x6000 #define PCIBIOS_MIN_MEM 0x00100000 diff --git a/arch/arm/mach-iop13xx/include/mach/hardware.h b/arch/arm/mach-iop13xx/include/mach/hardware.h index 8e1d562..ba81e50 100644 --- a/arch/arm/mach-iop13xx/include/mach/hardware.h +++ b/arch/arm/mach-iop13xx/include/mach/hardware.h @@ -2,8 +2,6 @@ #define __ASM_ARCH_HARDWARE_H #include -#define pcibios_assign_all_busses() 1 - #ifndef __ASSEMBLY__ extern unsigned long iop13xx_pcibios_min_io; extern unsigned long iop13xx_pcibios_min_mem; diff --git a/arch/arm/mach-iop32x/include/mach/hardware.h b/arch/arm/mach-iop32x/include/mach/hardware.h index d559c4e..e68bf97 100644 --- a/arch/arm/mach-iop32x/include/mach/hardware.h +++ b/arch/arm/mach-iop32x/include/mach/hardware.h @@ -18,7 +18,6 @@ * but when we read them, we convert them to virtual addresses. See * arch/arm/plat-iop/pci.c. */ -#define pcibios_assign_all_busses() 1 #define PCIBIOS_MIN_IO 0x00000000 #define PCIBIOS_MIN_MEM 0x00000000 diff --git a/arch/arm/mach-iop33x/include/mach/hardware.h b/arch/arm/mach-iop33x/include/mach/hardware.h index 8c10e43..215065b 100644 --- a/arch/arm/mach-iop33x/include/mach/hardware.h +++ b/arch/arm/mach-iop33x/include/mach/hardware.h @@ -18,7 +18,6 @@ * but when we read them, we convert them to virtual addresses. See * arch/arm/mach-iop3xx/iop3xx-pci.c */ -#define pcibios_assign_all_busses() 1 #define PCIBIOS_MIN_IO 0x00000000 #define PCIBIOS_MIN_MEM 0x00000000 diff --git a/arch/arm/mach-ixp2000/include/mach/hardware.h b/arch/arm/mach-ixp2000/include/mach/hardware.h index f033de4..6c92008 100644 --- a/arch/arm/mach-ixp2000/include/mach/hardware.h +++ b/arch/arm/mach-ixp2000/include/mach/hardware.h @@ -27,8 +27,6 @@ #include "ixp2000-regs.h" /* Chipset Registers */ -#define pcibios_assign_all_busses() 0 - /* * Platform helper functions */ diff --git a/arch/arm/mach-ixp2000/pci.c b/arch/arm/mach-ixp2000/pci.c index f797c5f..8888ed9 100644 --- a/arch/arm/mach-ixp2000/pci.c +++ b/arch/arm/mach-ixp2000/pci.c @@ -196,6 +196,8 @@ clear_master_aborts(void) void __init ixp2000_pci_preinit(void) { + pci_set_flags(0); + #ifndef CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO /* * Configure the PCI unit to properly byteswap I/O transactions, diff --git a/arch/arm/mach-ixp23xx/include/mach/hardware.h b/arch/arm/mach-ixp23xx/include/mach/hardware.h index 57b508b..b8bb781 100644 --- a/arch/arm/mach-ixp23xx/include/mach/hardware.h +++ b/arch/arm/mach-ixp23xx/include/mach/hardware.h @@ -20,8 +20,6 @@ #include "ixp23xx.h" -#define pcibios_assign_all_busses() 0 - /* * Platform helper functions */ diff --git a/arch/arm/mach-ixp23xx/pci.c b/arch/arm/mach-ixp23xx/pci.c index 563819a..72d145a 100644 --- a/arch/arm/mach-ixp23xx/pci.c +++ b/arch/arm/mach-ixp23xx/pci.c @@ -227,6 +227,8 @@ static void __init ixp23xx_pci_common_init(void) void __init ixp23xx_pci_preinit(void) { + pci_set_flags(0); + ixp23xx_pci_common_init(); hook_fault_code(16+6, ixp23xx_pci_abort_handler, SIGBUS, 0, diff --git a/arch/arm/mach-ixp4xx/include/mach/hardware.h b/arch/arm/mach-ixp4xx/include/mach/hardware.h index f91ca6d..a0921c6 100644 --- a/arch/arm/mach-ixp4xx/include/mach/hardware.h +++ b/arch/arm/mach-ixp4xx/include/mach/hardware.h @@ -26,8 +26,6 @@ #define PCIBIOS_MAX_MEM 0x4BFFFFFF #endif -#define pcibios_assign_all_busses() 1 - /* Register locations and bits */ #include "ixp4xx-regs.h" diff --git a/arch/arm/mach-kirkwood/include/mach/hardware.h b/arch/arm/mach-kirkwood/include/mach/hardware.h index cde8528..31b81fe 100644 --- a/arch/arm/mach-kirkwood/include/mach/hardware.h +++ b/arch/arm/mach-kirkwood/include/mach/hardware.h @@ -11,9 +11,6 @@ #include "kirkwood.h" -#define pcibios_assign_all_busses() 1 - -#define PCIBIOS_MIN_IO 0x00001000 #define PCIBIOS_MIN_MEM 0x01000000 #define PCIMEM_BASE KIRKWOOD_PCIE_MEM_PHYS_BASE /* mem base for VGA */ diff --git a/arch/arm/mach-ks8695/include/mach/hardware.h b/arch/arm/mach-ks8695/include/mach/hardware.h index e0f911d..a46be88 100644 --- a/arch/arm/mach-ks8695/include/mach/hardware.h +++ b/arch/arm/mach-ks8695/include/mach/hardware.h @@ -46,8 +46,6 @@ /* * PCI support */ -#define pcibios_assign_all_busses() 1 - #define PCIBIOS_MIN_IO 0 #define PCIBIOS_MIN_MEM 0 diff --git a/arch/arm/mach-mv78xx0/include/mach/hardware.h b/arch/arm/mach-mv78xx0/include/mach/hardware.h index 5d88755..c76b93f 100644 --- a/arch/arm/mach-mv78xx0/include/mach/hardware.h +++ b/arch/arm/mach-mv78xx0/include/mach/hardware.h @@ -11,8 +11,6 @@ #include "mv78xx0.h" -#define pcibios_assign_all_busses() 1 - #define PCIBIOS_MIN_IO 0x00001000 #define PCIBIOS_MIN_MEM 0x01000000 #define PCIMEM_BASE MV78XX0_PCIE_MEM_PHYS_BASE /* mem base for VGA */ diff --git a/arch/arm/mach-orion5x/include/mach/hardware.h b/arch/arm/mach-orion5x/include/mach/hardware.h index e51aaf4..a42b743 100644 --- a/arch/arm/mach-orion5x/include/mach/hardware.h +++ b/arch/arm/mach-orion5x/include/mach/hardware.h @@ -11,8 +11,6 @@ #include "orion5x.h" -#define pcibios_assign_all_busses() 1 - #define PCIBIOS_MIN_IO 0x00001000 #define PCIBIOS_MIN_MEM 0x01000000 #define PCIMEM_BASE ORION5X_PCIE_MEM_PHYS_BASE diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h index 313051c..bd6e928 100644 --- a/arch/arm/mach-pxa/include/mach/hardware.h +++ b/arch/arm/mach-pxa/include/mach/hardware.h @@ -339,7 +339,6 @@ extern unsigned long get_clock_tick_rate(void); #if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI) #define PCIBIOS_MIN_IO 0 #define PCIBIOS_MIN_MEM 0 -#define pcibios_assign_all_busses() 1 #endif #endif /* _ASM_ARCH_HARDWARE_H */ diff --git a/arch/arm/mach-sa1100/include/mach/hardware.h b/arch/arm/mach-sa1100/include/mach/hardware.h index 967ae76..5946af2 100644 --- a/arch/arm/mach-sa1100/include/mach/hardware.h +++ b/arch/arm/mach-sa1100/include/mach/hardware.h @@ -79,7 +79,6 @@ static inline unsigned long get_clock_tick_rate(void) #if defined(CONFIG_ARCH_SA1100) && defined(CONFIG_PCI) #define PCIBIOS_MIN_IO 0 #define PCIBIOS_MIN_MEM 0 -#define pcibios_assign_all_busses() 1 #define HAVE_ARCH_PCI_SET_DMA_MASK 1 #endif diff --git a/arch/arm/mach-shark/include/mach/hardware.h b/arch/arm/mach-shark/include/mach/hardware.h index 94d84b2..24639ce 100644 --- a/arch/arm/mach-shark/include/mach/hardware.h +++ b/arch/arm/mach-shark/include/mach/hardware.h @@ -12,8 +12,6 @@ #define UNCACHEABLE_ADDR 0xdf010000 -#define pcibios_assign_all_busses() 1 - #define PCIBIOS_MIN_IO 0x6000 #define PCIBIOS_MIN_MEM 0x50000000 #define PCIMEM_BASE 0xe8000000 diff --git a/arch/arm/mach-tegra/include/mach/hardware.h b/arch/arm/mach-tegra/include/mach/hardware.h index 56e43b3..84c2658 100644 --- a/arch/arm/mach-tegra/include/mach/hardware.h +++ b/arch/arm/mach-tegra/include/mach/hardware.h @@ -23,6 +23,5 @@ #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0 -#define pcibios_assign_all_busses() 1 #endif diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h index 6911e1f..8f60e94 100644 --- a/arch/arm/mach-versatile/include/mach/hardware.h +++ b/arch/arm/mach-versatile/include/mach/hardware.h @@ -34,8 +34,6 @@ #define PCIBIOS_MIN_IO 0x44000000 #define PCIBIOS_MIN_MEM 0x50000000 -#define pcibios_assign_all_busses() 1 - /* macro to get at IO space when running virtually */ #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c index ffad039..ad41414 100644 --- a/arch/arm/mm/iomap.c +++ b/arch/arm/mm/iomap.c @@ -8,6 +8,7 @@ #include #include #include +#include #ifdef __io void __iomem *ioport_map(unsigned long port, unsigned int nr) @@ -23,6 +24,9 @@ EXPORT_SYMBOL(ioport_unmap); #endif #ifdef CONFIG_PCI +unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC; +EXPORT_SYMBOL(pci_flags); + void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) { resource_size_t start = pci_resource_start(dev, bar);