]> git.sur5r.net Git - u-boot/blobdiff - board/sbc8641d/sbc8641d.c
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
[u-boot] / board / sbc8641d / sbc8641d.c
index 54b2d0b166b71d434dc3de3a2d3b7abd353064a8..5c30b2676e4d573b13ea047c27a95a0e04520ef5 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/immap_86xx.h>
 #include <asm/fsl_pci.h>
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_serdes.h>
 #include <libfdt.h>
 #include <fdt_support.h>
 
@@ -180,127 +181,11 @@ long int fixed_sdram (void)
  * Initialize PCI Devices, report devices found.
  */
 
-#ifndef CONFIG_PCI_PNP
-static struct pci_config_table pci_fsl86xxads_config_table[] = {
-       {PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-        PCI_IDSEL_NUMBER, PCI_ANY_ID,
-        pci_cfgfunc_config_device, {PCI_ENET0_IOADDR,
-                                    PCI_ENET0_MEMADDR,
-                                    PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER}},
-       {}
-};
-#endif
-
-static struct pci_controller pcie1_hose = {
-#ifndef CONFIG_PCI_PNP
-       config_table:pci_mpc86xxcts_config_table
-#endif
-};
-#endif /* CONFIG_PCI */
-
-#ifdef CONFIG_PCIE2
-static struct pci_controller pcie2_hose;
-#endif /* CONFIG_PCIE2 */
-
-int first_free_busno = 0;
-
 void pci_init_board(void)
 {
-       volatile immap_t *immap = (immap_t *) CONFIG_SYS_CCSRBAR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
-       uint devdisr = gur->devdisr;
-       uint io_sel = (gur->pordevsr & MPC8641_PORDEVSR_IO_SEL)
-               >> MPC8641_PORDEVSR_IO_SEL_SHIFT;
-
-#ifdef CONFIG_PCIE1
-{
-       volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCIE1_ADDR;
-       struct pci_controller *hose = &pcie1_hose;
-       struct pci_region *r = hose->regions;
-#ifdef DEBUG
-       uint host1_agent = (gur->porbmsr & MPC8641_PORBMSR_HA)
-               >> MPC8641_PORBMSR_HA_SHIFT;
-       uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
-#endif
-       if ((io_sel == 2 || io_sel == 3 || io_sel == 5
-            || io_sel == 6 || io_sel == 7 || io_sel == 0xF)
-           && !(devdisr & MPC86xx_DEVDISR_PCIEX1)) {
-               debug("PCI-EXPRESS 1: %s \n", pex1_agent ? "Agent" : "Host");
-               debug("0x%08x=0x%08x ", &pci->pme_msg_det, pci->pme_msg_det);
-               if (pci->pme_msg_det) {
-                       pci->pme_msg_det = 0xffffffff;
-                       debug(" with errors.  Clearing.  Now 0x%08x",
-                             pci->pme_msg_det);
-               }
-               debug("\n");
-
-               /* outbound memory */
-               pci_set_region(r++,
-                              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_BUS,
-                              CONFIG_SYS_PCIE1_IO_PHYS,
-                              CONFIG_SYS_PCIE1_IO_SIZE,
-                              PCI_REGION_IO);
-
-               hose->region_count = r - hose->regions;
-
-               hose->first_busno=first_free_busno;
-
-               fsl_pci_init(hose, (u32)&pci->cfg_addr, (u32)&pci->cfg_data);
-
-               first_free_busno=hose->last_busno+1;
-               printf ("    PCI-EXPRESS 1 on bus %02x - %02x\n",
-                       hose->first_busno,hose->last_busno);
-
-       } else {
-               puts("PCI-EXPRESS 1: Disabled\n");
-       }
-}
-#else
-       puts("PCI-EXPRESS1: Disabled\n");
-#endif /* CONFIG_PCIE1 */
-
-#ifdef CONFIG_PCIE2
-{
-       volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCIE2_ADDR;
-       struct pci_controller *hose = &pcie2_hose;
-       struct pci_region *r = hose->regions;
-
-       /* outbound memory */
-       pci_set_region(r++,
-                      CONFIG_SYS_PCIE2_MEM_BUS,
-                      CONFIG_SYS_PCIE2_MEM_PHYS,
-                      CONFIG_SYS_PCIE2_MEM_SIZE,
-                      PCI_REGION_MEM);
-
-       /* outbound io */
-       pci_set_region(r++,
-                      CONFIG_SYS_PCIE2_IO_BUS,
-                      CONFIG_SYS_PCIE2_IO_PHYS,
-                      CONFIG_SYS_PCIE2_IO_SIZE,
-                      PCI_REGION_IO);
-
-       hose->region_count = r - hose->regions;
-
-       hose->first_busno=first_free_busno;
-
-       fsl_pci_init(hose, (u32)&pci->cfg_addr, (u32)&pci->cfg_data);
-
-       first_free_busno=hose->last_busno+1;
-       printf ("    PCI-EXPRESS 2 on bus %02x - %02x\n",
-               hose->first_busno,hose->last_busno);
-}
-#else
-       puts("PCI-EXPRESS 2: Disabled\n");
-#endif /* CONFIG_PCIE2 */
-
+       fsl_pcie_init_board(0);
 }
+#endif /* CONFIG_PCI */
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)