]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: 6058/1: Add support for PCI domains
authorAnton Vorontsov <cbouatmailru@gmail.com>
Mon, 19 Apr 2010 12:20:49 +0000 (13:20 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 22 Apr 2010 20:38:11 +0000 (21:38 +0100)
This patch adds support for PCI domains on ARM platforms.

Also, protect asm/mach/pci.h from multiple inclustions, otherwise
build fails because of pci_domain_nr() and pci_proc_domain()
redefinitions.

Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Kconfig
arch/arm/include/asm/mach/pci.h
arch/arm/include/asm/pci.h
arch/arm/kernel/bios32.c

index 5c8128c76996577fa5b23c42dc2b292689d6972d..88f9334110cf77631976a60f5dd884b2bd304edd 100644 (file)
@@ -1074,6 +1074,10 @@ config PCI
          your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
          VESA. If you have PCI, say Y, otherwise N.
 
+config PCI_DOMAINS
+       bool
+       depends on PCI
+
 config PCI_SYSCALL
        def_bool PCI
 
index a38bdc7afa34b26d1aca1f99f62b8ae05581bf43..52f0da1e97df28765c3dfe8a618a896727d5ec1b 100644 (file)
@@ -8,10 +8,16 @@
  * published by the Free Software Foundation.
  */
 
+#ifndef __ASM_MACH_PCI_H
+#define __ASM_MACH_PCI_H
+
 struct pci_sys_data;
 struct pci_bus;
 
 struct hw_pci {
+#ifdef CONFIG_PCI_DOMAINS
+       int             domain;
+#endif
        struct list_head buses;
        int             nr_controllers;
        int             (*setup)(int nr, struct pci_sys_data *);
@@ -26,6 +32,9 @@ struct hw_pci {
  * Per-controller structure
  */
 struct pci_sys_data {
+#ifdef CONFIG_PCI_DOMAINS
+       int             domain;
+#endif
        struct list_head node;
        int             busnr;          /* primary bus number                   */
        u64             mem_offset;     /* bus->cpu memory mapping offset       */
@@ -70,3 +79,5 @@ extern int pci_v3_setup(int nr, struct pci_sys_data *);
 extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *);
 extern void pci_v3_preinit(void);
 extern void pci_v3_postinit(void);
+
+#endif /* __ASM_MACH_PCI_H */
index 47980118d0a5ad7848c02dcd3a257ba06dc74bc4..92e2a833693d4c9298bc8eed9d2c8d91b51387eb 100644 (file)
@@ -4,8 +4,23 @@
 #ifdef __KERNEL__
 #include <asm-generic/pci-dma-compat.h>
 
+#include <asm/mach/pci.h> /* for pci_sys_data */
 #include <mach/hardware.h> /* for PCIBIOS_MIN_* */
 
+#ifdef CONFIG_PCI_DOMAINS
+static inline int pci_domain_nr(struct pci_bus *bus)
+{
+       struct pci_sys_data *root = bus->sysdata;
+
+       return root->domain;
+}
+
+static inline int pci_proc_domain(struct pci_bus *bus)
+{
+       return pci_domain_nr(bus);
+}
+#endif /* CONFIG_PCI_DOMAINS */
+
 #ifdef CONFIG_PCI_HOST_ITE8152
 /* ITE bridge requires setting latency timer to avoid early bus access
    termination by PIC bus mater devices
index bd397e0b663e4565f16b4ebd8869f2f64c01971f..c6273a3bfc253b01ea7fb1fe3d839b789887e47b 100644 (file)
@@ -527,6 +527,9 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
                if (!sys)
                        panic("PCI: unable to allocate sys data!");
 
+#ifdef CONFIG_PCI_DOMAINS
+               sys->domain  = hw->domain;
+#endif
                sys->hw      = hw;
                sys->busnr   = busnr;
                sys->swizzle = hw->swizzle;