]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/mpc8568mds/mpc8568mds.c
pci/fsl_pci_init: Fold pci_setup_indirect into fsl_pci_init
[u-boot] / board / freescale / mpc8568mds / mpc8568mds.c
index bc93be80fcba278d4ab983fb59e440d5697636d5..811bf5e524a9350f8c5481a61eb8a91e6d420291 100644 (file)
@@ -27,7 +27,7 @@
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
-#include <asm/immap_fsl_pci.h>
+#include <asm/fsl_pci.h>
 #include <asm/fsl_ddr_sdram.h>
 #include <spd_sdram.h>
 #include <i2c.h>
@@ -188,7 +188,7 @@ local_bus_init(void)
        sys_info_t sysinfo;
 
        get_sys_info(&sysinfo);
-       clkdiv = (lbc->lcrr & 0x0f) * 2;
+       clkdiv = (lbc->lcrr & LCRR_CLKDIV) * 2;
        lbc_hz = sysinfo.freqSystemBus / 1000000 / clkdiv;
 
        gur->lbiuiplldcr1 = 0x00078080;
@@ -243,12 +243,12 @@ sdram_init(void)
         * MPC8568 uses "new" 15-16 style addressing.
         */
        lsdmr_common = CONFIG_SYS_LBC_LSDMR_COMMON;
-       lsdmr_common |= CONFIG_SYS_LBC_LSDMR_BSMA1516;
+       lsdmr_common |= LSDMR_BSMA1516;
 
        /*
         * Issue PRECHARGE ALL command.
         */
-       lbc->lsdmr = lsdmr_common | CONFIG_SYS_LBC_LSDMR_OP_PCHALL;
+       lbc->lsdmr = lsdmr_common | LSDMR_OP_PCHALL;
        asm("sync;msync");
        *sdram_addr = 0xff;
        ppcDcbf((unsigned long) sdram_addr);
@@ -258,7 +258,7 @@ sdram_init(void)
         * Issue 8 AUTO REFRESH commands.
         */
        for (idx = 0; idx < 8; idx++) {
-               lbc->lsdmr = lsdmr_common | CONFIG_SYS_LBC_LSDMR_OP_ARFRSH;
+               lbc->lsdmr = lsdmr_common | LSDMR_OP_ARFRSH;
                asm("sync;msync");
                *sdram_addr = 0xff;
                ppcDcbf((unsigned long) sdram_addr);
@@ -268,7 +268,7 @@ sdram_init(void)
        /*
         * Issue 8 MODE-set command.
         */
-       lbc->lsdmr = lsdmr_common | CONFIG_SYS_LBC_LSDMR_OP_MRW;
+       lbc->lsdmr = lsdmr_common | LSDMR_OP_MRW;
        asm("sync;msync");
        *sdram_addr = 0xff;
        ppcDcbf((unsigned long) sdram_addr);
@@ -277,7 +277,7 @@ sdram_init(void)
        /*
         * Issue NORMAL OP command.
         */
-       lbc->lsdmr = lsdmr_common | CONFIG_SYS_LBC_LSDMR_OP_NORMAL;
+       lbc->lsdmr = lsdmr_common | LSDMR_OP_NORMAL;
        asm("sync;msync");
        *sdram_addr = 0xff;
        ppcDcbf((unsigned long) sdram_addr);
@@ -311,9 +311,6 @@ static struct pci_controller pci1_hose = {
 static struct pci_controller pcie1_hose;
 #endif  /* CONFIG_PCIE1 */
 
-extern int fsl_pci_setup_inbound_windows(struct pci_region *r);
-extern void fsl_pci_init(struct pci_controller *hose);
-
 int first_free_busno = 0;
 
 /*
@@ -397,14 +394,14 @@ pci_init_board(void)
 
                /* outbound memory */
                pci_set_region(r++,
-                               CONFIG_SYS_PCI1_MEM_BASE,
+                               CONFIG_SYS_PCI1_MEM_BUS,
                                CONFIG_SYS_PCI1_MEM_PHYS,
                                CONFIG_SYS_PCI1_MEM_SIZE,
                                PCI_REGION_MEM);
 
                /* outbound io */
                pci_set_region(r++,
-                               CONFIG_SYS_PCI1_IO_BASE,
+                               CONFIG_SYS_PCI1_IO_BUS,
                                CONFIG_SYS_PCI1_IO_PHYS,
                                CONFIG_SYS_PCI1_IO_SIZE,
                                PCI_REGION_IO);
@@ -412,9 +409,8 @@ pci_init_board(void)
                hose->region_count = r - hose->regions;
 
                hose->first_busno = first_free_busno;
-               pci_setup_indirect(hose, (int) &pci->cfg_addr, (int) &pci->cfg_data);
 
-               fsl_pci_init(hose);
+               fsl_pci_init(hose, (u32)&pci->cfg_addr, (u32)&pci->cfg_data);
                first_free_busno = hose->last_busno+1;
                printf ("PCI on bus %02x - %02x\n",hose->first_busno,hose->last_busno);
        } else {
@@ -450,14 +446,14 @@ pci_init_board(void)
 
                /* outbound memory */
                pci_set_region(r++,
-                               CONFIG_SYS_PCIE1_MEM_BASE,
+                               CONFIG_SYS_PCIE1_MEM_BUS,
                                CONFIG_SYS_PCIE1_MEM_PHYS,
                                CONFIG_SYS_PCIE1_MEM_SIZE,
                                PCI_REGION_MEM);
 
                /* outbound io */
                pci_set_region(r++,
-                               CONFIG_SYS_PCIE1_IO_BASE,
+                               CONFIG_SYS_PCIE1_IO_BUS,
                                CONFIG_SYS_PCIE1_IO_PHYS,
                                CONFIG_SYS_PCIE1_IO_SIZE,
                                PCI_REGION_IO);
@@ -465,9 +461,8 @@ pci_init_board(void)
                hose->region_count = r - hose->regions;
 
                hose->first_busno=first_free_busno;
-               pci_setup_indirect(hose, (int) &pci->cfg_addr, (int) &pci->cfg_data);
 
-               fsl_pci_init(hose);
+               fsl_pci_init(hose, (u32)&pci->cfg_addr, (u32)&pci->cfg_data);
                printf ("PCIE on bus %02x - %02x\n",hose->first_busno,hose->last_busno);
 
                first_free_busno=hose->last_busno+1;
@@ -483,9 +478,6 @@ pci_init_board(void)
 #endif /* CONFIG_PCI */
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-extern void ft_fsl_pci_setup(void *blob, const char *pci_alias,
-                       struct pci_controller *hose);
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);