- uint pex1_host = (host1_agent == 2) || (host1_agent == 3);
-
- u16 reg16, reg16_1, reg16_2, reg16_3;
- u32 reg32, i;
-
- ulong addr, data;
-
- uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
- uint devdisr = gur->devdisr;
- uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
-
- if ((io_sel==2 || io_sel==3 || io_sel==5
- || io_sel==6 || io_sel==7 || io_sel==0xF )
- && !(devdisr & MPC86xx_DEVDISR_PCIEX1)){
- printf ("PCI-EXPRESS 1: Configured as %s \n",
- pex1_agent ? "Agent" : "Host");
- printf (" Scanning PCI bus");
- debug("0x%08x=0x%08x ", &pex1->pme_msg_det,pex1->pme_msg_det);
- if (pex1->pme_msg_det) {
- pex1->pme_msg_det = 0xffffffff;
- debug (" with errors. Clearing. Now 0x%08x",
- pex1->pme_msg_det);
- }
- debug ("\n");
- }
-
- hose->first_busno = 0;
- hose->last_busno = 0x7f;
-
- pci_set_region(hose->regions + 0,
- CFG_PCI1_MEM_BASE,
- CFG_PCI1_MEM_PHYS,
- CFG_PCI1_MEM_SIZE,
- PCI_REGION_MEM);
-
- pci_set_region(hose->regions + 1,
- CFG_PCI1_IO_BASE,
- CFG_PCI1_IO_PHYS,
- CFG_PCI1_IO_SIZE,
- PCI_REGION_IO);
+ uint pcie1_host = (host1_agent == 2) || (host1_agent == 3);
+ uint pcie1_agent = (host1_agent == 0) || (host1_agent == 1);
+ uint devdisr = gur->devdisr;
+ uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
+
+ if ((io_sel ==2 || io_sel == 3 || io_sel == 5 || io_sel == 6 ||
+ io_sel == 7 || io_sel == 0xf) && !(devdisr & MPC86xx_DEVDISR_PCIEX1)){
+ printf ("PCI-EXPRESS 1: Configured as %s \n",
+ pcie1_agent ? "Agent" : "Host");
+ if(pcie1_agent) return; /*Don't scan bus when configured as agent*/
+ printf (" Scanning PCIE bus");
+ debug("0x%08x=0x%08x ", &pcie1->pme_msg_det,pcie1->pme_msg_det);
+ if (pcie1->pme_msg_det) {
+ pcie1->pme_msg_det = 0xffffffff;
+ debug (" with errors. Clearing. Now 0x%08x",
+ pcie1->pme_msg_det);
+ }
+ debug ("\n");
+ }
+ else{
+ printf("PCI-EXPRESS 1 disabled!\n");
+ return;
+ }