Changeset 36288 in vbox
- Timestamp:
- Mar 15, 2011 3:16:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r36268 r36288 1811 1811 { 1812 1812 PPCIDEVICE pBridgeDev = &pBus->aPciDev; 1813 PCIDevSetByte(pBridgeDev, VBOX_PCI_PRIMARY_BUS, pGlobals->uBus); 1814 1815 /* For simplicity, let's start numbering PCI bridges from 0,1816 * not 1, so don't increment count on Host->PCI bridge.1817 */1818 if (strcmp(pBridgeDev->name, "i82801") != 0)1819 pGlobals->uBus++;1820 1821 PCIDevSetByte(pBridgeDev, VBOX_PCI_SECONDARY_BUS, pGlobals->uBus);1813 1814 /* Set only if we are not on the root bus, it has no primary bus attached. */ 1815 if (pGlobals->uBus != 0) 1816 { 1817 PCIDevSetByte(pBridgeDev, VBOX_PCI_PRIMARY_BUS, pGlobals->uBus); 1818 PCIDevSetByte(pBridgeDev, VBOX_PCI_SECONDARY_BUS, pGlobals->uBus); 1819 } 1820 1821 pGlobals->uBus++; 1822 1822 for (uint32_t iBridge = 0; iBridge < pBus->cBridges; iBridge++) 1823 1823 { … … 2105 2105 } 2106 2106 2107 /* Slot/functions assignment per table at p. 12 of ICH9 family spec update */2108 static const struct {2109 const char* pszName;2110 int32_t iSlot;2111 int32_t iFunction;2112 } PciSlotAssignments[] = {2113 /* The only override that have to be here, as host controller is added in the way invisible to bus slot assignment management,2114 maybe to be changed in the future. */2115 {2116 "i82801", 30, 0 /* Host Controller */2117 },2118 };2119 2120 2107 static bool assignPosition(PICH9PCIBUS pBus, PPCIDEVICE pPciDev, const char *pszName, int iDevFn, PciAddress* aPosition) 2121 2108 { … … 2123 2110 aPosition->iDeviceFunc = iDevFn; 2124 2111 aPosition->iRegister = 0; /* N/A */ 2125 2126 /* Hardcoded slots/functions, per chipset spec */2127 for (size_t i = 0; i < RT_ELEMENTS(PciSlotAssignments); i++)2128 {2129 if (!strcmp(pszName, PciSlotAssignments[i].pszName))2130 {2131 pciDevSetRequestedDevfunc(pPciDev);2132 aPosition->iDeviceFunc =2133 (PciSlotAssignments[i].iSlot << 3) + PciSlotAssignments[i].iFunction;2134 return true;2135 }2136 }2137 2112 2138 2113 /* Explicit slot request */ … … 2492 2467 * Fill in PCI configs and add them to the bus. 2493 2468 */ 2494 2495 /* 2496 * We emulate 82801IB ICH9 IO chip used in Q35, 2497 * see http://ark.intel.com/Product.aspx?id=31892 2498 * 2499 * Stepping S-Spec Top Marking 2500 * 2501 * A2 SLA9M NH82801IB 2502 */ 2469 /** @todo: Disabled for now because this causes error messages with Linux guests. 2470 * The guest loads the x38_edac device which tries to map a memory region 2471 * using an address given at place 0x48 - 0x4f in the PCi config space. 2472 * This fails. because we don't register such a region. 2473 */ 2474 #if 0 2503 2475 /* Host bridge device */ 2504 /* @todo: move to separate driver? */2505 2476 PCIDevSetVendorId( &pBus->aPciDev, 0x8086); /* Intel */ 2506 PCIDevSetDeviceId( &pBus->aPciDev, 0x2 44e); /* Desktop */2507 PCIDevSetRevisionId(&pBus->aPciDev, 0x 92); /* rev. A2*/2477 PCIDevSetDeviceId( &pBus->aPciDev, 0x29e0); /* Desktop */ 2478 PCIDevSetRevisionId(&pBus->aPciDev, 0x01); /* rev. 01 */ 2508 2479 PCIDevSetClassBase( &pBus->aPciDev, 0x06); /* bridge */ 2509 2480 PCIDevSetClassSub( &pBus->aPciDev, 0x00); /* Host/PCI bridge */ 2510 PCIDevSetClassProg( &pBus->aPciDev, 0x0 1); /* Supports subtractive decoding.*/2511 PCIDevSetHeaderType(&pBus->aPciDev, 0x0 1); /* bridge */2481 PCIDevSetClassProg( &pBus->aPciDev, 0x00); /* Host/PCI bridge */ 2482 PCIDevSetHeaderType(&pBus->aPciDev, 0x00); /* bridge */ 2512 2483 PCIDevSetWord(&pBus->aPciDev, VBOX_PCI_SEC_STATUS, 0x0280); /* secondary status */ 2513 PCIDevSetDWord(&pBus->aPciDev, 0x4c, 0x00001200); /* Bridge policy configuration */2514 PCIDevSetStatus (&pBus->aPciDev, VBOX_PCI_STATUS_CAP_LIST);2515 PCIDevSetCapabilityList(&pBus->aPciDev, 0x50);2516 /* capability */2517 PCIDevSetWord(&pBus->aPciDev, 0x50, VBOX_PCI_CAP_ID_SSVID);2518 PCIDevSetDWord(&pBus->aPciDev, 0x54, 0x00000000); /* Subsystem vendor ids */2519 2484 2520 2485 pBus->aPciDev.pDevIns = pDevIns; 2521 2486 /* We register Host<->PCI controller on the bus */ 2522 ich9pciRegisterInternal(pBus, -1, &pBus->aPciDev, "i82801"); 2487 ich9pciRegisterInternal(pBus, 0, &pBus->aPciDev, "dram"); 2488 #endif 2523 2489 2524 2490 /*
Note:
See TracChangeset
for help on using the changeset viewer.