VirtualBox

Ignore:
Timestamp:
Jul 23, 2010 7:24:29 AM (14 years ago)
Author:
vboxsync
Message:

Audio/HDA: some notes about STATESTS, and blocking access to any registers except GCTL while reset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp

    r31033 r31035  
    8181#define WAKEEN(pState) (HDA_REG((pState), WAKEEN))
    8282
    83 #define ICH6_HDA_REG_STATES 7 /* range 0x0E */
    84 #define STATES(pState) (HDA_REG((pState), STATES))
     83#define ICH6_HDA_REG_STATESTS 7 /* range 0x0E */
     84#define STATESTS(pState) (HDA_REG((pState), STATESTS))
    8585#define ICH6_HDA_STATES_SCSF 0x7
    8686
     
    377377    /* size in quad words of RIRB buf */
    378378    uint8_t     cdqRirbBuf;
     379    /* indicates if HDA in reset. */
     380    bool        fInReset;
    379381    CODECState  Codec;
    380382} INTELHDLinkState;
     
    792794        /* exit reset state */
    793795        GCTL(pState) |= HDA_REG_FIELD_FLAG_MASK(GCTL, RST);
     796        pState->fInReset = false;
    794797    }
    795798    else
    796799    {
    797800        /* enter reset state*/
     801        if (   HDA_REG_FLAG_VALUE(pState, CORBCTL, DMA)
     802            || HDA_REG_FLAG_VALUE(pState, RIRBCTL, DMA))
     803        {
     804            Log(("hda: HDA enters in reset with DMA(RIRB:%s, CORB:%s)\n",
     805                HDA_REG_FLAG_VALUE(pState, CORBCTL, DMA) ? "on" : "off",
     806                HDA_REG_FLAG_VALUE(pState, RIRBCTL, DMA) ? "on" : "off"));
     807        }
    798808        hdaReset(ICH6_HDASTATE_2_DEVINS(pState));
    799809        GCTL(pState) &= ~HDA_REG_FIELD_FLAG_MASK(GCTL, RST);
    800         //** @todo r=michaln: The device isn't supposed to respond to any writes except to this bit now.
     810        pState->fInReset = true;
    801811    }
    802812    if (u32Value & HDA_REG_FIELD_FLAG_MASK(GCTL, FSH))
     
    12311241    uint32_t  u32Offset = GCPhysAddr - pThis->hda.addrMMReg;
    12321242    int index = hdaLookup(&pThis->hda, u32Offset);
     1243    if (pThis->hda.fInReset && index != ICH6_HDA_REG_GCTL)
     1244    {
     1245        Log(("hda: access to registers except GCTL is blocked while reset\n"));
     1246    }
    12331247    Assert(   index != -1
    12341248           && u32Offset == s_ichIntelHDRegMap[index].offset
     
    12751289    uint32_t  u32Offset = GCPhysAddr - pThis->hda.addrMMReg;
    12761290    int index = hdaLookup(&pThis->hda, u32Offset);
     1291    if (pThis->hda.fInReset && index != ICH6_HDA_REG_GCTL)
     1292    {
     1293        Log(("hda: access to registers except GCTL is blocked while reset\n"));
     1294    }
    12771295    Assert(   index != -1
    12781296           && u32Offset == s_ichIntelHDRegMap[index].offset
     
    13961414    SDFIFOS(&pThis->hda, 7) = 0xBF;
    13971415   
     1416    /* emulateion of codec "wake up" HDA spec (5.5.1 and 6.5)*/
     1417    STATESTS(&pThis->hda) = 0x1;
    13981418
    13991419    Log(("hda: reset finished\n"));
     
    15151535     * hdaReset shouldn't affects these registers.
    15161536     */
    1517     WAKEEN(&pThis->hda) = 0x1;
    1518     STATES(&pThis->hda) = 0x1;
     1537    WAKEEN(&pThis->hda) = 0x0;
     1538    STATESTS(&pThis->hda) = 0x0;
    15191539
    15201540    return VINF_SUCCESS;
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