VirtualBox

Changeset 32477 in vbox


Ignore:
Timestamp:
Sep 14, 2010 1:15:01 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
65851
Message:

PCI: BIOS & ACPI work

Location:
trunk/src/VBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r32471 r32477  
    15401540    PCIDevSetClassSub(  &pBus->aPciDev,   0x00); /* Host/PCI bridge */
    15411541    PCIDevSetClassBase( &pBus->aPciDev,   0x06); /* bridge */
    1542     PCIDevSetHeaderType(&pBus->aPciDev,   0x00);
     1542    PCIDevSetHeaderType(&pBus->aPciDev,   0x00); /* normal device */
    15431543
    15441544    pBus->aPciDev.pDevIns               = pDevIns;
    15451545    /* We register Host<->PCI controller on the bus */
    15461546    ich9pciRegisterInternal(pBus, -1, &pBus->aPciDev, "i82801");
     1547
     1548    /*
     1549     * Register I/O ports and save state.
     1550     */
     1551    rc = PDMDevHlpIOPortRegister(pDevIns, 0x0cf8, 1, NULL, ich9pciIOPortAddressWrite, ich9pciIOPortAddressRead, NULL, NULL, "ICH9 (PCI)");
     1552    if (RT_FAILURE(rc))
     1553        return rc;
     1554    rc = PDMDevHlpIOPortRegister(pDevIns, 0x0cfc, 4, NULL, ich9pciIOPortDataWrite, ich9pciIOPortDataRead, NULL, NULL, "ICH9 (PCI)");
     1555    if (RT_FAILURE(rc))
     1556        return rc;
     1557    if (fGCEnabled)
     1558    {
     1559        rc = PDMDevHlpIOPortRegisterRC(pDevIns, 0x0cf8, 1, NIL_RTGCPTR, "ich9pciIOPortAddressWrite", "ich9pciIOPortAddressRead", NULL, NULL, "ICH9 (PCI)");
     1560        if (RT_FAILURE(rc))
     1561            return rc;
     1562        rc = PDMDevHlpIOPortRegisterRC(pDevIns, 0x0cfc, 4, NIL_RTGCPTR, "ich9pciIOPortDataWrite", "ich9pciIOPortDataRead", NULL, NULL, "ICH9 (PCI)");
     1563        if (RT_FAILURE(rc))
     1564            return rc;
     1565    }
     1566    if (fR0Enabled)
     1567    {
     1568        rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x0cf8, 1, NIL_RTR0PTR, "ich9pciIOPortAddressWrite", "ich9pciIOPortAddressRead", NULL, NULL, "ICH9 (PCI)");
     1569        if (RT_FAILURE(rc))
     1570            return rc;
     1571        rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x0cfc, 4, NIL_RTR0PTR, "ich9pciIOPortDataWrite", "ich9pciIOPortDataRead", NULL, NULL, "ICH9 (PCI)");
     1572        if (RT_FAILURE(rc))
     1573            return rc;
     1574    }
     1575
    15471576
    15481577    /** @todo: other chipset devices shall be registered too */
  • trunk/src/VBox/Devices/PC/BIOS/rombios.c

    r32436 r32477  
    245245// undef enables PCIBIOS when at least one PCI device is found
    246246// i440FX is emulated by Bochs and QEMU
    247 #define PCI_FIXED_HOST_BRIDGE 0x12378086 ;; i440FX PCI bridge
     247#define PCI_FIXED_HOST_BRIDGE_1  0x12378086 ;; i440FX PCI bridge
     248#define PCI_FIXED_HOST_BRIDGE_2  0x244e8086 ;; ICH9 PCI bridge
    248249
    249250// #20  is dec 20
     
    98209821  cmp eax, #0x49435024 ;; "$PCI"
    98219822  jne unknown_service
     9823
     9824#ifdef PCI_FIXED_HOST_BRIDGE_1
    98229825  mov eax, #0x80000000
    98239826  mov dx, #0x0cf8
     
    98259828  mov dx, #0x0cfc
    98269829  in  eax, dx
    9827 #ifdef PCI_FIXED_HOST_BRIDGE
    9828   cmp eax, #PCI_FIXED_HOST_BRIDGE
    9829   jne unknown_service
    9830 #else
    9831   ;; say ok if a device is present
    9832   cmp eax, #0xffffffff
    9833   je unknown_service
     9830  cmp eax, #PCI_FIXED_HOST_BRIDGE_1
     9831  je device_ok
    98349832#endif
     9833
     9834#ifdef PCI_FIXED_HOST_BRIDGE_2
     9835  /* 0x1e << 11 */
     9836  mov eax, #0x8000f000
     9837  mov dx, #0x0cf8
     9838  out dx, eax
     9839  mov dx, #0x0cfc
     9840  in  eax, dx
     9841  cmp eax, #PCI_FIXED_HOST_BRIDGE_2
     9842  je device_ok
     9843#endif
     9844  jmp unknown_service
     9845device_ok:
    98359846  mov ebx, #0x000f0000
    98369847  mov ecx, #0
     
    1001110022  push eax
    1001210023  push dx
     10024#ifdef PCI_FIXED_HOST_BRIDGE_1
    1001310025  mov eax, #0x80000000
    1001410026  mov dx, #0x0cf8
     
    1001610028  mov dx, #0x0cfc
    1001710029  in  eax, dx
    10018 #ifdef PCI_FIXED_HOST_BRIDGE
    10019   cmp eax, #PCI_FIXED_HOST_BRIDGE
    10020   je  pci_present
    10021 #else
    10022   ;; say ok if a device is present
    10023   cmp eax, #0xffffffff
    10024   jne  pci_present
     10030  cmp eax, #PCI_FIXED_HOST_BRIDGE_1
     10031  je pci_present
     10032#endif
     10033
     10034#ifdef PCI_FIXED_HOST_BRIDGE_2
     10035  /* 0x1e << 11 */
     10036  mov eax, #0x8000f000
     10037  mov dx, #0x0cf8
     10038  out dx, eax
     10039  mov dx, #0x0cfc
     10040  in  eax, dx
     10041  cmp eax, #PCI_FIXED_HOST_BRIDGE_2
     10042  je pci_present
    1002510043#endif
    1002610044  pop dx
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r32471 r32477  
    162162    SYSTEM_INFO_INDEX_NIC_ADDRESS       = 15, /**< NIC PCI address, or 0 */
    163163    SYSTEM_INFO_INDEX_AUDIO_ADDRESS     = 16, /**< Audio card PCI address, or 0 */
    164     SYSTEM_INFO_INDEX_POWER_STATES      = 17, 
     164    SYSTEM_INFO_INDEX_POWER_STATES      = 17,
    165165    SYSTEM_INFO_INDEX_IOC_ADDRESS       = 18, /**< IO controller PCI address */
    166     SYSTEM_INFO_INDEX_END               = 19,
     166    SYSTEM_INFO_INDEX_HBC_ADDRESS       = 19, /**< host bus controller PCI address */
     167    SYSTEM_INFO_INDEX_END               = 20,
    167168    SYSTEM_INFO_INDEX_INVALID           = 0x80,
    168169    SYSTEM_INFO_INDEX_VALID             = 0x200
     
    271272    /** PCI address of the IO controller device. */
    272273    uint32_t            u32IocPciAddress;
    273     uint32_t            pad0;
     274    /** PCI address of the host bus controller device. */
     275    uint32_t            u32HbcPciAddress;
    274276
    275277    /** ACPI port base interface. */
     
    15721574                    break;
    15731575
     1576                case SYSTEM_INFO_INDEX_HBC_ADDRESS:
     1577                    *pu32 = s->u32HbcPciAddress;
     1578                    break;
     1579
    15741580                /* This is only for compatability with older saved states that
    15751581                   may include ACPI code that read these values.  Legacy is
     
    24652471                              "AudioPciAddress\0"
    24662472                              "IocPciAddress\0"
     2473                              "HostBusPciAddress\0"
    24672474                              "EnableSuspendToDisk\0"
    24682475                              "PowerS1Enabled\0"
     
    25332540        return PDMDEV_SET_ERROR(pDevIns, rc,
    25342541                                N_("Configuration error: Failed to read \"IocPciAddress\""));
     2542
     2543    /* query host bus controller PCI address */
     2544    rc = CFGMR3QueryU32Def(pCfg, "HostBusPciAddress", &s->u32HbcPciAddress, 0);
     2545    if (RT_FAILURE(rc))
     2546        return PDMDEV_SET_ERROR(pDevIns, rc,
     2547                                N_("Configuration error: Failed to read \"HostBusPciAddress\""));
    25352548
    25362549    /* query whether S1 power state should be exposed */
  • trunk/src/VBox/Devices/PC/vbox.dsl

    r32471 r32477  
    146146        HDAA,  32, // HDA PCI address
    147147        PWRS,  32, // power states
    148         IOCA,  32, // Southbridge IO controller PCI address
     148        IOCA,  32, // southbridge IO controller PCI address
     149        HBCA,  32, // host bus controller address
    149150        Offset (0x80),
    150151        ININ, 32,
     
    511512           
    512513            Name (_HID, EisaId ("PNP0A03")) // PCI bus PNP id
    513             Name (_ADR, 0x00) // address
    514             Name (_BBN, 0x00) // base bus adddress
     514            Method(_ADR, 0, NotSerialized)  // PCI address
     515            {
     516                 Return (HBCA)
     517            }
     518            Name (_BBN, 0x00) // base bus adddress (bus number)
    515519            Name (_UID, 0x00)
    516520
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r32471 r32477  
    822822        ChipsetType_T chipsetType;
    823823        hrc = pMachine->COMGETTER(ChipsetType)(&chipsetType);                                H();
    824         uint32_t u32IocPciAddress;
     824        uint32_t u32IocPciAddress, u32HbcPciAddress;
    825825
    826826        switch (chipsetType)
     
    830830            case ChipsetType_PIIX3:
    831831                InsertConfigNode(pDevices, "pci", &pDev);
     832                u32HbcPciAddress = 0;
    832833                u32IocPciAddress = (0x1 << 16) | 0; // ISA controller
    833834                break;
    834835            case ChipsetType_ICH9:
    835836                InsertConfigNode(pDevices, "ich9pci", &pDev);
     837                u32HbcPciAddress = (0x1d << 16) | 0;
    836838                u32IocPciAddress = (0x1f << 16) | 0; // LPC controller
    837839                break;
     
    877879        /* so always enable HPET in extended profile */
    878880        fHpetEnabled |= fOsXGuest;
     881        /* HPET is always present on ICH9 */
     882        fHpetEnabled |= (chipsetType == ChipsetType_ICH9);
    879883        if (fHpetEnabled)
    880884        {
     
    22792283            }
    22802284            InsertConfigInteger(pCfg,  "IocPciAddress", u32IocPciAddress);
     2285            InsertConfigInteger(pCfg,  "HostBusPciAddress", u32HbcPciAddress);
    22812286            InsertConfigInteger(pCfg,  "ShowCpu", fShowCpu);
    22822287            InsertConfigInteger(pCfg,  "CpuHotPlug", fCpuHotPlug);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette