Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5ab65ecdaffd85753e7ad957622afcd709a39deb
Commit:     5ab65ecdaffd85753e7ad957622afcd709a39deb
Parent:     2a5ccbc5bb471c10b58ea85ac463e70faead1c8a
Author:     Kumar Gala <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 25 13:09:42 2007 -0500
Committer:  Kumar Gala <[EMAIL PROTECTED]>
CommitDate: Fri Jun 29 01:58:13 2007 -0500

    [POWERPC] Added self_busno to indicate which bus number the PHB is
    
    Added self_busno to pci_controller and indirect PCI ops to be set by
    board code to indicate which bus number to use when talking to the PHB.
    By default we use zero since the majority of controllers that have
    implicit mechanisms to talk to the PHBs use a bus number of zero.
    
    Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 arch/powerpc/sysdev/indirect_pci.c |   12 ++++++++++--
 include/asm-ppc/pci-bridge.h       |    1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/indirect_pci.c 
b/arch/powerpc/sysdev/indirect_pci.c
index 3dedf8f..d490e71 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -33,6 +33,7 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, 
int offset,
        struct pci_controller *hose = bus->sysdata;
        volatile void __iomem *cfg_data;
        u8 cfg_type = 0;
+       u32 bus_no;
 
        if (ppc_md.pci_exclude_device)
                if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
@@ -42,8 +43,11 @@ indirect_read_config(struct pci_bus *bus, unsigned int 
devfn, int offset,
                if (bus->number != hose->first_busno)
                        cfg_type = 1;
 
+       bus_no = (bus->number == hose->first_busno) ?
+                       hose->self_busno : bus->number - hose->bus_offset;
+
        PCI_CFG_OUT(hose->cfg_addr,
-                (0x80000000 | ((bus->number - hose->bus_offset) << 16)
+                (0x80000000 | (bus_no << 16)
                  | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
 
        /*
@@ -72,6 +76,7 @@ indirect_write_config(struct pci_bus *bus, unsigned int 
devfn, int offset,
        struct pci_controller *hose = bus->sysdata;
        volatile void __iomem *cfg_data;
        u8 cfg_type = 0;
+       u32 bus_no;
 
        if (ppc_md.pci_exclude_device)
                if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
@@ -81,8 +86,11 @@ indirect_write_config(struct pci_bus *bus, unsigned int 
devfn, int offset,
                if (bus->number != hose->first_busno)
                        cfg_type = 1;
 
+       bus_no = (bus->number == hose->first_busno) ?
+                       hose->self_busno : bus->number - hose->bus_offset;
+
        PCI_CFG_OUT(hose->cfg_addr,
-                (0x80000000 | ((bus->number - hose->bus_offset) << 16)
+                (0x80000000 | (bus_no << 16)
                  | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
 
        /*
diff --git a/include/asm-ppc/pci-bridge.h b/include/asm-ppc/pci-bridge.h
index 4d35b84..2c2abda 100644
--- a/include/asm-ppc/pci-bridge.h
+++ b/include/asm-ppc/pci-bridge.h
@@ -47,6 +47,7 @@ struct pci_controller {
 
        int first_busno;
        int last_busno;
+       int self_busno;
        int bus_offset;
 
        void __iomem *io_base_virt;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to