]> git.sur5r.net Git - u-boot/commitdiff
pci/fsl_pci_init: Fold fsl_pci_setup_inbound_windows into fsl_pci_init
authorKumar Gala <galak@kernel.crashing.org>
Tue, 4 Aug 2009 02:02:02 +0000 (21:02 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 28 Aug 2009 22:12:35 +0000 (17:12 -0500)
Every platform that calls fsl_pci_init calls fsl_pci_setup_inbound_windows
before it calls fsl_pci_init.  There isn't any reason to just call it
from fsl_pci_init and simplify things a bit.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 files changed:
board/atum8548/atum8548.c
board/freescale/mpc8536ds/mpc8536ds.c
board/freescale/mpc8544ds/mpc8544ds.c
board/freescale/mpc8548cds/mpc8548cds.c
board/freescale/mpc8568mds/mpc8568mds.c
board/freescale/mpc8569mds/mpc8569mds.c
board/freescale/mpc8572ds/mpc8572ds.c
board/freescale/mpc8610hpcd/mpc8610hpcd.c
board/freescale/mpc8641hpcn/mpc8641hpcn.c
board/freescale/p2020ds/p2020ds.c
board/sbc8548/sbc8548.c
board/sbc8641d/sbc8641d.c
board/tqc/tqm85xx/tqm85xx.c
board/xes/common/fsl_8xxx_pci.c
drivers/pci/fsl_pci_init.c
include/asm-ppc/fsl_pci.h

index 7a02cdc5b980e412f137c3918f3f8826e075ab6e..85c0adc70cf6c49de0f2896eb6341fe9f6ebb3a2 100644 (file)
@@ -216,9 +216,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCIE1_MEM_BASE,
@@ -282,9 +279,6 @@ pci_init_board(void)
                        (uint)pci
                        );
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCI1_MEM_BASE,
@@ -320,8 +314,6 @@ pci_init_board(void)
        struct pci_region *r = hose->regions;
 
        if (!(devdisr & MPC85xx_DEVDISR_PCI2)) {
-               r += fsl_pci_setup_inbound_windows(r);
-
                pci_set_region(r++,
                               CONFIG_SYS_PCI2_MEM_BASE,
                               CONFIG_SYS_PCI2_MEM_PHYS,
index 9d2753e6e097d637bf128568deb5b668b87e89da..5bd20cee6d2ad48a5b27a078cdbc7fd91f11a65e 100644 (file)
@@ -230,9 +230,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCIE3_MEM_BUS,
@@ -284,9 +281,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCIE1_MEM_BUS,
@@ -345,9 +339,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCIE2_MEM_BUS,
@@ -412,9 +403,6 @@ pci_init_board(void)
                        (uint)pci
                        );
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCI1_MEM_BUS,
index 60bde681ea5fe329daf0ea88b9c9c3ca640a5f32..5a47d0a008e9976982cb5fd59f343b6040a1b70b 100644 (file)
@@ -139,9 +139,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCIE3_MEM_BUS,
@@ -205,9 +202,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCIE1_MEM_BUS,
@@ -266,9 +260,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCIE2_MEM_BUS,
@@ -333,9 +324,6 @@ pci_init_board(void)
                        (uint)pci
                        );
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCI1_MEM_BUS,
index d0856c43c0149052c39af5ac931be9b37d563c94..9df5f822e159c07f321e698f84c720a7e437aa98 100644 (file)
@@ -297,10 +297,6 @@ pci_init_board(void)
                        pci_arb ? "arbiter" : "external-arbiter"
                        );
 
-
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCI1_MEM_BUS,
@@ -381,9 +377,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCIE1_MEM_BUS,
index 811bf5e524a9350f8c5481a61eb8a91e6d420291..fe505b05c15b7873d06aa4a0136d1e6591e53e8e 100644 (file)
@@ -389,9 +389,6 @@ pci_init_board(void)
                        pci_arb ? "arbiter" : "external-arbiter"
                        );
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCI1_MEM_BUS,
@@ -441,9 +438,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCIE1_MEM_BUS,
index 45c518a7b35d23d54c7b3f077bd01d4157259ccb..63c21dd2a38b0d109d5c05d97e779d68809929df 100644 (file)
@@ -347,9 +347,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCIE1_MEM_BUS,
index 9d5cfd79a6ab976bed081140d12d8b4573be47a2..59d751938e57658db16480a7ca326e3b76d237ac 100644 (file)
@@ -201,9 +201,6 @@ void pci_init_board(void)
                        }
                        printf ("\n");
 
-                       /* inbound */
-                       r += fsl_pci_setup_inbound_windows(r);
-
                        /* outbound memory */
                        pci_set_region(r++,
                                        CONFIG_SYS_PCIE3_MEM_BUS,
@@ -269,9 +266,6 @@ void pci_init_board(void)
                        }
                        printf ("\n");
 
-                       /* inbound */
-                       r += fsl_pci_setup_inbound_windows(r);
-
                        /* outbound memory */
                        pci_set_region(r++,
                                        CONFIG_SYS_PCIE2_MEM_BUS,
@@ -323,9 +317,6 @@ void pci_init_board(void)
                        }
                        printf ("\n");
 
-                       /* inbound */
-                       r += fsl_pci_setup_inbound_windows(r);
-
                        /* outbound memory */
                        pci_set_region(r++,
                                        CONFIG_SYS_PCIE1_MEM_BUS,
index 98896d18a040d0bb6af7ca5feaf089f3256e5b3b..45000d92b22c7d18b1f9dd06aaa5eb169290f601 100644 (file)
@@ -260,9 +260,6 @@ void pci_init_board(void)
                if (pci->pme_msg_det)
                        pci->pme_msg_det = 0xffffffff;
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                         CONFIG_SYS_PCIE1_MEM_BUS,
@@ -313,9 +310,6 @@ void pci_init_board(void)
                if (pci->pme_msg_det)
                        pci->pme_msg_det = 0xffffffff;
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                         CONFIG_SYS_PCIE2_MEM_BUS,
@@ -360,9 +354,6 @@ void pci_init_board(void)
                        pci_agent ? "Agent" : "Host",
                        (uint)pci);
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                         CONFIG_SYS_PCI1_MEM_BUS,
index de899e8d8a742db12db1dac542ce7be81f798df5..fab4fae058c2721a6bb26d9b6d1f35a1c158c182 100644 (file)
@@ -187,9 +187,6 @@ void pci_init_board(void)
                               CONFIG_SYS_PCI1_IO_SIZE,
                               PCI_REGION_IO);
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                hose->region_count = r - hose->regions;
 
                hose->first_busno=first_free_busno;
@@ -235,9 +232,6 @@ void pci_init_board(void)
                       CONFIG_SYS_PCI2_IO_SIZE,
                       PCI_REGION_IO);
 
-       /* inbound */
-       r += fsl_pci_setup_inbound_windows(r);
-
        hose->region_count = r - hose->regions;
 
        hose->first_busno=first_free_busno;
index e2cd39c9ef18e310fb7f67c257d07b49b0e1d36b..3fe72cd32c3dcc9a942889db106298c885316f5b 100644 (file)
@@ -235,9 +235,6 @@ void pci_init_board(void)
                }
                printf("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCIE2_MEM_BUS,
@@ -306,9 +303,6 @@ void pci_init_board(void)
                }
                printf("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCIE3_MEM_BUS,
@@ -357,9 +351,6 @@ void pci_init_board(void)
                }
                printf("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCIE1_MEM_BUS,
index 978d91b4f2c89e0f9df0a7f45b9f629366e558ed..1ae4cda8b0e664452bb7b80e838b7ccc7cc7c7ab 100644 (file)
@@ -377,10 +377,6 @@ pci_init_board(void)
                        pci_arb ? "arbiter" : "external-arbiter"
                        );
 
-
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCI1_MEM_BASE,
@@ -461,13 +457,6 @@ pci_init_board(void)
                }
                printf ("\n");
 
-               /* inbound */
-               pci_set_region(r++,
-                              CONFIG_SYS_PCI_MEMORY_BUS,
-                              CONFIG_SYS_PCI_MEMORY_PHYS,
-                              CONFIG_SYS_PCI_MEMORY_SIZE,
-                              PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCIE1_MEM_BASE,
index 6d68c8e849f1ee6bc675f6a324a3782643d3e4ef..aabefa9a7564c19d88b2040865ac32373b22ce2a 100644 (file)
@@ -239,9 +239,6 @@ void pci_init_board(void)
                }
                debug("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                               CONFIG_SYS_PCI1_MEM_BUS,
@@ -280,10 +277,6 @@ void pci_init_board(void)
        struct pci_controller *hose = &pci2_hose;
        struct pci_region *r = hose->regions;
 
-
-       /* inbound */
-       r += fsl_pci_setup_inbound_windows(r);
-
        /* outbound memory */
        pci_set_region(r++,
                       CONFIG_SYS_PCI2_MEM_BUS,
index 07a6db3b8dda729ba625b3d06f3164f976479997..277edcd14e8fec16f2378427d82a3f036cdab346 100644 (file)
@@ -575,10 +575,6 @@ static inline void init_pci1(void)
                        pci_agent ? "agent" : "host",
                        pci_arb ? "arbiter" : "external-arbiter");
 
-
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region (r++,
                                CONFIG_SYS_PCI1_MEM_BASE,
@@ -651,9 +647,6 @@ static inline void init_pcie1(void)
                }
                puts ("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region (r++,
                                CONFIG_SYS_PCIE1_MEM_BASE,
index 3a4e5236b79f4d764e7a4a0ad5c8d7ccb94bb872..463588f68d8ce95d936ec272e137b6a4a332f773 100644 (file)
@@ -213,9 +213,6 @@ void pci_init_board(void)
                        host ? "host" : "agent",
                        pci_arb ? "arbiter" : "external-arbiter");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCI1_MEM_BASE,
@@ -267,9 +264,6 @@ void pci_init_board(void)
                }
                printf("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCIE1_MEM_BASE,
@@ -319,9 +313,6 @@ void pci_init_board(void)
                }
                printf("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCIE2_MEM_BASE,
@@ -371,9 +362,6 @@ void pci_init_board(void)
                }
                printf("\n");
 
-               /* inbound */
-               r += fsl_pci_setup_inbound_windows(r);
-
                /* outbound memory */
                pci_set_region(r++,
                                CONFIG_SYS_PCIE3_MEM_BASE,
index 8858657b9ee5b3bc84b5cb80bbbee48c92c68ddf..c40ab3086d02f13867b4b6c4d780a1355b3f17c3 100644 (file)
@@ -60,7 +60,7 @@ void pciauto_config_init(struct pci_controller *hose);
 #define CONFIG_SYS_PCI64_MEMORY_BUS (64ull*1024*1024*1024)
 #endif
 
-int fsl_pci_setup_inbound_windows(struct pci_region *r)
+static int fsl_pci_setup_inbound_windows(struct pci_region *r)
 {
        struct pci_region *rgn_base = r;
        u64 sz = min((u64)gd->ram_size, (1ull << 32) - 1);
@@ -145,6 +145,7 @@ void fsl_pci_init(struct pci_controller *hose, u32 cfg_addr, u32 cfg_data)
        int bridge;
        int inbound = 0;
        volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *)cfg_addr;
+       struct pci_region *reg = hose->regions + hose->region_count;
        pci_dev_t dev = PCI_BDF(busno,0,0);
 
        /* Initialize ATMU registers based on hose regions and flags */
@@ -157,6 +158,11 @@ void fsl_pci_init(struct pci_controller *hose, u32 cfg_addr, u32 cfg_data)
 
        pci_setup_indirect(hose, cfg_addr, cfg_data);
 
+       /* inbound */
+       reg += fsl_pci_setup_inbound_windows(reg);
+
+       hose->region_count = reg - hose->regions;
+
        for (r=0; r<hose->region_count; r++) {
                u32 sz = (__ilog2_u64((u64)hose->regions[r].size) - 1);
                if (hose->regions[r].flags & PCI_REGION_SYS_MEMORY) { /* inbound */
index 0473b720c5ff43ad73e4b4bf8514fa9f61d73c85..b2ff0e929afb15a4483b67b48e611a421d516392 100644 (file)
@@ -20,7 +20,6 @@
 #ifndef __FSL_PCI_H_
 #define __FSL_PCI_H_
 
-int fsl_pci_setup_inbound_windows(struct pci_region *r);
 void fsl_pci_init(struct pci_controller *hose, u32 cfg_addr, u32 cfg_data);
 void fsl_pci_config_unlock(struct pci_controller *hose);
 void ft_fsl_pci_setup(void *blob, const char *pci_alias,