Skip to contentSkip to conversation

PCI Domains Support]

PATCH New Richard Liu 2 participants 10 messages Dec 16, 2009 – Dec 31, 2009 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI Domains Support]

Hi, all:

Seems ARM don's support PCI Domains function now.
Here is a tiny patch for PCI Domains support

It's work on my platform,
There are two PCIe host controller on my platform, and both bus number should be 0
So, use PCI Domain to control both PCIe host controller is better choice.

Here is platform PCIe sample code,
static struct hw_pci cxxxxxx_pcie0 __initdata = {
.swizzle = pci_std_swizzle,
.map_irq = cxxxxxx_pcie0_map_irq,
.nr_controllers = 1,
.nr_domains = 0,
.setup = cxxxxxx_pci_setup,
.scan = cxxxxxx_pci_scan_bus,
.preinit = cxxxxxx_pci_preinit,
.postinit = cxxxxxx_pcie0_postinit,
};
static struct hw_pci cxxxxxx_pcie1 __initdata = {
.swizzle = pci_std_swizzle,
.map_irq = cxxxxxx_pcie1_map_irq,
.nr_controllers = 1,
.nr_domains = 1,
.setup = cxxxxxx_pci_setup,
.scan = cxxxxxx_pci_scan_bus,
.postinit = cxxxxxx_pcie1_postinit,
};

static int __init cxxxxxx_pci_init(void)

{
        pci_common_init(&cxxxxxx_pcie0);
        pci_common_init(&cxxxxxx_pcie1);
        return 0;
}

--

arch/arm/Kconfig +4 -0
index 79a3074..33a49ba 100644
@@ -865,6 +865,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
+        def_bool y
+        depends on PCI
+
 config PCI_SYSCALL
     def_bool PCI
 
(quoted diff) +0 -0

b/arch/arm/include/asm/mach/pci.h
index a38bdc7..f099067 100644

arch/arm/include/asm/mach/pci.h +7 -0
@@ -20,6 +20,9 @@ struct hw_pci {
     void        (*postinit)(void);
     u8        (*swizzle)(struct pci_dev *dev, u8 *pin);
     int        (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
+#ifdef CONFIG_PCI_DOMAINS
+    int        nr_domains;
+#endif
 };
 
 /*
@@ -37,8 +40,12 @@ struct pci_sys_data {
                     /* IRQ mapping                */
     int        (*map_irq)(struct pci_dev *, u8, u8);
     struct hw_pci    *hw;
+#ifdef CONFIG_PCI_DOMAINS
+    int        domain;
+#endif
 };
 
+
 /*
  * This is the standard PCI-PCI bridge swizzling algorithm.
  */
arch/arm/include/asm/pci.h +0 -0
index 0abf386..57ce5bd 100644
@@ -25,6 +25,11 @@ static inline void pcibios_penalize_isa_irq(int irq,

int active)

     /* We don't do dynamic PCI IRQ allocation */

}

+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus);
+int pci_proc_domain(struct pci_bus *bus);
+#endif
+
/*
* The PCI address space does equal the physical memory address space.
* The networking and block device layers use this boolean for bounce

arch/arm/kernel/bios32.c +1 -0
index 8096819..b364ca8 100644
@@ -531,6 +531,7 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
         sys->busnr   = busnr;
         sys->swizzle = hw->swizzle;
         sys->map_irq = hw->map_irq;
+        sys->domain  = hw->nr_domains;
         sys->resource[0] = &ioport_resource;
         sys->resource[1] = &iomem_resource;
 
@@ -694,3 +695,20 @@ int pci_mmap_page_range(struct pci_dev *dev, struct

vm_area_struct *vma,

     return 0;

}
+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus)
+{
+

+        //struct pci_sysdata *sd = bus->sysdata;
+        struct pci_sys_data *sd = bus->sysdata;
+        return sd->domain;

+
+}
+EXPORT_SYMBOL(pci_domain_nr);
+
+int pci_proc_domain(struct pci_bus *bus)
+{
+ return pci_domain_nr(bus);
+}
+EXPORT_SYMBOL(pci_proc_domain);
+#endif

#1 lore raw

PATCH 1/1 PCI Domains Support]

Quoted 45 lines · Richard Liu

Hi, all:

Seems ARM don's support PCI Domains function now.
Here is a tiny patch for PCI Domains support

It's work on my platform,
There are two PCIe host controller on my platform, and both bus number should be 0
So, use PCI Domain to control both PCIe host controller is better choice.

Here is platform PCIe sample code,
static struct hw_pci cxxxxxx_pcie0 __initdata = {
.swizzle = pci_std_swizzle,
.map_irq = cxxxxxx_pcie0_map_irq,
.nr_controllers = 1,
.nr_domains = 0,
.setup = cxxxxxx_pci_setup,
.scan = cxxxxxx_pci_scan_bus,
.preinit = cxxxxxx_pci_preinit,
.postinit = cxxxxxx_pcie0_postinit,
};
static struct hw_pci cxxxxxx_pcie1 __initdata = {
.swizzle = pci_std_swizzle,
.map_irq = cxxxxxx_pcie1_map_irq,
.nr_controllers = 1,
.nr_domains = 1,
.setup = cxxxxxx_pci_setup,
.scan = cxxxxxx_pci_scan_bus,
.postinit = cxxxxxx_pcie1_postinit,
};

static int __init cxxxxxx_pci_init(void)

{
        pci_common_init(&cxxxxxx_pcie0);
        pci_common_init(&cxxxxxx_pcie1);
        return 0;
}

--

arch/arm/Kconfig +0 -0
index 79a3074..33a49ba 100644

arch/arm/Kconfig config PCI · line 871

Quoted 7 lines
arch/arm/Kconfig +4 -0
@@ -865,6 +865,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
+        def_bool y
+        depends on PCI
+

The PCI_DOMAINS config variable seems unnecessary to me.

Quoted 61 lines
arch/arm/Kconfig +0 -0
 config PCI_SYSCALL
     def_bool PCI
 
arch/arm/include/asm/mach/pci.h +7 -0
index a38bdc7..f099067 100644
@@ -20,6 +20,9 @@ struct hw_pci {
     void        (*postinit)(void);
     u8        (*swizzle)(struct pci_dev *dev, u8 *pin);
     int        (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
+#ifdef CONFIG_PCI_DOMAINS
+    int        nr_domains;
+#endif
 };
 
 /*
@@ -37,8 +40,12 @@ struct pci_sys_data {
                     /* IRQ mapping                */
     int        (*map_irq)(struct pci_dev *, u8, u8);
     struct hw_pci    *hw;
+#ifdef CONFIG_PCI_DOMAINS
+    int        domain;
+#endif
 };
 
+
 /*
  * This is the standard PCI-PCI bridge swizzling algorithm.
  */
arch/arm/include/asm/pci.h +5 -0
index 0abf386..57ce5bd 100644
@@ -25,6 +25,11 @@ static inline void pcibios_penalize_isa_irq(int irq,
 int active)
     /* We don't do dynamic PCI IRQ allocation */
 }
 
+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus);
+int pci_proc_domain(struct pci_bus *bus);
+#endif
+
 /*
  * The PCI address space does equal the physical memory address space.

* The networking and block device layers use this boolean for bounce

arch/arm/kernel/bios32.c +1 -0
index 8096819..b364ca8 100644
@@ -531,6 +531,7 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
         sys->busnr   = busnr;
         sys->swizzle = hw->swizzle;
         sys->map_irq = hw->map_irq;
+        sys->domain  = hw->nr_domains;
         sys->resource[0] = &ioport_resource;
         sys->resource[1] = &iomem_resource;
 

arch/arm/kernel/bios32.c int pci_mmap_page_range(struct pci_dev *dev, struct

Quoted 9 lines
arch/arm/kernel/bios32.c +5 -0
@@ -694,3 +695,20 @@ int pci_mmap_page_range(struct pci_dev *dev, struct
 vm_area_struct *vma,
 
     return 0;
 }
+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus)
+{
+
+        //struct pci_sysdata *sd = bus->sysdata;

Should the line above should be removed?
It seems to be noise.

Quoted 21 lines
arch/arm/kernel/bios32.c +12 -0
+        struct pci_sys_data *sd = bus->sysdata;
+        return sd->domain;
+
+}
+EXPORT_SYMBOL(pci_domain_nr);
+
+int pci_proc_domain(struct pci_bus *bus)
+{
+        return pci_domain_nr(bus);
+}
+EXPORT_SYMBOL(pci_proc_domain);
+#endif

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw

PATCH 1/1 PCI Domains Support

Dear Simon:

Quoted 50 lines · Simon Horman
Quoted 48 lines · Richard Liu

Hi, all:

Seems ARM don's support PCI Domains function now.
Here is a tiny patch for PCI Domains support

It's work on my platform,
There are two PCIe host controller on my platform, and both bus number should be 0
So, use PCI Domain to control both PCIe host controller is better choice.

Here is platform PCIe sample code,
static struct hw_pci cxxxxxx_pcie0 __initdata = {
.swizzle = pci_std_swizzle,
.map_irq = cxxxxxx_pcie0_map_irq,
.nr_controllers = 1,
.nr_domains = 0,
.setup = cxxxxxx_pci_setup,
.scan = cxxxxxx_pci_scan_bus,
.preinit = cxxxxxx_pci_preinit,
.postinit = cxxxxxx_pcie0_postinit,
};
static struct hw_pci cxxxxxx_pcie1 __initdata = {
.swizzle = pci_std_swizzle,
.map_irq = cxxxxxx_pcie1_map_irq,
.nr_controllers = 1,
.nr_domains = 1,
.setup = cxxxxxx_pci_setup,
.scan = cxxxxxx_pci_scan_bus,
.postinit = cxxxxxx_pcie1_postinit,
};

static int __init cxxxxxx_pci_init(void)

{
        pci_common_init(&cxxxxxx_pcie0);
        pci_common_init(&cxxxxxx_pcie1);
        return 0;
}

--

arch/arm/Kconfig +0 -0
index 79a3074..33a49ba 100644
@@ -865,6 +865,10 @@ config PCI
       your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
       VESA. If you have PCI, say Y, otherwise N.
 
Quoted 8 lines

arch/arm/Kconfig config PCI · line 874

Quoted 5 lines
arch/arm/Kconfig +4 -0
+config PCI_DOMAINS
+        def_bool y
+        depends on PCI
+
 

The PCI_DOMAINS config variable seems unnecessary to me.

ARM is a highly custom platform, just reverse for other platform add their code,
Some platforms might need PCI domains, but some platforms not.

Quoted 64 lines
Quoted 64 lines
arch/arm/Kconfig +0 -0
 config PCI_SYSCALL
     def_bool PCI
arch/arm/include/asm/mach/pci.h +7 -0
index a38bdc7..f099067 100644
@@ -20,6 +20,9 @@ struct hw_pci {
     void        (*postinit)(void);
     u8        (*swizzle)(struct pci_dev *dev, u8 *pin);
     int        (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
+#ifdef CONFIG_PCI_DOMAINS
+    int        nr_domains;
+#endif
 };
 
 /*
@@ -37,8 +40,12 @@ struct pci_sys_data {
                     /* IRQ mapping                */
     int        (*map_irq)(struct pci_dev *, u8, u8);
     struct hw_pci    *hw;
+#ifdef CONFIG_PCI_DOMAINS
+    int        domain;
+#endif
 };
 
+
 /*
  * This is the standard PCI-PCI bridge swizzling algorithm.
  */
arch/arm/include/asm/pci.h +5 -0
index 0abf386..57ce5bd 100644
@@ -25,6 +25,11 @@ static inline void pcibios_penalize_isa_irq(int irq,
 int active)
     /* We don't do dynamic PCI IRQ allocation */
 }
 
+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus);
+int pci_proc_domain(struct pci_bus *bus);
+#endif
+
 /*
  * The PCI address space does equal the physical memory address space.

* The networking and block device layers use this boolean for bounce

arch/arm/kernel/bios32.c +1 -0
index 8096819..b364ca8 100644
@@ -531,6 +531,7 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
         sys->busnr   = busnr;
         sys->swizzle = hw->swizzle;
         sys->map_irq = hw->map_irq;
+        sys->domain  = hw->nr_domains;
         sys->resource[0] = &ioport_resource;
         sys->resource[1] = &iomem_resource;
 
@@ -694,3 +695,20 @@ int pci_mmap_page_range(struct pci_dev *dev, struct
 vm_area_struct *vma,
 
Quoted 12 lines

arch/arm/kernel/bios32.c int pci_mmap_page_range(struct pci_dev *dev, struct

Quoted 8 lines
arch/arm/kernel/bios32.c +5 -0
     return 0;
 }
+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus)
+{
+
+        //struct pci_sysdata *sd = bus->sysdata;

Should the line above should be removed?
It seems to be noise.

Yes,
I am sorry that I forget remove it when I review it.

Quoted 18 lines
Quoted 18 lines
arch/arm/kernel/bios32.c +12 -0
+        struct pci_sys_data *sd = bus->sysdata;
+        return sd->domain;
+
+}
+EXPORT_SYMBOL(pci_domain_nr);
+
+int pci_proc_domain(struct pci_bus *bus)
+{
+        return pci_domain_nr(bus);
+}
+EXPORT_SYMBOL(pci_proc_domain);
+#endif
Quoted 12 lines
Quoted 5 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091217/4c5d4bf4/attachment-0001.htm>

#3 lore raw

PATCH 1/1 PCI Domains Support

Quoted 3 lines · Richard Liu

Dear Simon:

Simon Horman wrote:

[snip]

Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
arch/arm/Kconfig +0 -0
index 79a3074..33a49ba 100644
@@ -865,6 +865,10 @@ config PCI
       your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
       VESA. If you have PCI, say Y, otherwise N.
 
Quoted 8 lines

arch/arm/Kconfig config PCI · line 874

Quoted 5 lines
arch/arm/Kconfig +4 -0
+config PCI_DOMAINS
+        def_bool y
+        depends on PCI
+
 

The PCI_DOMAINS config variable seems unnecessary to me.

Quoted 3 lines

ARM is a highly custom platform, just reverse for other platform add their code,
Some platforms might need PCI domains, but some platforms not.

Understood. Do you have any platforms in mind that wouldn't want PCI domains? I was just thinking that perhaps PCI_DOMAINS could be added later as needed, reducing noise in the code until the need arises. But perhaps I'm reading the situation incorrectly.

#4 lore raw

PATCH 1/1 PCI Domains Support

Quoted 11 lines · Simon Horman
Quoted 8 lines · Richard Liu

Dear Simon:

Simon Horman wrote:

ARM is a highly custom platform, just reverse for other platform add their code,
Some platforms might need PCI domains, but some platforms not.

Quoted 5 lines

Understood. Do you have any platforms in mind that wouldn't want PCI domains? I was just thinking that perhaps PCI_DOMAINS could be added later as needed, reducing noise in the code until the need arises. But perhaps I'm reading the situation incorrectly.

Actually, most ARM platforms didn't need PCI domains.

So, original patch is

+config PCI_DOMAINS
+ def_bool y
+ depends on PCI && ARCH_CXXXXXX
+

But I removed the "&& ARCH_CXXXXXXX" before I provided the patch. Because ARCH_CXXXXXXX is not exist in ARM Linux kernel now (maybe it would be committed at someday)

I traced other ARM platforms,
some platforms like Marvell Orion5x seems has both PCI and PCIe host controller,
Maybe they can use PCI domain to control their PCI/PCIe host controller.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091221/2622c2af/attachment-0001.htm>

#5 lore raw

PATCH 1/1 PCI Domains Support

Quoted 26 lines · Richard Liu
Quoted 11 lines · Simon Horman
Quoted 8 lines · Richard Liu

Dear Simon:

Simon Horman wrote:

ARM is a highly custom platform, just reverse for other platform add their code,
Some platforms might need PCI domains, but some platforms not.

Quoted 5 lines

Understood. Do you have any platforms in mind that wouldn't want PCI domains? I was just thinking that perhaps PCI_DOMAINS could be added later as needed, reducing noise in the code until the need arises. But perhaps I'm reading the situation incorrectly.

Actually, most ARM platforms didn't need PCI domains.

So, original patch is

arch/arm/Kconfig +4 -0
+config PCI_DOMAINS
+        def_bool y
+        depends on PCI && ARCH_CXXXXXX
+
Quoted 3 lines

But I removed the "&& ARCH_CXXXXXXX" before I provided the patch. Because ARCH_CXXXXXXX is not exist in ARM Linux kernel now (maybe it would be committed at someday)

Ok, now I am completely confused. Nothing currently in-tree should use PCI_DOMAINS, but it defaults to y and nothing switches it to n?

Perhaps the following would be more appropriate:

config PCI_DOMAINS
bool

And then platforms can "select PCI_DOMAINS" as needed.

Quoted 6 lines

I traced other ARM platforms,
some platforms like Marvell Orion5x seems has both PCI and PCIe host controller,
Maybe they can use PCI domain to control their PCI/PCIe host controller.

#7 lore raw

PATCH 1/1 PCI Domains Support

In reply to Richard Liu
Quoted 26 lines · Richard Liu
Quoted 17 lines · Simon Horman
Quoted 9 lines

Actually, most ARM platforms didn't need PCI domains.

So, original patch is

(quoted diff) +4 -0
+config PCI_DOMAINS
+        def_bool y
+        depends on PCI && ARCH_CXXXXXX
+
Quoted 4 lines

But I removed the "&& ARCH_CXXXXXXX" before I provided the patch. Because ARCH_CXXXXXXX is not exist in ARM Linux kernel now (maybe it would be committed at someday)

Ok, now I am completely confused. Nothing currently in-tree should use PCI_DOMAINS, but it defaults to y and nothing switches it to n?

Quoted 8 lines

Perhaps the following would be more appropriate:

config PCI_DOMAINS
bool

And then platforms can "select PCI_DOMAINS" as needed.

Quoted 8 lines

You are right,
Don't use def_bool is right choice.

I only maintain one arch, so I didn't think too much.

Should I regenerate a new patch, or you will handle it ?

I think it would be best if you regenerated your patch.

#6 lore raw

PATCH 1/1 PCI Domains Support

In reply to Simon Horman
Quoted 17 lines · Simon Horman
Quoted 9 lines

Actually, most ARM platforms didn't need PCI domains.

So, original patch is

arch/arm/Kconfig +4 -0
+config PCI_DOMAINS
+        def_bool y
+        depends on PCI && ARCH_CXXXXXX
+
Quoted 4 lines

But I removed the "&& ARCH_CXXXXXXX" before I provided the patch. Because ARCH_CXXXXXXX is not exist in ARM Linux kernel now (maybe it would be committed at someday)

Ok, now I am completely confused. Nothing currently in-tree should use PCI_DOMAINS, but it defaults to y and nothing switches it to n?

Quoted 8 lines

Perhaps the following would be more appropriate:

config PCI_DOMAINS
bool

And then platforms can "select PCI_DOMAINS" as needed.

You are right,
Don't use def_bool is right choice.

I only maintain one arch, so I didn't think too much.

Should I regenerate a new patch, or you will handle it ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091226/b630705f/attachment-0001.htm>

#8 lore raw

PATCH 1/1 PCI Domains Support

In reply to Simon Horman

Dear Simon:

Regenerate the patch.

--

 arch/arm/Kconfig                |    3 +++
 arch/arm/include/asm/mach/pci.h |    6 ++++++
 arch/arm/include/asm/pci.h      |    5 +++++
 arch/arm/kernel/bios32.c        |   17 +++++++++++++++++
 4 files changed, 31 insertions(+), 0 deletions(-)
arch/arm/Kconfig +3 -0
index 233a222..cd3756c 100644
@@ -957,6 +957,9 @@ 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
+        depends on PCI
+
 config PCI_SYSCALL
     def_bool PCI
 
(quoted diff) +0 -0

b/arch/arm/include/asm/mach/pci.h
index a38bdc7..e6f3ad7 100644

arch/arm/include/asm/mach/pci.h +6 -0
@@ -20,6 +20,9 @@ struct hw_pci {
     void        (*postinit)(void);
     u8        (*swizzle)(struct pci_dev *dev, u8 *pin);
     int        (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
+#ifdef CONFIG_PCI_DOMAINS
+    int        nr_domains;
+#endif
 };
 
 /*
@@ -37,6 +40,9 @@ struct pci_sys_data {
                     /* IRQ mapping                */
     int        (*map_irq)(struct pci_dev *, u8, u8);
     struct hw_pci    *hw;
+#ifdef CONFIG_PCI_DOMAINS
+    int        domain;
+#endif
 };
 
 /*
arch/arm/include/asm/pci.h +0 -0
index 226cddd..6937d58 100644
@@ -23,6 +23,11 @@ static inline void pcibios_penalize_isa_irq(int irq,

int active)

     /* We don't do dynamic PCI IRQ allocation */

}

+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus);
+int pci_proc_domain(struct pci_bus *bus);
+#endif
+
/*
* The PCI address space does equal the physical memory address space.
* The networking and block device layers use this boolean for bounce

arch/arm/kernel/bios32.c +1 -0
index 8096819..3a784a1 100644
@@ -531,6 +531,7 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
         sys->busnr   = busnr;
         sys->swizzle = hw->swizzle;
         sys->map_irq = hw->map_irq;
+        sys->domain  = hw->nr_domains;
         sys->resource[0] = &ioport_resource;
         sys->resource[1] = &iomem_resource;
 
@@ -694,3 +695,19 @@ int pci_mmap_page_range(struct pci_dev *dev, struct

vm_area_struct *vma,

     return 0;

}
+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus)
+{
+
+ struct pci_sys_data *sd = bus->sysdata;
+ return sd->domain;
+
+}
+EXPORT_SYMBOL(pci_domain_nr);
+
+int pci_proc_domain(struct pci_bus *bus)
+{
+ return pci_domain_nr(bus);
+}
+EXPORT_SYMBOL(pci_proc_domain);
+#endif

#9 lore raw

PATCH 1/1 PCI Domains Support

Quoted 3 lines · Richard Liu

Dear Simon:

Regenerate the patch.

Thanks, looks good.

Quoted 98 lines

--

 arch/arm/Kconfig                |    3 +++
 arch/arm/include/asm/mach/pci.h |    6 ++++++
 arch/arm/include/asm/pci.h      |    5 +++++
 arch/arm/kernel/bios32.c        |   17 +++++++++++++++++
 4 files changed, 31 insertions(+), 0 deletions(-)
arch/arm/Kconfig +3 -0
index 233a222..cd3756c 100644
@@ -957,6 +957,9 @@ 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
+        depends on PCI
+
 config PCI_SYSCALL
     def_bool PCI
 
arch/arm/include/asm/mach/pci.h +6 -0
index a38bdc7..e6f3ad7 100644
@@ -20,6 +20,9 @@ struct hw_pci {
     void        (*postinit)(void);
     u8        (*swizzle)(struct pci_dev *dev, u8 *pin);
     int        (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
+#ifdef CONFIG_PCI_DOMAINS
+    int        nr_domains;
+#endif
 };
 
 /*
@@ -37,6 +40,9 @@ struct pci_sys_data {
                     /* IRQ mapping                */
     int        (*map_irq)(struct pci_dev *, u8, u8);
     struct hw_pci    *hw;
+#ifdef CONFIG_PCI_DOMAINS
+    int        domain;
+#endif
 };
 
 /*
arch/arm/include/asm/pci.h +5 -0
index 226cddd..6937d58 100644
@@ -23,6 +23,11 @@ static inline void pcibios_penalize_isa_irq(int irq,
 int active)
     /* We don't do dynamic PCI IRQ allocation */
 }
 
+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus);
+int pci_proc_domain(struct pci_bus *bus);
+#endif
+
 /*
  * The PCI address space does equal the physical memory address space.

* The networking and block device layers use this boolean for bounce

arch/arm/kernel/bios32.c +17 -0
index 8096819..3a784a1 100644
@@ -531,6 +531,7 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
         sys->busnr   = busnr;
         sys->swizzle = hw->swizzle;
         sys->map_irq = hw->map_irq;
+        sys->domain  = hw->nr_domains;
         sys->resource[0] = &ioport_resource;
         sys->resource[1] = &iomem_resource;
 
@@ -694,3 +695,19 @@ int pci_mmap_page_range(struct pci_dev *dev, struct
 vm_area_struct *vma,
 
     return 0;
 }
+#ifdef CONFIG_PCI_DOMAINS
+int pci_domain_nr(struct pci_bus *bus)
+{
+
+        struct pci_sys_data *sd = bus->sysdata;
+        return sd->domain;
+
+}
+EXPORT_SYMBOL(pci_domain_nr);
+
+int pci_proc_domain(struct pci_bus *bus)
+{
+        return pci_domain_nr(bus);
+}
+EXPORT_SYMBOL(pci_proc_domain);
+#endif